Code

Updated english strings
[gosa.git] / gosa-core / include / class_acl.inc
index 0658fea10ed4dcabfc87129d7b8f852ab46eaa24..853893edcd486e35178ebc96cee973e92e7d3f23 100644 (file)
@@ -57,6 +57,7 @@ class acl extends plugin
   var $list =NULL;
 
   var $sectionList = NULL;
+  var $roleList = NULL;
 
   function acl (&$config, $parent, $dn= NULL)
   {
@@ -291,8 +292,11 @@ class acl extends plugin
   function convertForListing($entry)
   {
     $member = implode($entry['members'],", ");
-    $acl = implode(array_keys($entry['acl']),", ");
-    $type = implode(array_keys($entry['acl']),", ");
+    if(isset($entry['acl']) && is_array($entry['acl'])){
+        $acl = implode(array_keys($entry['acl']),", ");
+    }else{
+        $acl="";
+    }
     return(array('data' => array($member, $acl, $this->aclTypes[$entry['type']])));
   }
 
@@ -321,7 +325,7 @@ class acl extends plugin
     // Get listing actions. Delete or Edit.
     $this->list->save_object();
     $lAction = $this->list->getAction();
-    $this->gosaAclEntry = $this->list->getMaintainedData();
+    $this->gosaAclEntry = array_values($this->list->getMaintainedData());
 
     /* Act on HTML post and gets here.
      */
@@ -567,7 +571,7 @@ class acl extends plugin
                     $summary= '<i>'._("No ACL settings for this category!").'</i>';
                 } else {
                     $summary= trim($summary,", ");
-                    $summary= " ".sprintf(_("Contains ACLs for these objects: %s"), $summary);
+                    $summary= " ".sprintf(_("ACLs for: %s"), $summary);
                 }
 
                 $actions ="";
@@ -624,13 +628,12 @@ class acl extends plugin
 
       /* Role selector if scope is base */
       if ($this->aclType == 'role'){
-        $smarty->assign('roleSelector', "Role selector");#, $this->buildRoleSelector($this->myAclObjects));
         $smarty->assign('roleSelector', $this->buildRoleSelector($this->roles));
       }
     }
 
     if ($this->dialogState == 'edit'){
-      $smarty->assign('headline', sprintf(_("Edit ACL for '%s' - scope is '%s'"), $this->aclObjects[$this->aclObject], $this->aclTypes[$this->aclType]));
+      $smarty->assign('headline', sprintf(_("Edit ACL for '%s' with scope '%s'"), $this->aclObjects[$this->aclObject], $this->aclTypes[$this->aclType]));
 
       /* Collect objects for selected category */
       foreach ($this->ocMapping[$this->aclObject] as $idx => $class){
@@ -943,9 +946,13 @@ class acl extends plugin
     if(count($list) == 5){
       list($index, $type,$member,$permission,$filter)= $list;
       $filter = base64_decode($filter);
-    }else{
+    }elseif(count($list) == 4){
       $filter = "";
       list($index, $type,$member,$permission)= $list;
+    }else{
+      $permission = "";
+      $filter = "";
+      list($index, $type,$member)= $list;
     }
 
     $a= array( $index => array("type" => $type,
@@ -1079,9 +1086,9 @@ class acl extends plugin
       if($entry['type'] == "role"){
 
         if(isset($this->roles[$entry['acl']])){  
-          $summary.= sprintf(_("Role: %s"), $this->roles[$entry['acl']]['cn']);
+          $summary.= sprintf(_("ACL role: %s"), $this->roles[$entry['acl']]['cn']);
         }else{
-          $summary.= sprintf(_("Role: %s"), "<i>"._("unknown role")."</i>");
+          $summary.= sprintf(_("ACL role: %s"), "<i>"._("unknown ACL role")."</i>");
         }
       }else{
         foreach ($entry['acl'] as $name => $object){
@@ -1125,7 +1132,7 @@ class acl extends plugin
       $acl= $this->gosaAclEntry[$this->currentIndex];
       $this->aclType= $acl['type'];
       $this->recipients= $acl['members'];
-      $this->aclContents= $acl['acl'];
+      $this->aclContents= (isset($acl['acl'])) ? $acl['acl'] :"";
       $this->aclFilter= $acl['filter'];
     }
 
@@ -1175,8 +1182,9 @@ class acl extends plugin
       }
 
       /* ACL's if needed */
+      $final.= ":";
       if ($entry['type'] != "reset" && $entry['type'] != "role"){
-        $acl= ":";
+        $acl = "";
         if (isset($entry['acl'])){
           foreach ($entry['acl'] as $object => $contents){
 
@@ -1209,7 +1217,7 @@ class acl extends plugin
       }
 
       $tmp_acl[]= $final;
-    } 
+    }
 
     /* Call main method */
     plugin::save();
@@ -1284,8 +1292,7 @@ class acl extends plugin
           "plCategory"    => array("acl" => array("description"  => _("ACL")."&nbsp;&amp;&nbsp;"._("ACL roles"),
                                                           "objectClass"  => array("gosaAcl","gosaRole"))),
           "plProvidedAcls"=> array(
-            "gosaAclEntry"          => _("Acl entries")
-//            "description" => _("Role description")
+           "gosaAclEntry"          => _("ACL Entries")
             )
 
           ));