From 1d0b7a8f8d8f9a29c21a747781f09992b6a3942d Mon Sep 17 00:00:00 2001 From: janw Date: Fri, 2 Sep 2005 10:39:42 +0000 Subject: [PATCH] Added another changestate-method... TS-Fields are now disabled on-the-fly if TS-Login is disabled. Added two state variables. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1301 594d385d-05f5-0310-b6e9-bd551577e9d8 --- html/include/focus.js | 11 ++++ plugins/personal/samba/class_sambaAccount.inc | 23 ++++++-- plugins/personal/samba/samba3.tpl | 58 +++++++++++++------ 3 files changed, 67 insertions(+), 25 deletions(-) diff --git a/html/include/focus.js b/html/include/focus.js index 74ac8ceac..9eac9f83a 100644 --- a/html/include/focus.js +++ b/html/include/focus.js @@ -57,6 +57,17 @@ function changeTripleSelectState(firstTriggerField, secondTriggerField, myField) } } + +function changeTripleSelectState_2nd_neg(firstTriggerField, secondTriggerField, myField) { + if ( + document.getElementById(firstTriggerField).checked == true && + document.getElementById(secondTriggerField).checked == false){ + document.getElementById(myField).disabled= false; + } else { + document.getElementById(myField).disabled= true; + } +} + document.onkeydown= keyDown; // work together to analyze keystrokes if (netscape){ document.captureEvents(Event.KEYDOWN|Event.KEYUP); diff --git a/plugins/personal/samba/class_sambaAccount.inc b/plugins/personal/samba/class_sambaAccount.inc index 257a4e703..dee273c53 100644 --- a/plugins/personal/samba/class_sambaAccount.inc +++ b/plugins/personal/samba/class_sambaAccount.inc @@ -472,6 +472,10 @@ class sambaAccount extends plugin $smarty->assign("reconnmode", $this->mungedObject->getReConn()); $smarty->assign("reconnACL", chkacl($this->acl,"reconn")); + /* Set form elements to disabled/enable state */ + $smarty->assign("tsloginstate", $this->mungedObject->getTsLogin()?"":"disabled"); + $smarty->assign("inheritstate", $this->mungedObject->getInheritMode()?"disabled":""); + /* Set checkboxes to checked or unchecked state */ $smarty->assign("tslogin", $this->mungedObject->getTsLogin()?"checked":""); $smarty->assign("tsloginACL", chkacl($this->acl,"tslogin")); @@ -762,10 +766,15 @@ class sambaAccount extends plugin /* Save checkbox states. */ $this->mungedObject->setTsLogin(!isset($_POST['tslogin']) && chkacl($this->acl, "tslogin") == ""); - $this->mungedObject->setBrokenConn($_POST['brokenconn'] == '1' - && chkacl($this->acl, "brokenconn") == ""); - $this->mungedObject->setReConn($_POST['reconn'] == '1' - && chkacl($this->acl, "reconn") == ""); + // 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(isset($_POST['reconn'])) { + $this->mungedObject->setReConn($_POST['reconn'] == '1' + && chkacl($this->acl, "reconn") == ""); + } $this->mungedObject->setInheritMode(isset($_POST['inherit']) && chkacl($this->acl, "inherit") == ""); $this->mungedObject->setCtxMaxConnectionTimeF(!isset($_POST['CtxMaxConnectionTimeF']) @@ -783,8 +792,10 @@ class sambaAccount extends plugin && chkacl($this->acl, "defaultprinter") == ""); /* Save combo boxes. Takes two values */ - $this->mungedObject->setShadow((isset($_POST['shadow']) - && chkacl($this->acl, "shadow") == ""), $_POST['shadow']); + if(isset($_POST['reconn'])) { + $this->mungedObject->setShadow((isset($_POST['shadow']) + && chkacl($this->acl, "shadow") == ""), $_POST['shadow']); + } /* Check for changes */ if ($this->sambaMungedDial != $this->mungedObject->getMunged()){ diff --git a/plugins/personal/samba/samba3.tpl b/plugins/personal/samba/samba3.tpl index 23833ac2e..6495ae53f 100644 --- a/plugins/personal/samba/samba3.tpl +++ b/plugins/personal/samba/samba3.tpl @@ -58,14 +58,34 @@
- + {t}Allow login on terminal server{/t}
- - + @@ -74,7 +94,7 @@
- +
@@ -83,19 +103,19 @@  
- + {t}Inherit client config{/t}
- +
- +
@@ -112,29 +132,29 @@
- + - +
- + - +
- + - +
@@ -148,19 +168,19 @@ @@ -178,7 +198,7 @@ @@ -186,7 +206,7 @@ @@ -194,7 +214,7 @@ -- 2.30.2
- +
- +
- +
- {html_options options=$shadow selected=$shadowmode}
- {html_options options=$brokenconn selected=$brokenconnmode}
- {html_options options=$reconn selected=$reconnmode}