Code

Updated printer acls
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 12 Jan 2007 04:49:56 +0000 (04:49 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 12 Jan 2007 04:49:56 +0000 (04:49 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@5545 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_printGeneric.inc
plugins/admin/systems/class_termDNS.inc
plugins/admin/systems/printer.tpl

index bef4941b2f083f123d1ecfdc6d6f1d186d32accc..d0f2cebf5aeedac7fa29fd8ae589aaf578b10969 100644 (file)
@@ -338,7 +338,7 @@ class printgeneric extends plugin
     /* Base select dialog */
     $once = true;
     foreach($_POST as $name => $value){
-      if(preg_match("/^chooseBase/",$name) && $once){
+      if(preg_match("/^chooseBase/",$name) && $once && chkacl($this->acl,"base")){
         $once = false;
         $this->dialog = new baseSelectDialog($this->config);
         $this->dialog->setCurrentBase($this->base);
@@ -377,21 +377,21 @@ class printgeneric extends plugin
 
     $smarty->assign("baseACL", chkacl($this->acl,"base"));
 
-    if(isset($_POST['AddUser'])){
+    if(isset($_POST['AddUser']) && chkacl($this->acl,"gotoUserPrinter") == ""){
       $this->dialog = new selectUserToPrinterDialog($this->config, NULL,"AddUser");
     }
-    if(isset($_POST['AddGroup'])){
+    if(isset($_POST['AddGroup']) && chkacl($this->acl,"gotoGroupPrinter") == ""){
       $this->dialog = new selectUserToPrinterDialog($this->config, NULL,"AddGroup");
     }
-    if(isset($_POST['AddAdminUser'])){
+    if(isset($_POST['AddAdminUser']) && chkacl($this->acl,"gotoUserAdminPrinter") == ""){
       $this->dialog = new selectUserToPrinterDialog($this->config, NULL,"AddAdminUser");
     }
-    if(isset($_POST['AddAdminGroup'])){
+    if(isset($_POST['AddAdminGroup']) && chkacl($this->acl,"gotoGroupAdminPrinter") == ""){
       $this->dialog = new selectUserToPrinterDialog($this->config, NULL,"AddAdminGroup");
     }
 
     /* Display ppd configure/select dialog      */
-    if(isset($_POST['EditDriver'])){
+    if(isset($_POST['EditDriver']) && chkacl($this->acl,"gotoPrinterPPD")==""){
       if($this->PPDdialogToSave){
         $this->dialog = $this->PPDdialogToSave;
       }else{
@@ -400,7 +400,7 @@ class printgeneric extends plugin
     }
 
     /* remove ppd */
-    if(isset($_POST['RemoveDriver'])){
+    if(isset($_POST['RemoveDriver']) && chkacl($this->acl,"gotoPrinterPPD")==""){
       $this->gotoPrinterPPD = array();
       $this->PPDdialogToSave = NULL;
     }
@@ -428,25 +428,25 @@ class printgeneric extends plugin
     }
 
     /* Member management, delete user / group / admin ..*/
-    if((isset($_POST['DelUser']))&&(isset($_POST['UserMember']))){
+    if((isset($_POST['DelUser']))&&(isset($_POST['UserMember'])) && chkacl($this->acl,"gotoUserPrinter")==""){
       foreach($_POST['UserMember'] as $mem){
         $this->DelMember('AddUser',$mem);
       }
     }
 
-    if((isset($_POST['DelUser']))&&(isset($_POST['UserMember']))){
+    if((isset($_POST['DelUser']))&&(isset($_POST['UserMember'])) && chkacl($this->acl,"gotoGroupPrinter")==""){
       foreach($_POST['UserMember'] as $mem){
         $this->DelMember('AddGroup',$mem);
       }
     }
 
-    if((isset($_POST['DelAdmin']))&&(isset($_POST['AdminMember']))){
+    if((isset($_POST['DelAdmin']))&&(isset($_POST['AdminMember'])) && chkacl($this->acl,"gotoUserAdminPrinter")==""){
       foreach($_POST['AdminMember'] as $mem){
         $this->DelMember('AddAdminUser',$mem);
       }
     }
 
-    if((isset($_POST['DelAdmin']))&&(isset($_POST['AdminMember']))){
+    if((isset($_POST['DelAdmin']))&&(isset($_POST['AdminMember'])) && chkacl($this->acl,"gotoGroupAdminPrinter")==""){
       foreach($_POST['AdminMember'] as $mem){
         $this->DelMember('AddAdminGroup',$mem);
       }
index 47287a897ed05e0f4e8e51cc009e43208c5fc367..3852df8a33714cc79f555e24b950ae265eb6273d 100644 (file)
@@ -462,14 +462,14 @@ class termDNS extends plugin
 
         $str.=" <tr>".
           "   <td>".$this->generateRecordListBox($entry['type'],"RecordTypeSelectedFor_".$key)."</td>".
-          "   <td><input type='text' value='".$entry['value']."' name='RecordValue_".$key."' id='RecordValue_".$key."'></td>".
-          "   <td><input type='submit' name='RemoveRecord_".$key."' value='"._("Delete")."' id='RemoveRecord_".$key."'></td>".
+          "   <td><input ".chkacl($this->acl,"termDNS")." type='text' value='".$entry['value']."' name='RecordValue_".$key."' id='RecordValue_".$key."'></td>".
+          "   <td><input ".chkacl($this->acl,"termDNS")." type='submit' name='RemoveRecord_".$key."' value='"._("Delete")."' id='RemoveRecord_".$key."'></td>".
           "</tr>";
     }
 
     $str.= "  <tr>".
            "    <td colspan=2 width='50%'></td><td>".
-           "      <input type='submit' value='"._("Add")."' name='AddNewRecord'>".
+           "      <input type='submit' value='"._("Add")."' name='AddNewRecord' ".chkacl($this->acl,"termDNS")." >".
            "    </td>".
            "  </tr>".
            "</table>";
@@ -482,7 +482,7 @@ class termDNS extends plugin
    */
   function generateRecordListBox($selected,$name)
   {
-    $str = "<select name='".$name."' id='".$name."'>";
+    $str = "<select ".chkacl($this->acl,"termDNS")."  name='".$name."' id='".$name."'>";
     foreach($this->RecordTypes as $type => $value){
       $use = "";
       if($type == $selected){
index 49ed25737938119ecad36e3769801ca2e2ace6b6..0578027d156b9a9bd536ff45a059d58667103325 100644 (file)
@@ -11,7 +11,7 @@
                         </tr>
                         <tr>
                          <td><LABEL for="description">{t}Description{/t}</LABEL></td>
-                         <td><input id="description" name="description" size=25 maxlength=80 value="{$description}"></td>
+                         <td><input id="description" name="description" size=25 maxlength=80 value="{$description}" {$descriptionACL}></td>
                         </tr>
                         <tr>
                                  <td colspan=2>&nbsp;</td>
                        <table summary="">
                                <tr>
                                        <td><LABEL for="l">{t}Printer location{/t}</LABEL></td>
-                                       <td><input id="l" name="l" size=25 maxlength=80 value="{$l}"></td>
+                                       <td><input id="l" name="l" size=25 maxlength=80 value="{$l}" {$lACL}></td>
                                </tr>
                                <tr>
                                        <td><LABEL for="labeledURI">{t}Printer URL{/t}</LABEL>{$must}</td>
-                                       <td><input id="labeledURI" name="labeledURI" size=25 maxlength=80 value="{$labeledURI}"></td>
+                                       <td><input id="labeledURI" name="labeledURI" size=25 maxlength=80 value="{$labeledURI}" {$labeledURIACL}></td>
                                </tr>
                        </table>
                        <table summary="">
@@ -49,8 +49,8 @@
                                        <td>
                                                <br>
                                                {t}Driver{/t}: <i>{$driverInfo}</i>&nbsp;
-                                                       <input type="submit" name="EditDriver" value="{t}Edit{/t}">
-                                                       <input type="submit" name="RemoveDriver" value="{t}Remove{/t}">
+                                                       <input type="submit" name="EditDriver" value="{t}Edit{/t}" {$gotoPrinterPPDACL}>
+                                                       <input type="submit" name="RemoveDriver" value="{t}Remove{/t}" {$gotoPrinterPPDACL}>
                                        </td>
                                </tr>
                        </table>
                                <tr>
                                        <td>
                                                {t}Users which are allowed to use this printer{/t}<br>
-                                               <select size="1" name="UserMember[]" title="{t}Users{/t}" style="width:100%;height:120px;"  multiple>
+                                               <select  {if $gotoUserPrinterACL!="" || $gotoGroupPrinterACL!=""} disabled {/if}
+                                                         size="1" name="UserMember[]" title="{t}Users{/t}" style="width:100%;height:120px;"  multiple>
                                                {html_options options=$UserMembers values=$UserMemberKeys}
                                                </select><br>
-                                                       <input type="submit" value="{t}Add user{/t}"  name="AddUser">
-                                                       <input type="submit" value="{t}Add group{/t}" name="AddGroup">
-                                                       <input type="submit" value="{t}Delete{/t}" name="DelUser">
+                                                       <input {$gotoUserPrinterACL} type="submit" value="{t}Add user{/t}"  name="AddUser">
+                                                       <input {$gotoGroupPrinterACL} type="submit" value="{t}Add group{/t}" name="AddGroup">
+                                                       <input {if $gotoUserPrinterACL!="" || $gotoGroupPrinterACL!=""} disabled {/if} 
+                                                               type="submit" value="{t}Delete{/t}" name="DelUser">
                                        </td>
                                </tr>
                        </table>        
                                <tr>
                                        <td>
                                                {t}Users which are allowed to administrate this printer{/t}<br>
-                                               <select size="1" name="AdminMember[]" title="{t}Admins{/t}" style="width:100%;height:120px;"  multiple>
+                                               <select {if $gotoUserAdminPrinterACL!="" || $gotoGroupAdminPrinterACL!=""} disabled {/if}
+                                                        size="1" name="AdminMember[]" title="{t}Admins{/t}" style="width:100%;height:120px;"  multiple>
                                                {html_options options=$AdminMembers values=$AdminMemberKeys}
                                                </select><br>
-                                                       <input type="submit" value="{t}Add user{/t}"  name="AddAdminUser">
-                                                       <input type="submit" value="{t}Add group{/t}" name="AddAdminGroup">
-                                                       <input type="submit" value="{t}Delete{/t}" name="DelAdmin">
+                                                       <input {$gotoUserAdminPrinterACL} type="submit" value="{t}Add user{/t}"  name="AddAdminUser">
+                                                       <input {$gotoGroupAdminPrinterACL} type="submit" value="{t}Add group{/t}" name="AddAdminGroup">
+                                                       <input {if $gotoUserAdminPrinterACL!="" || $gotoGroupAdminPrinterACL!=""} disabled {/if}
+                                                               type="submit" value="{t}Delete{/t}" name="DelAdmin">
                
                                        </td>
                                </tr>