You are here

function cas_roles_update_7001 in CAS roles 7

Same name and namespace in other branches
  1. 7.2 cas_roles.install \cas_roles_update_7001()

Update cas_role mapping.

File

./cas_roles.install, line 57
Installation hooks for the CAS Attributes module.

Code

function cas_roles_update_7001() {
  $relations = variable_get('cas_roles_relations', array());
  $new_relations = array();
  foreach (user_roles(TRUE) as $rid => $role) {
    if (isset($relations[$rid])) {
      $new_relations[$role] = $relations[$rid];
    }
  }
  variable_set('cas_roles_relations', $new_relations);
}