1 # Blosxom Plugin: whoami
2 # Author(s): Rael Dornfest <rael@oreilly.com>
3 # Modified: Gerfried Fuchs <alfie@ist.org>
4 # Allows ?user=$whoami::username links to just request that user's entries
5 # $whoami::fullname is stripped off the GECOS stuff
7 # Documentation: See the bottom of this file or type: perldoc whoami
11 # --- Configurable variables -----
13 # --------------------------------
26 my($pkg, $path, $filename, $story_ref, $title_ref, $body_ref) = @_;
28 $username = $fullname = '';
30 if ( -e "$blosxom::datadir$path/$filename.$blosxom::file_extension" ) {
31 my @user_info = getpwuid( File::stat::stat("$blosxom::datadir$path/$filename.$blosxom::file_extension")->uid );
32 ($username, $fullname) = ($user_info[0],$user_info[6] =~ m/^([^,]*)/);
40 my ($files, $others) = @_;
42 foreach (keys %$files) {
43 delete $files->{$_} if getpwuid((stat($_))[4]) ne param('user');
54 Blosxom Plug-in: whoami
58 Populates $whoami::username and $whoami::$fullname with
59 local username and full name, respectively, for each story. Useful
60 for group Blosxom blogs. You can also request just the blog entries
61 of a specific username by linking things like
62 $url?user=$whoami::username.
68 Version number coincides with the version of Blosxom with which the
69 current version was first bundled.
73 Rael Dornfest <rael@oreilly.com>, http://www.raelity.org/
77 Blosxom Home/Docs/Licensing: http://www.raelity.org/apps/blosxom/
79 Blosxom Plugin Docs: http://www.raelity.org/apps/blosxom/plugin.shtml
83 Address bug reports and comments to the Blosxom mailing list
84 [http://www.yahoogroups.com/group/blosxom].
88 Blosxom and this Blosxom Plug-in
89 Copyright 2003, Rael Dornfest
91 Permission is hereby granted, free of charge, to any person obtaining a
92 copy of this software and associated documentation files (the "Software"),
93 to deal in the Software without restriction, including without limitation
94 the rights to use, copy, modify, merge, publish, distribute, sublicense,
95 and/or sell copies of the Software, and to permit persons to whom the
96 Software is furnished to do so, subject to the following conditions:
98 The above copyright notice and this permission notice shall be included
99 in all copies or substantial portions of the Software.
101 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
102 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
103 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
104 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
105 OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
106 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
107 OTHER DEALINGS IN THE SOFTWARE.