summaryrefslogtreecommitdiffstats
path: root/editusers.cgi
diff options
context:
space:
mode:
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());