Code

Fixed problem with samba ctx attributes when acl's are disabled
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 10 Apr 2007 13:55:56 +0000 (13:55 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 10 Apr 2007 13:55:56 +0000 (13:55 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@5998 594d385d-05f5-0310-b6e9-bd551577e9d8

Changelog
plugins/personal/samba/class_sambaAccount.inc
plugins/personal/samba/samba3.tpl

index 75f8281acdf024f9bed428bdd0e771e29f864753..f76fd4bc694f238ead4cf6b6133dc9d99d5bc172 100644 (file)
--- a/Changelog
+++ b/Changelog
@@ -11,6 +11,7 @@ GOsa2 changelog
   - Fixed month listing in fax reports - february was march
   - Enabled 9 digits for gid-/uidNumbers
   - Fixed acl's for saving printers
+  - Fixed saving of disabled samba acl's
 
 * gosa 2.5.9
   - Fixed ldap tls connections when schema check was being used
index 7bfcaf75a25ac0e83d5e52fc50afccc417d5e0d5..3adfb1d7ad14cde697f9281345e7830eddbff7ee 100644 (file)
@@ -845,32 +845,42 @@ class sambaAccount extends plugin
         }
 
         /* Save checkbox states. */
-        $this->mungedObject->setTsLogin(!isset($_POST['tslogin'])
-                        && chkacl($this->acl, "tslogin") == "");
+        if (chkacl($this->acl, "tslogin") == ""){
+          $this->mungedObject->setTsLogin(!isset($_POST['tslogin']));
+        }
         // Need to do some index checking to avoid messages like "index ... not found"
         if(isset($_POST['brokenconn'])) {
-          $this->mungedObject->setBrokenConn($_POST['brokenconn'] == '1'
-                          && chkacl($this->acl, "brokenconn") == "");
+          if (chkacl($this->acl, "brokenconn") == ""){
+            $this->mungedObject->setBrokenConn($_POST['brokenconn'] == '1');
+          }
         }
         if(isset($_POST['reconn'])) {
-          $this->mungedObject->setReConn($_POST['reconn'] == '1'
-                          && chkacl($this->acl, "reconn") == "");
+          if (chkacl($this->acl, "reconn") == ""){
+            $this->mungedObject->setReConn($_POST['reconn'] == '1');
+          }
+        }
+        if (chkacl($this->acl, "inherit") == "") {
+          $this->mungedObject->setInheritMode(isset($_POST['inherit']));
+        }
+        if (chkacl($this->acl, "CtxMaxConnectionTime") == "") {
+          $this->mungedObject->setCtxMaxConnectionTimeF(!isset($_POST['CtxMaxConnectionTimeF']));
+        }
+        if (chkacl($this->acl, "CtxMaxDisconnectionTime") == ""){
+          $this->mungedObject->setCtxMaxDisconnectionTimeF(
+                        !isset($_POST['CtxMaxDisconnectionTimeF']));
+        }
+        if (chkacl($this->acl, "CtxMaxIdleTime") == ""){
+          $this->mungedObject->setCtxMaxIdleTimeF(!isset($_POST['CtxMaxIdleTimeF']));
+        }
+        if (chkacl($this->acl, "connectclientdrives") == ""){
+          $this->mungedObject->setConnectClientDrives(isset($_POST['connectclientdrives']));
+        }
+        if (chkacl($this->acl, "connectclientprinters") == ""){
+          $this->mungedObject->setConnectClientPrinters(isset($_POST['connectclientprinters']));
+        }
+        if (chkacl($this->acl, "defaultprinter") == ""){
+          $this->mungedObject->setDefaultPrinter(isset($_POST['defaultprinter']));
         }
-        $this->mungedObject->setInheritMode(isset($_POST['inherit'])
-                        && chkacl($this->acl, "inherit") == "");
-        $this->mungedObject->setCtxMaxConnectionTimeF(!isset($_POST['CtxMaxConnectionTimeF'])
-                        && chkacl($this->acl, "CtxMaxConnectionTime") == "");
-        $this->mungedObject->setCtxMaxDisconnectionTimeF(
-                        !isset($_POST['CtxMaxDisconnectionTimeF']) 
-                        && chkacl($this->acl, "CtxMaxDisconnectionTime") == "");
-        $this->mungedObject->setCtxMaxIdleTimeF(!isset($_POST['CtxMaxIdleTimeF'])
-                        && chkacl($this->acl, "CtxMaxIdleTime") == "");
-        $this->mungedObject->setConnectClientDrives(isset($_POST['connectclientdrives'])
-                        && chkacl($this->acl, "connectclientdrives") == "");
-        $this->mungedObject->setConnectClientPrinters(isset($_POST['connectclientprinters'])  
-                        && chkacl($this->acl, "connectclientprinters") == "");
-        $this->mungedObject->setDefaultPrinter(isset($_POST['defaultprinter'])
-                        && chkacl($this->acl, "defaultprinter") == "");
 
         /* Save combo boxes. Takes two values */
         if(isset($_POST['reconn'])) {
index 30d0a1a33080a9491497da448f812ef08d0fdb86..a7ae390e311ab500f5c188d70389509755b573b2 100644 (file)
       <input id="CtxWorkDirectory" name="CtxWorkDirectory" size=35 maxlength=60 
                {if $CtxWorkDirectoryACL==""}
                        {$CtxInitialProgramMode}
+               {else}
+                       disabled
                {/if} value="{$CtxWorkDirectory}" 
                {if ($CtxInitialProgramACL=="disabled" || $tsloginstate=="disabled" || $inheritstate=="disabled") && $CtxWorkDirectoryACL!=""}
                        disabled