summaryrefslogtreecommitdiffstats
path: root/editusers.cgi
diff options
context:
space:
mode:
authorDave Lawrence <dlawrence@mozilla.com>2012-02-08 21:19:05 +0100
committerDave Lawrence <dlawrence@mozilla.com>2012-02-08 21:19:05 +0100
commit01e3e73823886636357220f423af08e87af2eba6 (patch)
tree50894d06b7fbfd72822bd8db17454af97e65b384 /editusers.cgi
parent36dd0f79824db0169d9b996834602dc2c20f1590 (diff)
downloadbugzilla-01e3e73823886636357220f423af08e87af2eba6.tar.gz
bugzilla-01e3e73823886636357220f423af08e87af2eba6.tar.xz
Bug 533012 - add the ability to see all the administrative actions performed by a user
r=glob
Diffstat (limited to 'editusers.cgi')
-rwxr-xr-xeditusers.cgi16
1 files changed, 13 insertions, 3 deletions
diff --git a/editusers.cgi b/editusers.cgi
index c25c5e9ef..fb8238d4b 100755
--- a/editusers.cgi
+++ b/editusers.cgi
@@ -655,8 +655,17 @@ if ($action eq 'search') {
}
###########################################################################
-} elsif ($action eq 'activity') {
+} elsif ($action eq 'activity' || $action eq 'admin_activity') {
my $otherUser = check_user($otherUserID, $otherUserLogin);
+ my $activity_who = "profiles_activity.who";
+ my $activity_userid = "profiles_activity.userid";
+
+ if ($action eq 'admin_activity') {
+ $editusers || ThrowUserError("auth_failure", { group => "editusers",
+ action => "admin_activity",
+ object => "users" });
+ ($activity_userid, $activity_who) = ($activity_who, $activity_userid);
+ }
$vars->{'profile_changes'} = $dbh->selectall_arrayref(
"SELECT profiles.login_name AS who, " .
@@ -665,14 +674,15 @@ if ($action eq 'search') {
profiles_activity.oldvalue AS removed,
profiles_activity.newvalue AS added
FROM profiles_activity
- INNER JOIN profiles ON profiles_activity.who = profiles.userid
+ INNER JOIN profiles ON $activity_who = profiles.userid
INNER JOIN fielddefs ON fielddefs.id = profiles_activity.fieldid
- WHERE profiles_activity.userid = ?
+ WHERE $activity_userid = ?
ORDER BY profiles_activity.profiles_when",
{'Slice' => {}},
$otherUser->id);
$vars->{'otheruser'} = $otherUser;
+ $vars->{'action'} = $action;
$template->process("account/profile-activity.html.tmpl", $vars)
|| ThrowTemplateError($template->error());