From: hickert Date: Wed, 13 Dec 2006 08:36:25 +0000 (+0000) Subject: Added Dummy ACLs. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=5c920bfc5f48bc2f39b2282b6f3adae8677a43fa;p=gosa.git Added Dummy ACLs. Added a more specific and possibly faster reload function git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5373 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/acl/class_aclManagement.inc b/plugins/admin/acl/class_aclManagement.inc index 4bbab22ea..0fd131321 100644 --- a/plugins/admin/acl/class_aclManagement.inc +++ b/plugins/admin/acl/class_aclManagement.inc @@ -314,23 +314,44 @@ class aclManagement extends plugin $SubSearch = $this->DivListACL -> SubSearch; $base = $_SESSION['CurrentMainBase']; $Attrs = array("ou","gosaAclEntry","objectClass"); - - /* Get ldap connection */ - $ldap = $this->config->get_ldap_link(); - $ldap->cd($base); - - /* Create filter */ - $Filter = "objectClass=gosaACL"; - $Flags = GL_SIZELIMIT; - - /* Subserach ? */ + $res = $tmp = array(); // Will contain temporary results + $ldap = $this->config->get_ldap_link(); + $Filter = "(&(objectClass=gosaACL)(gosaAclEntry=*))"; + + /* Fetch following structures, this will be used if !$SubSearch */ + $fetch_this = array( + "ME" => array("TYPE" => "cat" , "FLAGS" => GL_SIZELIMIT ,"BASE"=>""), + "SYSTEMS" => array("TYPE" => "search" , "FLAGS" => GL_SIZELIMIT | GL_SUBSEARCH ,"BASE"=>"ou=systems,"), + "APPS" => array("TYPE" => "search" , "FLAGS" => GL_SIZELIMIT | GL_SUBSEARCH ,"BASE"=>"ou=apps,"), + "PEOPLE" => array("TYPE" => "search" , "FLAGS" => GL_SIZELIMIT | GL_SUBSEARCH ,"BASE"=>get_people_ou()), + "GROUPS" => array("TYPE" => "search" , "FLAGS" => GL_SIZELIMIT | GL_SUBSEARCH ,"BASE"=>get_groups_ou())); + + /* Subsearch ? */ if($SubSearch){ - $Flags |= GL_SUBSEARCH; - } - /* Get objects */ - $res= get_list($Filter, "acl", $base, $Attrs, $Flags); + /* Get all object in this base */ + $Flags = GL_SIZELIMIT | GL_SUBSEARCH; + $fetch_base = $base; + $res = get_list($Filter, "acl", $fetch_base, $Attrs, $Flags); + }else{ + foreach($fetch_this as $type => $data){ + + /* Get requried attributes */ + $Flags = $data['FLAGS']; + $fetch_base = $data['BASE'].$base; + $Type = $data['TYPE']; + + /* Check if method is cat or search */ + if($Type == "search"){ + $tmp = get_list($Filter, "acl", $fetch_base, $Attrs, $Flags); + }else{ + $ldap->cat($fetch_base,$Attrs); + $tmp = array($ldap->fetch()); + } + $res = array_merge($res,$tmp); + } + } $this->list = $res; } @@ -364,6 +385,25 @@ class aclManagement extends plugin function adapt_from_template($dn) { } function password_change_needed() { } + + /* Return plugin informations for acl handling */ + function plInfo() + { + return (array( + "plShortName" => _("ACL"), + "plDescription" => _("ACL")." - ("._("Access control list").")", + "plSelfModify" => FALSE, + "plDepends" => array(), + "plPriority" => 0, + "plSection" => array("administration"), + "plCategory" => array("acl" => array("description" => _("ACL")." "._("Access control list"), + "objectClass" => "gosaACL")), + "plProvidedAcls"=> array( + "Dummy" => _("I don't know Jack")) + + )); + } + } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: ?> diff --git a/plugins/admin/acl/class_divListACL.inc b/plugins/admin/acl/class_divListACL.inc index 6e839bcc4..bf2d2ef94 100644 --- a/plugins/admin/acl/class_divListACL.inc +++ b/plugins/admin/acl/class_divListACL.inc @@ -107,29 +107,20 @@ class divListACL extends MultiSelectWindow function setEntries($list) { $list_left_icon = ""._("Acl").""; - $editlink = "%s"; + $editlink = "%s"; foreach($list as $key => $acl_entry){ - $skip = true; - foreach($this->get_filter_objectclasses() as $oc){ - if(in_array($oc,$acl_entry['objectClass']) && $this->$oc){ - $skip = false; - } - } - - if(!$skip){ - $action = ""; - $action.= $this->GetSnapShotActions($acl_entry['dn']); - $action.= ""; - - $field1 = array("string" => $list_left_icon, "attach"=> "style='text-align:center;width:20px;'"); - $field2 = array("string" => sprintf($editlink,$key,htmlentities(utf8_decode($acl_entry['dn'])))." ","attach" => ""); - $field3 = array("string" => preg_replace("/%KEY%/",$key,$action), "attach"=> "style='text-align:center;width:80px;border-right:0px;'"); - $this->AddElement(array($field1,$field2,$field3)); - } + $action = ""; + $action.= $this->GetSnapShotActions($acl_entry['dn']); + $action.= ""; + + $field1 = array("string" => $list_left_icon, "attach"=> "style='text-align:center;width:20px;'"); + $field2 = array("string" => sprintf($editlink,$key,htmlentities(utf8_decode($acl_entry['dn'])))." ","attach" => ""); + $field3 = array("string" => preg_replace("/%KEY%/",$key,$action), "attach"=> "style='text-align:center;width:80px;border-right:0px;'"); + $this->AddElement(array($field1,$field2,$field3)); } }