You are here

function imce_update_7002 in IMCE 7

Fixes misconfigurations where anonymous user is given User-1 profile

File

./imce.install, line 110
Installs, updates, and uninstalls IMCE.

Code

function imce_update_7002() {
  $roles = variable_get('imce_roles_profiles', array());
  $rid = DRUPAL_ANONYMOUS_RID;
  if (!empty($roles[$rid])) {
    $update = FALSE;
    foreach ($roles[$rid] as $key => $value) {
      if ($value == 1 && substr($key, -4) == '_pid') {
        $roles[$rid][$key] = '0';
        $update = TRUE;
      }
    }
    if ($update) {
      variable_set('imce_roles_profiles', $roles);
    }
  }
}