projects
/
matthijs
/
upstream
/
blosxom-plugins.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
43ee591
)
Applied patch from Gerfried Fuchs (Debian blosxom package maintainer)
author
Bill Ward
<billward@users.sourceforge.net>
Fri, 24 Aug 2007 07:02:53 +0000
(07:02 +0000)
committer
Bill Ward
<billward@users.sourceforge.net>
Fri, 24 Aug 2007 07:02:53 +0000
(07:02 +0000)
general/whoami
patch
|
blob
|
history
diff --git
a/general/whoami
b/general/whoami
index 0caf82a8c5aa8311c77f71af42fae9462759ff36..c812371728f29839aa719a6de3629e28c2538b36 100644
(file)
--- a/
general/whoami
+++ b/
general/whoami
@@
-1,6
+1,9
@@
# Blosxom Plugin: whoami
# Author(s): Rael Dornfest <rael@oreilly.com>
# Blosxom Plugin: whoami
# Author(s): Rael Dornfest <rael@oreilly.com>
-# Version: 2.0b4-5
+# Modified: Gerfried Fuchs <alfie@ist.org>
+# Allows ?user=$whoami::username links to just request that user's entries
+# $whoami::fullname is stripped off the GECOS stuff
+# Version: 2.0b4-5.1
# Documentation: See the bottom of this file or type: perldoc whoami
package whoami;
# Documentation: See the bottom of this file or type: perldoc whoami
package whoami;
@@
-12,7
+15,8
@@
package whoami;
$fullname;
$username;
$fullname;
$username;
-use File::stat;
+use File::stat qw();
+use CGI qw(param);
sub start {
1;
sub start {
1;
@@
-24,13
+28,23
@@
sub story {
$username = $fullname = '';
if ( -e "$blosxom::datadir$path/$filename.$blosxom::file_extension" ) {
$username = $fullname = '';
if ( -e "$blosxom::datadir$path/$filename.$blosxom::file_extension" ) {
- my @user_info = getpwuid( stat("$blosxom::datadir$path/$filename.$blosxom::file_extension")->uid );
- ($username, $fullname) = ($user_info[0],$user_info[6]);
+ my @user_info = getpwuid(
File::stat::
stat("$blosxom::datadir$path/$filename.$blosxom::file_extension")->uid );
+ ($username, $fullname) = ($user_info[0],$user_info[6]
=~ m/^([^,]*)/
);
};
1;
}
};
1;
}
+sub filter {
+ my $self = shift;
+ my ($files, $others) = @_;
+ if (param('user')) {
+ foreach (keys %$files) {
+ delete $files->{$_} if getpwuid((stat($_))[4]) ne param('user');
+ }
+ }
+}
+
1;
__END__
1;
__END__
@@
-43,7
+57,9
@@
Blosxom Plug-in: whoami
Populates $whoami::username and $whoami::$fullname with
local username and full name, respectively, for each story. Useful
Populates $whoami::username and $whoami::$fullname with
local username and full name, respectively, for each story. Useful
-for group Blosxom blogs.
+for group Blosxom blogs. You can also request just the blog entries
+of a specific username by linking things like
+$url?user=$whoami::username.
=head1 VERSION
=head1 VERSION