You are here

function imce_admin_check_wildcard_upload in IMCE 6.2

Same name and namespace in other branches
  1. 7 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 693
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 (isset($conf[$rid]['pid']) && ($pid = $conf[$rid]['pid'])) {
    if ($profile = imce_load_profile($pid)) {
      if ($profile['extensions'] === '*' && !empty($profile['directories'])) {
        foreach ($profile['directories'] as $dirconf) {
          if (!empty($dirconf['upload'])) {
            return $pid;
          }
        }
      }
    }
  }
  return FALSE;
}