summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xeditusers.cgi16
-rw-r--r--template/en/default/account/profile-activity.html.tmpl2
-rw-r--r--template/en/default/admin/users/edit.html.tmpl12
-rw-r--r--template/en/default/admin/users/list.html.tmpl11
-rw-r--r--template/en/default/global/user-error.html.tmpl2
5 files changed, 36 insertions, 7 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());
diff --git a/template/en/default/account/profile-activity.html.tmpl b/template/en/default/account/profile-activity.html.tmpl
index ee00875fe..aa6a63e85 100644
--- a/template/en/default/account/profile-activity.html.tmpl
+++ b/template/en/default/account/profile-activity.html.tmpl
@@ -35,7 +35,7 @@
#%]
[% title = BLOCK %]
- Account History for '[% otheruser.login FILTER html %]'
+ [% IF action == 'admin_activity' %]Admin[% ELSE %]Account[% END %] History for '[% otheruser.login FILTER html %]'
[% END %]
diff --git a/template/en/default/admin/users/edit.html.tmpl b/template/en/default/admin/users/edit.html.tmpl
index 3efa4b8bf..010cacb73 100644
--- a/template/en/default/admin/users/edit.html.tmpl
+++ b/template/en/default/admin/users/edit.html.tmpl
@@ -116,9 +116,15 @@
<input type="hidden" name="token" value="[% token FILTER html %]">
[% INCLUDE listselectionhiddenfields %]
- or <a href="editusers.cgi?action=activity&amp;userid=[% otheruser.id %]"
- title="View Account History for '
- [%- otheruser.login FILTER html %]'">View Account History</a>
+ [% IF editusers %], [% ELSE %] or [% END %]
+ <a href="editusers.cgi?action=activity&amp;userid=[% otheruser.id %]"
+ title="View Account History for '
+ [%- otheruser.login FILTER html %]'">View Account History</a>
+ [% IF editusers %]
+ or <a href="editusers.cgi?action=admin_activity&amp;userid=[% otheruser.id %]"
+ title="View Account History for '
+ [%- otheruser.login FILTER html %]'">View Admin History</a>
+ [% END %]
</p>
</form>
<p>
diff --git a/template/en/default/admin/users/list.html.tmpl b/template/en/default/admin/users/list.html.tmpl
index 3f745a458..4d1d35c95 100644
--- a/template/en/default/admin/users/list.html.tmpl
+++ b/template/en/default/admin/users/list.html.tmpl
@@ -51,6 +51,17 @@
]
%]
+[% IF editusers %]
+ [% columns.push({
+ heading => 'Admin History'
+ content => 'View'
+ contentlink => 'editusers.cgi?action=admin_activity' _
+ '&amp;userid=%%userid%%' _
+ listselectionurlparams
+ })
+ %]
+[% END %]
+
[% IF Param('allowuserdeletion') && editusers %]
[% columns.push({heading => 'Action'
content => 'Delete'
diff --git a/template/en/default/global/user-error.html.tmpl b/template/en/default/global/user-error.html.tmpl
index 6a37d07e2..acdb11381 100644
--- a/template/en/default/global/user-error.html.tmpl
+++ b/template/en/default/global/user-error.html.tmpl
@@ -160,6 +160,8 @@
use
[% ELSIF action == "approve" %]
approve
+ [% ELSIF action == "admin_activity" %]
+ view admin activity for
[% ELSE %]
[%+ Hook.process('auth_failure_action') %]
[% END %]