| Versions | |
|---|---|
| 4.7 – 7 | user_admin_account() |
modules/
<?php
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;
}
?>