Code

Updated ACLroles
[gosa.git] / gosa-core / plugins / admin / acl / class_aclRole.inc
index 9deb2a94c3423c992185ddc28b6ba18477e01ce7..e78f0dfa1d604105fee21bfada69b3d9d6bd0c11 100644 (file)
@@ -191,6 +191,18 @@ class aclrole extends acl
     $new_acl= array();
     $aclDialog= FALSE;
     $firstedit= FALSE;
+
+    /* Act on HTML post and gets here.
+     */
+    if(isset($_GET['id']) && isset($_GET['act']) && $_GET['act'] == "edit"){
+      $id = trim($_GET['id']);
+      $this->dialogState= 'create';
+      $firstedit= TRUE;
+      $this->dialog= TRUE;
+      $this->currentIndex= $id;
+      $this->loadAclEntry();
+    }
+
     foreach($_POST as $name => $post){
 
       /* Actions... */
@@ -252,7 +264,6 @@ class aclrole extends acl
 
       /* ACL saving... */
       if (preg_match('/^acl_.*_[^xy]$/', $name) && $this->acl_is_writeable("gosaAclEntry")){
-        $aclDialog= TRUE;
         list($dummy, $object, $attribute, $value)= split('_', $name);
 
         /* Skip for detection entry */
@@ -271,7 +282,11 @@ class aclrole extends acl
         }
       }
     }
-    
+   
+    if(isset($_POST['acl_dummy_0_0_0'])){
+      $aclDialog= TRUE;
+    }
     /* Only be interested in new acl's, if we're in the right _POST place */
     if ($aclDialog && $this->aclObject != "" && is_array($this->ocMapping[$this->aclObject])){
 
@@ -361,8 +376,15 @@ class aclrole extends acl
 
       /* Fill in entries */
       foreach ($this->gosaAclTemplate as $key => $entry){
-        $field1= array("string" => $this->aclTypes[$entry['type']], "attach" => "style='width:100px'");
-        $field2= array("string" => $this->assembleAclSummary($entry));
+
+        if($this->acl_is_readable("")){
+          $link = "<a href=?plug=".$_GET['plug']."&amp;id=".$key."&amp;act=edit>".$this->assembleAclSummary($entry)."</a>";
+        }else{
+          $link = $this->assembleAclSummary($entry);
+        }
+
+        $field1= array("string" => $this->aclTypes[$entry['type']], "attach" => "style='width:150px'");
+        $field2= array("string" => $link);
 
         $action ="";
         if($this->acl_is_writeable("gosaAclEntry")){
@@ -402,9 +424,7 @@ class aclrole extends acl
             $summary.= "$oc, ";
             continue;
           }
-          if (isset($this->aclContents["$section/$oc"]) && count($this->aclContents["$section/$oc"]) && isset($this->aclContents["$section/$oc"][0]) &&
-              $this->aclContents["$section/$oc"][0] != ""){
-
+          if (isset($this->aclContents["$section/$oc"]) && count($this->aclContents["$section/$oc"])){
             $summary.= "$oc, ";
             continue;
           }
@@ -724,7 +744,7 @@ class aclrole extends acl
           "plSelfModify"  => FALSE,
           "plDepends"     => array(),
           "plPriority"    => 0,
-          "plSection"     => array("admin"),
+          "plSection"     => array("administration"),
           "plCategory"    => array("acl"),
           "plProvidedAcls"    => array(
             "cn"                => _("Name"),