You are here

function tinybrowser_update_roles in TinyBrowser 7

Update role profile assignments

1 call to tinybrowser_update_roles()
tinybrowser_update_profiles in ./tinybrowser.module
Add, update or delete a profile

File

./tinybrowser.module, line 972

Code

function tinybrowser_update_roles($pid) {
  $roles = variable_get('tinybrowser_roles_profiles', array());
  foreach ($roles as $rid => $role) {
    if ($role['pid'] == $pid) {
      $roles[$rid]['pid'] = 0;
    }
    else {
      if ($role['pid'] > $pid) {
        $roles[$rid]['pid']--;
      }
    }
  }
  variable_set('tinybrowser_roles_profiles', $roles);
}