Code

Updated password change enforcement
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 6 Jul 2010 13:58:22 +0000 (13:58 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 6 Jul 2010 13:58:22 +0000 (13:58 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18945 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/ihtml/themes/default/framework.tpl
gosa-core/plugins/admin/users/class_userManagement.inc

index fd87bcead395f220d40d65b34ca12a939105fa0f..d6e1886cb085de379a9cbc3cdaba9ba5c1277f14 100644 (file)
@@ -29,6 +29,7 @@
    {if $hideMenus}
 
     {$contents}
+    {$msg_dialogs}
 
    {else}
 
index 51dc848bbbdd85bb9290e3e53e01c3f854e663a1..a8aa4369ffe73d675a2c828c9e3f55e9a5ed5c11 100644 (file)
@@ -275,7 +275,7 @@ class userManagement extends management
             $attrs = $ldap->fetch();
             $this->passwordChangeForceable = 
                     in_array('sambaAccount', $attrs['objectClass']) || 
-                    in_array('posixAccount', $attrs['objectClass']);
+                    (in_array('posixAccount', $attrs['objectClass']) && isset($attrs['shadowMax']));
             $smarty->assign("passwordChangeForceable" , $this->passwordChangeForceable);
             $smarty->assign("enforcePasswordChange" , $this->enforcePasswordChange);
 
@@ -359,11 +359,19 @@ class userManagement extends management
 
                     // Update the posix shadow flag...
                     if($posix){
-                        $posixAccount = new posixAccount($this->config, $this->dn);
-                        $posixAccount->is_modified=TRUE;
-                        $posixAccount->activate_shadowExpire=1;
-                        $posixAccount->shadowExpire = date('d.m.Y', time() - (1 * 24 * 60 *60));
-                        $posixAccount->save();
+
+                        $current= floor(date("U") /60 /60 /24);
+                        $enforceDate = $current -  $attrs['shadowMax'][0];
+                        $new_attrs = array();
+                        $new_attrs['shadowLastChange'] = $enforceDate;
+                        $ldap->cd($this->dn);
+                        $ldap->modify($new_attrs);
+
+#                       $posixAccount = new posixAccount($this->config, $this->dn);
+#                       $posixAccount->is_modified=TRUE;
+#                       $posixAccount->activate_shadowExpire=1;
+#                       $posixAccount->shadowExpire = date('d.m.Y', time() - (1 * 24 * 60 *60));
+#                       $posixAccount->save();
                     }
                    
                     // Update the samba kickoff flag...