function role_export_roles in Role Export 6
Same name and namespace in other branches
- 7 role_export.module \role_export_roles()
Create an array with the current roles in the system.
7 calls to role_export_roles()
- role_export_drush_exit in ./
role_export.module - Implements hook_drush_exit().
- role_export_features_export_options in ./
role_export.module - Implements hook_features_export_options().
- role_export_features_export_render in ./
role_export.module - Implements hook_features_export_render().
- role_export_features_rebuild in ./
role_export.module - Implements hook_features_rebuild().
- role_export_form_alter in ./
role_export.module - Implements hook_form_alter().
File
- ./
role_export.module, line 130 - Role Export's primary module file.
Code
function role_export_roles($reset = FALSE) {
static $roles;
if (!isset($roles) || $reset) {
$roles = array();
// Select all roles that are not 'anonymous' or 'authenticated'
$query = db_query("SELECT rid, name, machine_name FROM {role} WHERE rid > 2");
while ($value = db_fetch_object($query)) {
$roles[$value->rid] = $value;
}
}
return $roles;
}