[svn:p5ee] r6003 - p5ee/trunk/App-Context/lib/App/Context

[email protected]
Newsgroups perl.cvs.p5ee
Message-ID <[email protected]>
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;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.