Author: spadkins
Date: Tue May 2 06:52:02 2006
New Revision: 6003
Modified:
p5ee/trunk/App-Context/lib/App/Context/Cmd.pm
Log:
$context->user() can now return a user other than the login user
Modified: p5ee/trunk/App-Context/lib/App/Context/Cmd.pm
==============================================================================
--- p5ee/trunk/App-Context/lib/App/Context/Cmd.pm (original)
+++ p5ee/trunk/App-Context/lib/App/Context/Cmd.pm Tue May 2 06:52:02 2006
@@ -8,7 +8,9 @@
use App;
use App::Context;
+
@ISA = ( "App::Context" );
+
use App::UserAgent;
use strict;
@@ -192,7 +194,7 @@
sub user {
my $self = shift;
- return (getlogin || (getpwuid($<))[0] || "guest");
+ return ($self->{user} || getlogin || (getpwuid($<))[0] || "guest");
}
1;