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/
75 This plugin is now maintained by the Blosxom Sourceforge Team,
76 <blosxom-devel@lists.sourceforge.net>.
80 Blosxom Home/Docs/Licensing: http://blosxom.sourceforge.net/
82 Blosxom Plugin Docs: http://blosxom.sourceforge.net/documentation/users/plugins.html
86 None known; please send bug reports and feedback to the Blosxom
87 development mailing list <blosxom-devel@lists.sourceforge.net>.
91 Blosxom and this Blosxom Plug-in
92 Copyright 2003, Rael Dornfest
94 Permission is hereby granted, free of charge, to any person obtaining a
95 copy of this software and associated documentation files (the "Software"),
96 to deal in the Software without restriction, including without limitation
97 the rights to use, copy, modify, merge, publish, distribute, sublicense,
98 and/or sell copies of the Software, and to permit persons to whom the
99 Software is furnished to do so, subject to the following conditions:
101 The above copyright notice and this permission notice shall be included
102 in all copies or substantial portions of the Software.
104 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
105 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
106 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
107 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
108 OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
109 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
110 OTHER DEALINGS IN THE SOFTWARE.