From c32a5ac2173166feb1a780b98659c5ebb127bd6d Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 14 Sep 2009 09:24:39 +0000 Subject: [PATCH] Re-added sambaAcctFlag X - Which tells us the password never expires. - the flag is written now, but the gray out isn't implemented git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14247 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../personal/samba/class_sambaAccount.inc | 38 +++++++++++++++++-- gosa-plugins/samba/personal/samba/samba3.tpl | 8 ++++ 2 files changed, 43 insertions(+), 3 deletions(-) diff --git a/gosa-plugins/samba/personal/samba/class_sambaAccount.inc b/gosa-plugins/samba/personal/samba/class_sambaAccount.inc index 4f0e5a093..8cf6e687c 100644 --- a/gosa-plugins/samba/personal/samba/class_sambaAccount.inc +++ b/gosa-plugins/samba/personal/samba/class_sambaAccount.inc @@ -92,6 +92,7 @@ class sambaAccount extends plugin /* Only used for multiple edit */ var $temporary_disable = FALSE; var $no_password_required = FALSE; + var $no_expiry = FALSE; var $multiple_sambaUserWorkstations = array(); function sambaAccount (&$config, $dn= NULL) @@ -620,6 +621,13 @@ class sambaAccount extends plugin $smarty->assign("flagsN", ""); } + // check if password never expires + if (is_integer(strpos($this->sambaAcctFlags, "X"))) { + $smarty->assign("flagsX", "checked"); + } else { + $smarty->assign("flagsX", ""); + } + if($this->samba3){ if ($this->sambaPwdCanChange=="1"){ $smarty->assign("flagsP", "checked"); @@ -675,7 +683,7 @@ class sambaAccount extends plugin "inherit","CtxWorkDirectory","CtxInitialProgram","CtxMaxConnectionTimeF","CtxMaxConnectionTime","CtxMaxDisconnectionTimeF", "CtxMaxDisconnectionTime","CtxMaxIdleTimeF","CtxMaxIdleTime","connectclientdrives", "onnectclientprinters","defaultprinter","shadow","brokenconn", - "reconn","allow_pwchange","connectclientprinters","no_password_required","temporary_disable", + "reconn","allow_pwchange","connectclientprinters","no_expiry","no_password_required","temporary_disable", "password_expires","logon_time_set","logoff_time_set","kickoff_time_set","SetSambaLogonHours", "workstation_list") as $attr){ if(in_array($attr,$this->multi_boxes)){ @@ -1117,7 +1125,16 @@ class sambaAccount extends plugin $this->pwdCanChange= $tmp; $this->sambaPwdCanChange= $tmp; } - $tmp= "UX"; + $tmp= "U"; + + $this->no_expiry = FALSE; + if (isset($_POST["no_expiry"])){ + if ($_POST["no_expiry"] == 1){ + $tmp.= "X"; + $this->no_expiry = TRUE; + } + } + $this->no_password_required = FALSE; if (isset($_POST["no_password_required"])){ if ($_POST["no_password_required"] == 1){ @@ -1519,6 +1536,7 @@ class sambaAccount extends plugin "InheritClientConfig" => _("Inherit client config"), "sambaPwdCanChange" => _("Allow user to change password") , "sambaAcctFlagsN" => _("Login from windows client requires no password"), + "sambaAcctFlagsX" => _("Password never expires"), "sambaAcctFlagsL" => _("Lock samba account"), "sambaKickoffTime" => _("Account expires") , "sambaPwdMustChange" => _("Password expires") , @@ -1548,7 +1566,7 @@ class sambaAccount extends plugin "inherit","CtxWorkDirectory","CtxInitialProgram","CtxMaxConnectionTimeF","CtxMaxConnectionTime","CtxMaxDisconnectionTimeF", "CtxMaxDisconnectionTime","CtxMaxIdleTimeF","CtxMaxIdleTime","connectclientdrives", "onnectclientprinters","defaultprinter","shadow","brokenconn", - "reconn","allow_pwchange","connectclientprinters","no_password_required","temporary_disable", + "reconn","allow_pwchange","connectclientprinters","no_expiry","no_password_required","temporary_disable", "password_expires","logon_time_set","logoff_time_set","kickoff_time_set","SetSambaLogonHours", "workstation_list") as $attr){ if(isset($_POST["use_".$attr])){ @@ -1734,6 +1752,10 @@ class sambaAccount extends plugin $ret['no_password_required'] = $this->no_password_required; } + if(in_array("no_expiry",$this->multi_boxes)){ + $ret['no_expiry'] = $this->no_expiry; + } + if(in_array("temporary_disable",$this->multi_boxes)){ $ret['temporary_disable'] = $this->temporary_disable; } @@ -1852,6 +1874,16 @@ class sambaAccount extends plugin } } + if(isset($values['no_expiry'])){ + if($values['no_expiry']){ + if(!preg_match("/N/",$this->sambaAcctFlags)) { + $this->sambaAcctFlags = preg_replace("/ /","N",$this->sambaAcctFlags,1); + } + }else{ + $this->sambaAcctFlags = preg_replace("/N/"," ",$this->sambaAcctFlags,1); + } + } + if(isset($values['temporary_disable'])){ if($values['temporary_disable']){ if(preg_match("/L/",$this->sambaAcctFlags)) { diff --git a/gosa-plugins/samba/personal/samba/samba3.tpl b/gosa-plugins/samba/personal/samba/samba3.tpl index 7cc5f2906..a1cb6f9c7 100644 --- a/gosa-plugins/samba/personal/samba/samba3.tpl +++ b/gosa-plugins/samba/personal/samba/samba3.tpl @@ -309,6 +309,14 @@ + + +
+ {render acl=$sambaAcctFlagsXACL checkbox=$multiple_support checked=$use_no_expiry} + + {/render} + +
{render acl=$sambaAcctFlagsNACL checkbox=$multiple_support checked=$use_no_password_required} -- 2.30.2