You are here

function imce_perm_exists in IMCE 6.2

Same name and namespace in other branches
  1. 6 inc/page.inc \imce_perm_exists()
  2. 7 inc/imce.page.inc \imce_perm_exists()

Check if a permission is given to at least one directory in the list.

2 calls to imce_perm_exists()
imce_content in inc/imce.page.inc
Returns the content of the file browser.
imce_fileop_form in inc/imce.page.inc
File operations form.

File

inc/imce.page.inc, line 973
Implements the file browser.

Code

function imce_perm_exists(&$imce, $perm) {
  static $perms = array();
  if (isset($perms[$perm])) {
    return $perms[$perm];
  }
  if (isset($imce['perm'][$perm]) && $imce['perm'][$perm]) {
    return $perms[$perm] = TRUE;
  }
  foreach ($imce['directories'] as $name => $info) {
    if (isset($info[$perm]) && $info[$perm]) {
      return $perms[$perm] = TRUE;
    }
  }
  return $perms[$perm] = FALSE;
}