You are here

function imce_admin_check_wildcard_upload in IMCE 7

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

Checks if the given role can upload all extensions.

2 calls to imce_admin_check_wildcard_upload()
imce_admin in inc/imce.admin.inc
Admin main page.
imce_admin_form_validate in inc/imce.admin.inc
Validate admin form.

File

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

Code

function imce_admin_check_wildcard_upload($rid, $conf = NULL) {
  if (!isset($conf)) {
    $conf = variable_get('imce_roles_profiles', array());
  }
  if (!empty($conf[$rid])) {
    foreach ($conf[$rid] as $key => $pid) {
      if ($pid && substr($key, -4) == '_pid') {
        if ($profile = imce_load_profile($pid)) {
          if ($profile['extensions'] === '*' && !empty($profile['directories'])) {
            foreach ($profile['directories'] as $dirconf) {
              if (!empty($dirconf['upload'])) {
                return $key;
              }
            }
          }
        }
      }
    }
  }
  return FALSE;
}