user_admin_account

Versions
4.6 – 7
user_admin_account()

Code

modules/user.module, line 1960

<?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;
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.