diff options
Diffstat (limited to 'editusers.cgi')
-rwxr-xr-x | editusers.cgi | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/editusers.cgi b/editusers.cgi index 4182f6875..a6a93c41e 100755 --- a/editusers.cgi +++ b/editusers.cgi @@ -80,7 +80,8 @@ if ($action eq 'search') { my $matchstr = trim($cgi->param('matchstr')); my $matchtype = $cgi->param('matchtype'); my $grouprestrict = $cgi->param('grouprestrict') || '0'; - my $query = 'SELECT DISTINCT userid, login_name, realname, is_enabled ' . + my $query = 'SELECT DISTINCT userid, login_name, realname, is_enabled, ' . + $dbh->sql_date_format('last_seen_date', '%Y-%m-%d') . ' AS last_seen_date ' . 'FROM profiles'; my @bindValues; my $nextCondition; @@ -658,8 +659,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, " . @@ -668,14 +678,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()); |