summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9475588)
raw | patch | inline | side by side (parent: 9475588)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 29 Oct 2008 15:21:31 +0000 (15:21 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 29 Oct 2008 15:21:31 +0000 (15:21 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12807 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/include/class_pluglist.inc | patch | blob | history | |
gosa-core/include/class_userinfo.inc | patch | blob | history |
index 81f4a3102bd32d0b87dfcb5eb4d47630a551d002..48233fbc07c643c3504cf08d96b2219f4bff12f1 100644 (file)
var $info= array();
var $headlines = array();
var $allowed_plugins = array();
+ var $silly_cache= array();
function pluglist(&$config, &$ui)
{
}
- /*! \brief Check whether we are allowed to modify the given acl or nit..
+ /*! \brief Check whether we are allowed to modify the given acl or not..
This function is used to check which plugins are visible.
@param The acl tag to test, eg. "users/user:self", "systems", ...
*/
function check_access($aclname)
{
+ if (isset($this->silly_cache[$aclname])) {
+ return $this->silly_cache[$aclname];
+ }
+
/* Split given acl string into an array.
e.g. "user,systems" => array("users","systems");
*/
if(preg_match("/:self$/",$acl_to_check)){
$acl_to_check = preg_replace("/:self$/","",$acl_to_check);
if($this->ui->get_permissions($this->ui->dn,$acl_to_check,"") != ""){
+ $this->silly_cache[$aclname]= TRUE;
return(TRUE);
}
+ $this->silly_cache[$aclname]= FALSE;
return(FALSE);
}else{
/* No self acls. Check if we have any acls for the given ACL type
*/
$deps = $this->ui->get_module_departments($acl_to_check,TRUE);
- if(count($deps)) return TRUE;
+ if(count($deps)){
+ $this->silly_cache[$aclname]= TRUE;
+ return TRUE;
+ }
}
}
+
+ $this->silly_cache[$aclname]= FALSE;
return (FALSE);
}
index d5bc7419dad377772bd2fd4794a0bfb5420f47a0..b2e27116169ef3bcbf36034ef31d6bfb880f37c6 100644 (file)
accessible department) */
function get_module_departments($module, $skip_self_acls = FALSE )
{
-
+
/* If we are forced to skip ACLs checks for the current user
then return all departments as valid.
*/
foreach($info['acl'] as $cat => $data){
/* Skip self acls? */
- if($skip_self_acls && isset($data['0']) && preg_match("//s",$data['0'])) continue;
+ if($skip_self_acls && isset($data['0']) && strpos($data['0'], "s")) continue;
if(is_array($module)){
foreach($module as $mod){
}
if($found && !isset($this->config->idepartments[$dn])){
- while(!isset($this->config->idepartments[$dn]) && preg_match("/,/",$dn)){
+ while(!isset($this->config->idepartments[$dn]) && strpos($dn, ",")){
$dn = preg_replace("/^[^,]+,/","",$dn);
}
if(isset($this->config->idepartments[$dn])){
}
$acl = "";
foreach($module as $mod){
- if(preg_match("/\//",$mod)){
+ if(strpos($mod, '/')){
$acl.= $this->get_permissions($dn,$mod);
}else{
$acl.= $this->get_category_permissions($dn,$mod);