function _systeminfo_admin_drupal_users in System Information 6.3
Same name and namespace in other branches
- 7.3 systeminfo.admin.drupal.inc \_systeminfo_admin_drupal_users()
1 call to _systeminfo_admin_drupal_users()
- systeminfo_admin_drupal in ./
systeminfo.admin.drupal.inc - Menu callback; displays the Drupal page.
File
- ./
systeminfo.admin.drupal.inc, line 89 - Admin Drupal page callbacks for the systeminfo module.
Code
function _systeminfo_admin_drupal_users() {
$header = array();
$header[] = t('Group');
$header[] = t('Accounts');
$rows = array();
$rows[] = array(
t('Total'),
db_result(db_query('SELECT COUNT(uid) FROM {users} WHERE uid <> 0')),
);
$rows[] = array(
array(
'data' => t('Status'),
'class' => 'title1',
'colspan' => '2',
),
);
$rows[] = array(
array(
'data' => t('Active'),
'class' => 'text1',
),
db_result(db_query('SELECT COUNT(uid) FROM {users} WHERE uid <> 0 AND status = 1')),
);
$rows[] = array(
array(
'data' => t('Already logged in'),
'class' => 'text2',
),
db_result(db_query('SELECT COUNT(uid) FROM {users} WHERE uid <> 0 AND status = 1 AND login <> 0')),
);
$rows[] = array(
array(
'data' => t('Not yet logged in'),
'class' => 'text2',
),
db_result(db_query('SELECT COUNT(uid) FROM {users} WHERE uid <> 0 AND status = 1 AND login = 0')),
);
$rows[] = array(
array(
'data' => t('Blocked'),
'class' => 'text1',
),
db_result(db_query('SELECT COUNT(uid) FROM {users} WHERE uid <> 0 AND status = 0')),
);
$rows[] = array(
array(
'data' => t('Already logged in'),
'class' => 'text2',
),
db_result(db_query('SELECT COUNT(uid) FROM {users} WHERE uid <> 0 AND status = 0 AND login <> 0')),
);
$rows[] = array(
array(
'data' => t('Not yet logged in'),
'class' => 'text2',
),
db_result(db_query('SELECT COUNT(uid) FROM {users} WHERE uid <> 0 AND status = 0 AND login = 0')),
);
$rows[] = array(
array(
'data' => t('Roles'),
'class' => 'title1',
'colspan' => '2',
),
);
$result = db_query('SELECT rid, name FROM {role} WHERE rid <> %d ORDER BY name', DRUPAL_ANONYMOUS_RID);
while ($record = db_fetch_object($result)) {
$count = $record->rid != DRUPAL_AUTHENTICATED_RID ? db_result(db_query('SELECT COUNT(uid) FROM {users_roles} WHERE rid = %d', $record->rid)) : db_result(db_query('SELECT COUNT(uid) FROM {users} WHERE uid <> 0'));
$rows[] = array(
array(
'data' => check_plain($record->name),
'class' => 'text1',
),
$count,
);
}
return theme('table', $header, $rows, array(
'class' => 'systeminfo systeminfo-width50',
));
}