Code

Added some acl debugging utils
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 4 Dec 2006 12:22:21 +0000 (12:22 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 4 Dec 2006 12:22:21 +0000 (12:22 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5300 594d385d-05f5-0310-b6e9-bd551577e9d8

html/include/focus.js
include/class_acl.inc

index f5a61911111499e1261cd8cf4585364636986afe..cb9f8c1950a304e9eb6952dae699ea10b2588196 100644 (file)
@@ -15,19 +15,30 @@ for (iln = 0; iln < len; iln++){
 netscape= (ver.charAt(iln+1).toUpperCase() != "C");
 
 
+/* Toggle checkbox that matches regex */
+function acl_set_all(regex,value)
+{
+                               for (var i = 0; i < document.mainform.elements.length; i++) {
+                                                               var _id=document.mainform.elements[i].id;
+                                                               if(_id.match(regex)) {
+                                                                                               document.getElementById(_id).checked= value;
+                                                               }
+                               }
+}
+
 /* Toggle checkbox that matches regex */
 function acl_toggle_all(regex)
 {
-       for (var i = 0; i < document.mainform.elements.length; i++) {
-                                       var _id=document.mainform.elements[i].id;
-                                       if(_id.match(regex)) {
-                                                                       if (document.getElementById(_id).checked == true){
-                                                                                                       document.getElementById(_id).checked= false;
-                                                                       } else {
-                                                                                                       document.getElementById(_id).checked= true;
-                                                                       }
-                                       }
-       }
+                               for (var i = 0; i < document.mainform.elements.length; i++) {
+                                                               var _id=document.mainform.elements[i].id;
+                                                               if(_id.match(regex)) {
+                                                                                               if (document.getElementById(_id).checked == true){
+                                                                                                                               document.getElementById(_id).checked= false;
+                                                                                               } else {
+                                                                                                                               document.getElementById(_id).checked= true;
+                                                                                               }
+                                                               }
+                               }
 }
 
 function keyPress(DnEvents) {
index 9024689fe136c322635f57f15903cc15f31a7f51..a9b7389ad47c798104ea73be48fe39616bd7462a 100644 (file)
@@ -504,14 +504,27 @@ class acl extends plugin
     asort($plist);
 
     /* Add select all/none buttons */
-    $display .= "<input type='button' name='all_create' onClick=\"acl_toggle_all('_0_c$');\" value='C'>&nbsp;";
-    $display .= "<input type='button' name='all_move'   onClick=\"acl_toggle_all('_0_m$');\" value='M'>&nbsp;";
-    $display .= "<input type='button' name='all_remove' onClick=\"acl_toggle_all('_0_d$');\" value='D'>&nbsp;";
-    $display .= "<input type='button' name='all_read'   onClick=\"acl_toggle_all('_0_r$');\" value='R'>&nbsp;";
-    $display .= "<input type='button' name='all_write'  onClick=\"acl_toggle_all('_0_w$');\" value='W'>&nbsp;";
-
-    $display .= "<input type='button' name='all_write'  onClick=\"acl_toggle_all('[^0]_r$');\" value='R+'>&nbsp;";
-    $display .= "<input type='button' name='all_write'  onClick=\"acl_toggle_all('[^0]_w$');\" value='W+'>&nbsp;";
+    $style = "style='width:100px;'";
+
+    $display .= "<input ".$style." type='button' name='toggle_all_create' onClick=\"acl_toggle_all('_0_c$');\" value='Toggle C'>";
+    $display .= "<input ".$style." type='button' name='toggle_all_move'   onClick=\"acl_toggle_all('_0_m$');\" value='Toggle M'>";
+    $display .= "<input ".$style." type='button' name='toggle_all_remove' onClick=\"acl_toggle_all('_0_d$');\" value='Toggle D'>";
+    $display .= "<input ".$style." type='button' name='toggle_all_read'   onClick=\"acl_toggle_all('_0_r$');\" value='Toggle R'>";
+    $display .= "<input ".$style." type='button' name='toggle_all_write'  onClick=\"acl_toggle_all('_0_w$');\" value='Toggle W'>";
+
+    $display .= "<input ".$style." type='button' name='toggle_all_sub_read'  onClick=\"acl_toggle_all('[^0]_r$');\" value='R+'>";
+    $display .= "<input ".$style." type='button' name='toggle_all_sub_write'  onClick=\"acl_toggle_all('[^0]_w$');\" value='W+'>";
+  
+    $display .= "<br>";
+  
+    $style = "style='width:50px;'";
+    $display .= "<input ".$style." type='button' name='set_true_all_create' onClick=\"acl_set_all('_0_c$',true);\" value='C+'>";
+    $display .= "<input ".$style." type='button' name='set_false_all_create' onClick=\"acl_set_all('_0_c$',false);\" value='C-'>";
+    $display .= "<input ".$style." type='button' name='set_true_all_move' onClick=\"acl_set_all('_0_m$',true);\" value='M+'>";
+    $display .= "<input ".$style." type='button' name='set_false_all_move' onClick=\"acl_set_all('_0_m$',false);\" value='M-'>";
+    $display .= "<input ".$style." type='button' name='set_true_all_remove' onClick=\"acl_set_all('_0_d$',true);\" value='D+'>";
+    $display .= "<input ".$style." type='button' name='set_false_all_remove' onClick=\"acl_set_all('_0_d$',false);\" value='D-'>";
+
     /* Build general objects */
 
     $list =$this->sort_by_priority($list);