Code

Added Dummy ACLs.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 13 Dec 2006 08:36:25 +0000 (08:36 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 13 Dec 2006 08:36:25 +0000 (08:36 +0000)
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

plugins/admin/acl/class_aclManagement.inc
plugins/admin/acl/class_divListACL.inc

index 4bbab22ea4d0043283bce4eed47e03e6a3606948..0fd131321f821bd4ca3c9963ecfbb1150e15dfbf 100644 (file)
@@ -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")."&nbsp;-&nbsp;("._("Access control list").")",
+          "plSelfModify"  => FALSE,
+          "plDepends"     => array(),
+          "plPriority"    => 0,
+          "plSection"     => array("administration"),
+          "plCategory"    => array("acl" => array("description"  => _("ACL")."&nbsp;"._("Access control list"),
+                                                          "objectClass"  => "gosaACL")),
+          "plProvidedAcls"=> array(
+            "Dummy" => _("I don't know Jack"))
+
+          ));
+  }
+
 } 
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
 ?>
index 6e839bcc4ce0476cc10546863d9d06170200f22a..bf2d2ef94a48dfe2001da362be18c59f0876d051 100644 (file)
@@ -107,29 +107,20 @@ class divListACL extends MultiSelectWindow
   function setEntries($list)
   {
     $list_left_icon = "<img src='images/select_acl.png' alt='"._("Acl")."'>";
-    $editlink = "<a href='?plug=".$_GET['plug']."&amp;id=%s&amp;act=edit_entry'>%s</a>";
+    $editlink       = "<a href='?plug=".$_GET['plug']."&amp;id=%s&amp;act=edit_entry'>%s</a>";
 
     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 = "<input class='center' type='image' src='images/edit.png' alt='"._("edit")."'     
-                    name='acl_edit_%KEY%' title='"._("Edit system")."'>";
-        $action.= $this->GetSnapShotActions($acl_entry['dn']);
-        $action.= "<input class='center' type='image' src='images/edittrash.png' alt='"._("delete")."' 
-                    name='acl_del_%KEY%' title='"._("Delete system")."'>";
-
-        $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'])))."&nbsp;","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 = "<input class='center' type='image' src='images/edit.png' alt='"._("edit")."'     
+        name='acl_edit_%KEY%' title='"._("Edit system")."'>";
+      $action.= $this->GetSnapShotActions($acl_entry['dn']);
+      $action.= "<input class='center' type='image' src='images/edittrash.png' alt='"._("delete")."' 
+        name='acl_del_%KEY%' title='"._("Delete system")."'>";
+
+      $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'])))."&nbsp;","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));
     }
   }