From: hickert Date: Thu, 11 Jan 2007 05:16:17 +0000 (+0000) Subject: Added sambaLogonHoursAcl and fixed save_object for X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=bd7da1ba4366658279ea414cfa5fecdb3f838e6a;p=gosa.git Added sambaLogonHoursAcl and fixed save_object for sambaLogonTime,sambaLogoffTime,sambaKickoffTime,sambaPwdMustChange these attributes could be set without any acl. git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@5523 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/groups/acl_definition.inc b/plugins/admin/groups/acl_definition.inc index a0cf24ac6..68745830f 100644 --- a/plugins/admin/groups/acl_definition.inc +++ b/plugins/admin/groups/acl_definition.inc @@ -287,6 +287,8 @@ $ACLD['sambaAccount']= "sambaLogonScript" ,//=> _("Logon script"), "sambaProfilePath" ,//=> _("Profile path"), + "sambaLogonHours", + "sambaLogonTime",// => _("Limit Logon Time"), "sambaLogoffTime",// => _("Limit Logoff Time"), "sambaKickoffTime",// => _("Account expiry"), diff --git a/plugins/personal/samba/class_sambaAccount.inc b/plugins/personal/samba/class_sambaAccount.inc index 2a84bd298..690ece7f5 100644 --- a/plugins/personal/samba/class_sambaAccount.inc +++ b/plugins/personal/samba/class_sambaAccount.inc @@ -235,7 +235,7 @@ class sambaAccount extends plugin /* Open Samaba Logong hours dialog */ - if(isset($_POST['SetSambaLogonHours']) && $this->samba3){ + if(isset($_POST['SetSambaLogonHours']) && $this->samba3 && chkacl($this->acl,"sambaLogonHours") == ""){ $this->dialog = new sambaLogonHours($this->config,$this->dn,$this->sambaLogonHours); } @@ -252,7 +252,7 @@ class sambaAccount extends plugin } /* Display dialog */ - if(isset($this->dialog)){ + if((isset($this->dialog)) && (is_object($this->dialog))){ $this->dialog->save_object(); return($this->dialog->execute()); } @@ -625,6 +625,7 @@ class sambaAccount extends plugin $smarty->assign("sambaLogoffTimeACL", chkacl($this->acl, "sambaLogoffTime")); $smarty->assign("sambaKickoffTimeACL", chkacl($this->acl, "sambaKickoffTime")); + $smarty->assign("sambaLogonHoursACL", chkacl($this->acl, "sambaLogonHours")); /* In case of javascript, disable some fields on demand */ if ($this->samba3){ @@ -739,13 +740,17 @@ class sambaAccount extends plugin $tmp.= "N"; } } - if (isset($_POST["password_expires"])){ - if ($_POST["password_expires"] == 1){ - $this->password_expires= 1; + + if(chkacl($this->acl,"sambaPwdMustChange") == ""){ + if (isset($_POST["password_expires"])){ + if ($_POST["password_expires"] == 1){ + $this->password_expires= 1; + } + } else { + $this->password_expires= 0; } - } else { - $this->password_expires= 0; } + if (isset($_POST["temporary_disable"])){ if ($_POST["temporary_disable"] == 1){ if (is_integer(strpos($this->sambaAcctFlags, "L"))) { @@ -755,26 +760,35 @@ class sambaAccount extends plugin } } } - if (isset($_POST["logon_time_set"])){ - if ($_POST["logon_time_set"] == 1){ - $this->logon_time_set= 1; + + if(chkacl($this->acl,"sambaLogonTime") ==""){ + if (isset($_POST["logon_time_set"])){ + if ($_POST["logon_time_set"] == 1){ + $this->logon_time_set= 1; + } + } else { + $this->logon_time_set= 0; } - } else { - $this->logon_time_set= 0; } - if (isset($_POST["logoff_time_set"])){ - if ($_POST["logoff_time_set"] == 1){ - $this->logoff_time_set= 1; + + if(chkacl($this->acl,"sambaLogoffTime") == ""){ + if (isset($_POST["logoff_time_set"])){ + if ($_POST["logoff_time_set"] == 1){ + $this->logoff_time_set= 1; + } + } else { + $this->logoff_time_set= 0; } - } else { - $this->logoff_time_set= 0; } - if (isset($_POST["kickoff_time_set"])){ - if ($_POST["kickoff_time_set"] == 1){ - $this->kickoff_time_set= 1; + + if(chkacl($this->acl,"sambaKickoffTime") == ""){ + if (isset($_POST["kickoff_time_set"])){ + if ($_POST["kickoff_time_set"] == 1){ + $this->kickoff_time_set= 1; + } + } else { + $this->kickoff_time_set= 0; } - } else { - $this->kickoff_time_set= 0; } $fill= ""; diff --git a/plugins/personal/samba/samba3.tpl b/plugins/personal/samba/samba3.tpl index f3a4ffb82..30d0a1a33 100644 --- a/plugins/personal/samba/samba3.tpl +++ b/plugins/personal/samba/samba3.tpl @@ -317,7 +317,7 @@
- {t}Samba logon times{/t}  + {t}Samba logon times{/t}