config = &$config; $this->dn = $dn; // Get ACL category for the current object. if(isset($parent->acl_category) && !empty($parent->acl_category)){ $this->acl_category = preg_replace("/\/$/","",$parent->acl_category); } // Build class mapping if(!session::is_set('aclConverter::classMapping')){ $tmp= session::global_get('plist'); $plist= $tmp->info; $map = array(); $map['all']= _("All categories"); foreach($plist as $class => $plInfo){ if(isset($plInfo['plCategory']) && is_array($plInfo['plCategory'])){ foreach($plInfo['plCategory'] as $category => $desc){ if(!is_numeric($category)){ $map[$category] = $desc['description']; } } } } foreach($plist as $class => $plInfo){ if(isset($plInfo['plCategory']) && is_array($plInfo['plCategory'])){ foreach($plInfo['plCategory'] as $category => $desc){ if(!is_numeric($category)){ $map[$category."/".$class] = $map[$category]." - ".$plInfo['plDescription']; }else{ $map[$desc."/".$class] = $map[$desc]." - ".$plInfo['plDescription']; } } } } session::set('aclConverter::classMapping', $map); } $this->classMapping = session::get('aclConverter::classMapping'); // Go through all ACLs and get those matching out DN. $ui = get_userinfo(); foreach($ui->allACLs as $dn => $acls){ if(preg_match("/".preg_quote($dn,'/')."$/i", $this->dn)){ foreach($acls as $prio => $acl){ if($acl['type'] == "reset"){ $this->affectingACLs[$dn][$prio] = $acl; break; }else{ foreach($acl['acl'] as $category => $attributes){ if(preg_match("/^all($|\/)/", $category) || preg_match("/^".$this->acl_category."($|\/)/", $category)){ $this->affectingACLs[$dn][$prio] = $acl; break; } } } } } } // Define ACL type translations $this->aclTypes= array("reset" => _("Reset ACLs"), "one" => _("One level"), "base" => _("Current object"), "sub" => _("Complete subtree"), "psub" => _("Complete subtree (permanent)"), "role" => _("Use ACL defined in role")); } /*! \brief Create a human readable HTML result */ function getReadableACL() { $str = "
".$image." | "; $str.="".$dn." | "; $str.="".$this->aclTypes[$acl['type']]." | "; $str.="
"._("Group members")."
| ";
$str .= "||
"._("Members")."
| ";
$str .= "||
"; if($acl['type']!='reset'){ $str.=" | "._("Acls")."
| ";
$str .= ""; } $str .= " |