Code

Added enforce password change option to samba tab
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 7 Jul 2010 11:06:53 +0000 (11:06 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 7 Jul 2010 11:06:53 +0000 (11:06 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18949 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/samba/personal/samba/class_sambaAccount.inc
gosa-plugins/samba/personal/samba/samba3.tpl

index 9730f7dfd90716ca876a52b1fd8a629adb28def7..47c55760be6bb67ed72c538bd0628bd3e1fc2033 100644 (file)
@@ -86,7 +86,7 @@ class sambaAccount extends plugin
   var $no_expiry = FALSE;
   var $multiple_sambaUserWorkstations = array();
 
-  var $enforce_passwordChange = FALSE;
+  var $enforcePasswordChange = FALSE;
 
   function sambaAccount (&$config, $dn= NULL)
   {
@@ -173,7 +173,7 @@ class sambaAccount extends plugin
     // ------------------------ 
     // Check if we've the attribute 'sambaPwdLastSet' set and if its value is 0, 
     //  in this case a password change is forced for this account. 
-    $this->enforce_passwordChange = (isset($this->attrs['sambaPwdLastSet']) && $this->attrs['sambaPwdLastSet'][0] == '0');
+    $this->enforcePasswordChange = (isset($this->attrs['sambaPwdLastSet']) && $this->attrs['sambaPwdLastSet'][0] == '0');
   }
 
   function execute()
@@ -522,7 +522,7 @@ class sambaAccount extends plugin
           "onnectclientprinters","defaultprinter","shadow","brokenconn",
           "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){
+          "workstation_list", "enforcePasswordChange") as $attr){
       if(in_array($attr,$this->multi_boxes)){
         $smarty->assign("use_".$attr,TRUE);
       }else{
@@ -570,7 +570,7 @@ class sambaAccount extends plugin
 
     /* Show main page */
     $smarty->assign("multiple_support",$this->multiple_support_active);
-    $smarty->assign('enforce_passwordChange', $this->enforce_passwordChange);
+    $smarty->assign('enforcePasswordChange', $this->enforcePasswordChange);
     $display.= $smarty->fetch (get_template_path('samba3.tpl', TRUE, dirname(__FILE__)));
     return ($display);
   }
@@ -961,7 +961,7 @@ class sambaAccount extends plugin
       plugin::save_object();
 
 
-      $this->enforce_passwordChange = (isset($_POST['enforce_passwordChange']));
+      $this->enforcePasswordChange = (isset($_POST['enforcePasswordChange']));
 
       if(isset($_POST['display_information'])){
         msg_dialog::display(_("Information"), 
@@ -1136,7 +1136,7 @@ class sambaAccount extends plugin
     $this->attrs['objectClass']= $tmp;
 
     // Enforce password change
-    if($this->enforce_passwordChange){
+    if($this->enforcePasswordChange){
         $this->attrs['sambaPwdLastSet'] = 0;
     }else{
         if ($this->sambaPwdLastSet != "0"){
@@ -1369,6 +1369,7 @@ class sambaAccount extends plugin
             "sambaPwdCanChange"           => _("Allow user to change password") ,
             "sambaAcctFlagsN"             => _("Login from windows client requires no password"),
             "sambaAcctFlagsX"             => _("Password never expires"),
+            "enforcePasswordChange"       => _("Enforce password change"),
             "sambaAcctFlagsL"             => _("Lock samba account"),
             "sambaKickoffTime"            => _("Account expires") ,
             "sambaPwdMustChange"          => _("Password expires") ,
@@ -1396,7 +1397,7 @@ class sambaAccount extends plugin
             "onnectclientprinters","defaultprinter","shadow","brokenconn",
             "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){
+            "workstation_list", "enforcePasswordChange") as $attr){
         if(isset($_POST["use_".$attr])){
           $this->multi_boxes[] = $attr;
         }
@@ -1557,6 +1558,10 @@ class sambaAccount extends plugin
     if(in_array("allow_pwchange",$this->multi_boxes)){
       $ret['sambaPwdCanChange'] = $this->sambaPwdCanChange;
     }
+
+    if(in_array("enforcePasswordChange",$this->multi_boxes)){
+      $ret['enforcePasswordChange'] = $this->enforcePasswordChange;
+    }
   
     if(in_array("password_expires",$this->multi_boxes)){
       $ret['password_expires']  = $this->password_expires;
index 751e5aba8101d850a74329992e9fa11b41fc86c0..8e7f862809362e1b55fb227db96fe0213fb9bcba 100644 (file)
 
     <table>
         <tr>
-            <td><input type='checkbox' value='1' name='enforce_passwordChange' 
-                 {if $enforce_passwordChange} checked {/if} id='enforce_passwordChange'>
-            <td><label for='enforce_passwordChange'>{t}Enforce password change{/t}</label></td>
+            <td>
+                {render acl=$enforcePasswordChangeACL checkbox=$multiple_support checked=$use_enforcePasswordChange}
+                 <input type='checkbox' value='1' name='enforcePasswordChange' 
+                  {if $enforcePasswordChange} checked {/if} id='enforcePasswordChange'>
+                {/render}
+            </td>
+            <td>
+                <label for='enforcePasswordChange'>{t}Enforce password change{/t}</label>
+            </td>
         </tr>
+        <tr>
+            <td>
+                
     </table>