Description:
Lists all users. fields include username/uid, group, creation time/ip, realemail, and admin notes.
Box Code:
# require edit_user privs
return '' unless $S->have_perm('edit_user');
my $notes = $S->var('allow_admin_notes');
my $what = 'nickname,uid,creation_time,creation_ip,perm_group,realemail';
$what .= ',admin_notes' if ${notes};
my ($rv,$sth) = $S->db_select({
WHAT => "$what",
FROM => 'users',
ORDER_BY=> "uid"
});
return '' unless $rv;
my $return='<div class="userlist">';
$return .= '<table cellpadding=3 border=0 cellspacing=1>';
$return .= '<tr>';
$return .= '<th>User</th>';
$return .= '<th>Group</th>';
$return .= '<th>Creation Time</th>';
$return .= '<th>Creation IP</th>';
$return .= $notes ? '<th>Email/Notes</th>' : '<th>Email</th>';
$return .= '</tr>';
while (my $r = $sth->fetchrow_hashref) {
$return .= '<tr>';
$return .= '<td><a href="|rootdir|/user/uid:' . $r->{uid} . '">' . $r->{nickname} . '</a></td>';
$return .= '<td>' . $r->{perm_group} . '</td>';
$return .= '<td>' . $r->{creation_time} . '</td>';
$return .= '<td>' . $r->{creation_ip} . '</td>';
$return .= '<td>' . '<i>' . $r->{realemail} . '</i>' . '<br>';
$return .= $r->{admin_notes} if $notes;
$return .= '</td>';
$return .= '</tr>';
};
$sth->finish();
$return .= '</table>';
$return .= '</div>';
return $return;
|