Description:
Lists all users. Expanded and modifed from theantix's list_all_users box. [update 2004-05-23: change UI->VARS notation to var(...) notation
Box Code:
# require edit_user privs
return '' unless $S->have_perm('edit_user');
my $notes = $S->var('allow_admin_notes');
my $what = 'u.nickname, u.uid, u.creation_time, u.creation_ip';
$what .= ', u.admin_notes' if ${notes};
my ($rv,$sth) = $S->db_select({
WHAT => "$what",
FROM => 'users u',
ORDER_BY=> "u.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>Creation Time</th>';
$return .= '<th>Creation IP</th>';
$return .= '<th>Notes</th>' if ${notes};
$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->{creation_time} . '</td>';
$return .= '<td>' . $r->{creation_ip} . '</td>';
$return .= '<td>' . $r->{admin_notes} . '</td>' if ${notes};
$return .= '</tr>';
};
$sth->finish();
$return .= '</table>';
$return .= '</div>';
return $return;
|