You are here

function _systeminfo_admin_drupal_roles in System Information 6.3

Same name and namespace in other branches
  1. 7.3 systeminfo.admin.drupal.inc \_systeminfo_admin_drupal_roles()
1 call to _systeminfo_admin_drupal_roles()
systeminfo_admin_drupal in ./systeminfo.admin.drupal.inc
Menu callback; displays the Drupal page.

File

./systeminfo.admin.drupal.inc, line 114
Admin Drupal page callbacks for the systeminfo module.

Code

function _systeminfo_admin_drupal_roles() {
  $header = array();
  $header[] = t('Group');
  $header[] = t('Permissions');
  $perms = array();
  $result = db_query('SELECT r.name, p.perm FROM {role} r LEFT JOIN {permission} p ON r.rid = p.rid ORDER BY r.name');
  while ($record = db_fetch_object($result)) {
    $perms = explode(', ', $record->perm);
    asort($perms);
    $row = array();
    $row[] = check_plain($record->name);
    $row[] = !empty($record->perm) ? theme('item_list', $perms) : '';
    $rows[] = $row;
  }
  return theme('table', $header, $rows, array(
    'class' => 'systeminfo systeminfo-width50',
  ));
}