function session_limit_settings_byrole in Session Limit 6.2
Same name and namespace in other branches
- 6 session_limit.module \session_limit_settings_byrole()
- 7.2 session_limit.module \session_limit_settings_byrole()
Session limit role configuration form.
1 string reference to 'session_limit_settings_byrole'
- session_limit_menu in ./
session_limit.module - Implementation of hook_menu().
File
- ./
session_limit.module, line 188 - Limits multiple sessions per user.
Code
function session_limit_settings_byrole() {
$result = db_query("SELECT name, value FROM {variable} WHERE name LIKE 'session_limit_rid_%' ORDER BY name");
while ($setting = db_fetch_object($result)) {
$role_limits[$setting->name] = unserialize($setting->value);
}
$roles = user_roles(TRUE);
foreach ($roles as $rid => $role) {
$form["session_limit_rid_{$rid}"] = array(
'#type' => 'select',
'#options' => _session_limit_user_options(),
'#title' => check_plain($role),
'#default_value' => empty($role_limits["session_limit_rid_{$rid}"]) ? 0 : $role_limits["session_limit_rid_{$rid}"],
);
}
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Save permissions'),
);
return $form;
}