You are here

function imce_update_roles in IMCE 7

Same name and namespace in other branches
  1. 6.2 inc/imce.admin.inc \imce_update_roles()
  2. 6 inc/admin.inc \imce_update_roles()

Update role-profile assignments.

1 call to imce_update_roles()
imce_update_profiles in inc/imce.admin.inc
Add, update or delete a profile.

File

inc/imce.admin.inc, line 669
Serves administration pages of IMCE.

Code

function imce_update_roles($pid) {
  $roles = variable_get('imce_roles_profiles', array());
  foreach ($roles as $rid => $role) {
    foreach ($role as $key => $value) {
      if (substr($key, -4) == '_pid') {
        if ($value == $pid) {
          $roles[$rid][$key] = 0;
        }
        elseif ($value > $pid) {
          $roles[$rid][$key]--;
        }
      }
    }
  }
  variable_set('imce_roles_profiles', $roles);
}