function user_admin_account in Drupal 4
Same name and namespace in other branches
- 5 modules/user/user.module \user_admin_account()
- 6 modules/user/user.admin.inc \user_admin_account()
- 7 modules/user/user.admin.inc \user_admin_account()
1 call to user_admin_account()
- user_admin in modules/
user.module
File
- modules/
user.module, line 1960 - Enables the user registration and login system.
Code
function user_admin_account() {
$header = array(
array(
'data' => t('Username'),
'field' => 'u.name',
),
array(
'data' => t('Status'),
'field' => 'u.status',
),
array(
'data' => t('Member for'),
'field' => 'u.created',
'sort' => 'desc',
),
array(
'data' => t('Last access'),
'field' => 'u.access',
),
t('Operations'),
);
$sql = 'SELECT u.uid, u.name, u.status, u.created, u.access FROM {users} u WHERE uid != 0';
$sql .= tablesort_sql($header);
$result = pager_query($sql, 50);
$status = array(
t('blocked'),
t('active'),
);
while ($account = db_fetch_object($result)) {
$rows[] = array(
theme('username', $account),
$status[$account->status],
format_interval(time() - $account->created),
$account->access ? t('%time ago', array(
'%time' => format_interval(time() - $account->access),
)) : t('never'),
l(t('edit'), "user/{$account->uid}/edit", array()),
);
}
$output = theme('table', $header, $rows);
$output .= theme('pager', NULL, 50, 0);
return $output;
}