summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authorbugreport%peshkin.net <>2005-10-14 08:58:24 +0200
committerbugreport%peshkin.net <>2005-10-14 08:58:24 +0200
commita23da324a647296a31436631b958bc3443ceaaf2 (patch)
treefe960b4a3e6d8da50b3b6a0db5407cdefa461029 /Bugzilla
parent4587cba89586ff3e00ed863748857ecf56a41532 (diff)
downloadbugzilla-a23da324a647296a31436631b958bc3443ceaaf2.tar.gz
bugzilla-a23da324a647296a31436631b958bc3443ceaaf2.tar.xz
Bug 204498 Add su (setuser) function
Patch by A. Karl Kornel <karl@kornel.name> r=joel, a=justdave
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/Error.pm1
-rw-r--r--Bugzilla/Template.pm5
2 files changed, 6 insertions, 0 deletions
diff --git a/Bugzilla/Error.pm b/Bugzilla/Error.pm
index 0f4caf274..d23e68d78 100644
--- a/Bugzilla/Error.pm
+++ b/Bugzilla/Error.pm
@@ -51,6 +51,7 @@ sub _throw_error {
$mesg .= "$name $error ";
$mesg .= "$ENV{REMOTE_ADDR} " if $ENV{REMOTE_ADDR};
$mesg .= Bugzilla->user->login;
+ $mesg .= (' actually ' . Bugzilla->sudoer->login) if Bugzilla->sudoer;
$mesg .= "\n";
my %params = Bugzilla->cgi->Vars;
$Data::Dumper::Useqq = 1;
diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm
index a4b8084d0..b1646dbf0 100644
--- a/Bugzilla/Template.pm
+++ b/Bugzilla/Template.pm
@@ -497,8 +497,13 @@ sub create {
'lsearch' => \&Bugzilla::Util::lsearch,
# Currently logged in user, if any
+ # If an sudo session is in progress, this is the user we're faking
'user' => sub { return Bugzilla->user; },
+ # If an sudo session is in progress, this is the user who
+ # started the session.
+ 'sudoer' => sub { return Bugzilla->sudoer; },
+
# UserInGroup. Deprecated - use the user.* functions instead
'UserInGroup' => \&Bugzilla::User::UserInGroup,