Code

Updated post handling
[gosa.git] / gosa-core / plugins / generic / references / class_aclResolver.inc
index f87c5e10b3483d098752319d09aadb23f9cf951f..51d05a510ddd1482c628245949a72e090263725d 100644 (file)
@@ -33,7 +33,6 @@ class aclResolver
             $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){
@@ -129,7 +128,7 @@ class aclResolver
 
             // Autocompleter template 
             $autocompleter ="
-                <input class='filter_textfield' placeholder='"._("Search")."...' 
+                <input class='filter_textfield' placeholder='"._("Enter another user name")."...' 
                 id='aclTarget' name='aclTarget' type='text' value='' 
                 onChange=\"\$('aclTargetSubmit').focus();\">
 
@@ -140,13 +139,13 @@ class aclResolver
                         'autocomplete', 
                         'autocomplete.php', 
                         { minChars: 3, frequency: 0.5 });
-                </script>
+            </script>
             ".image("images/lists/submit.png","aclTargetSubmit");
 
             // Base template - each entry start with this 
             $tpl = 
                 "\n <tr class='acl-viewer-head %s'>".
-                "\n  <td>%s</td>".
+                "\n  <td style='width:20px'>%s</td>".
                 "\n  <td colspan=2><b>%s</b><div class='right'>%s</div></td>".
                 "\n </tr>".
                 "\n %s";
@@ -184,7 +183,7 @@ class aclResolver
                 "\n </tr>";
 
 
-            $user = "<h3>".sprintf(_("List of effective ACL for '%s'"), $this->validateUid)."</h3>";
+            $user = "<h3>".sprintf(_("List of effective ACLs for '%s'"), $this->validateUid)."</h3>";
             $str  = "<table summary='"._("Object permissions")."'>";
             $str .= " <tr><td>".$user."</td><td>".$autocompleter."</td></tr>";
             $str .= "</table>";
@@ -216,14 +215,14 @@ class aclResolver
                     // Check membership 
                     $gmem = $umem = "";
                     $users = $groups = array();
-                    $gfound = $ufound = FALSE;
+                    $found = FALSE;
                     foreach($acl['members'] as $type => $name){
 
                         // Check if we're part of the members 
                         if(preg_match("/^U:/", $type)){
                             if(preg_match("/^U:".preg_quote($this->validateDn,'/')."/", $type)){
                                 $users[] = $name;
-                                $ufound = TRUE;
+                                $found = TRUE;
                                 continue;
                             }
                             $users[] = "<span>".$name."</span>";
@@ -232,7 +231,7 @@ class aclResolver
                         // Check if we're part of the group members 
                         if(preg_match("/^G/", $type)){
                             if($type == "G:*"){
-                                $gfound = TRUE;
+                                $found = TRUE;
                                 $groups[] = $name;
                                 continue;
                             }
@@ -242,19 +241,17 @@ class aclResolver
                                 if($ldap->count()){
                                     $attrs = $ldap->fetch();
                                     if(isset($attrs['memberUid']) && in_array($this->validateUid, $attrs['memberUid'])){
-                                        $gfound = TRUE;
+                                        $found = TRUE;
                                         $groups[] = $name;
+                                        continue;
                                     }
                                 }
-                                continue;
                             }
 
-                            // Group member doesn't mactch
+                            // Mark groups that doesn't match 
                             $groups[] = "<span>".$name."</span>";
                         }
                     }
-                    if(!count($groups)) $gfound = TRUE;
-                    if(!count($users)) $ufound = TRUE;
 
                     // Build up ACL definition list 
                     $defs ="";
@@ -270,10 +267,9 @@ class aclResolver
                    
                     // Display the acl block in a special color if its not matching 
                     $class="";
-                    if(!($gfound || $ufound) || !$match){
+                    if(!$found || !$match){
                         $class = "acl-viewer-blocked";
                     }                    
-
                     if(!empty($filter)) $filter =sprintf($filter_tpl,$class,$filter);
                     if(!empty($defs)) $defs = sprintf($acl_tpl,$class,$defs);
                     if(count($users))  $umem = sprintf($umem_tpl,$class,"<li>".implode($users,'</li><li>')."</li>");
@@ -290,19 +286,19 @@ class aclResolver
 
     function aclToString($acls)
     {
-        $str ="<ul>";
+        $str ="<ul class='acl-category-list'>";
         foreach($acls as $name => $acl){
             if($name == "0") $name = _("All");
-            $str .= "<li>".$name;
-            $str .= "<ul>";
+            $str .= "<li><i>".$name.":</i> ";
+            $str .= "<ul class='acl-list'>";
             if(preg_match("/s/", $acl)){
-                $str.="<li><u>"._("Grant permission to owner").'</u></li>'; 
+                $str.="<li><u>"._("Restrict changes to user's own object").'</u></li>'; 
             }
             if(preg_match("/r/", $acl)) $str.="<li>"._("read").'</li>'; 
             if(preg_match("/w/", $acl)) $str.="<li>"._("write").'</li>'; 
-            if(preg_match("/c/", $acl)) $str.="<li>"._("Create").'</li>'; 
-            if(preg_match("/d/", $acl)) $str.="<li>"._("Remove").'</li>'; 
-            if(preg_match("/m/", $acl)) $str.="<li>"._("Move").'</li>'; 
+            if(preg_match("/c/", $acl)) $str.="<li>"._("create").'</li>'; 
+            if(preg_match("/d/", $acl)) $str.="<li>"._("remove").'</li>'; 
+            if(preg_match("/m/", $acl)) $str.="<li>"._("move").'</li>'; 
             $str.= "</ul>";
         }
         return($str."</ul>");