function role_delegation_roles_form_submit in Role Delegation 7
Same name and namespace in other branches
- 5 role_delegation.module \role_delegation_roles_form_submit()
- 6 role_delegation.module \role_delegation_roles_form_submit()
Saves the roles assigned to the account given in the form.
File
- ./
role_delegation.module, line 119 - This module allows site administrators to grant some roles the authority to change roles assigned to users, without them needing the 'administer access control' permission.
Code
function role_delegation_roles_form_submit($form, &$form_state) {
if (is_array($form_state['values']['roles_change']) && isset($form_state['values']['account']->uid)) {
$uid = (int) $form_state['values']['account']->uid;
role_delegation_save(array(
$uid,
), $form_state['values']['roles_change']);
drupal_set_message(t('The roles have been updated.'));
}
}