From: hickert Date: Tue, 6 Jul 2010 13:58:22 +0000 (+0000) Subject: Updated password change enforcement X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=06db888ac8b97460b1b0c962f1a91d3a511c69a6;p=gosa.git Updated password change enforcement git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18945 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/ihtml/themes/default/framework.tpl b/gosa-core/ihtml/themes/default/framework.tpl index fd87bcead..d6e1886cb 100644 --- a/gosa-core/ihtml/themes/default/framework.tpl +++ b/gosa-core/ihtml/themes/default/framework.tpl @@ -29,6 +29,7 @@ {if $hideMenus} {$contents} + {$msg_dialogs} {else} diff --git a/gosa-core/plugins/admin/users/class_userManagement.inc b/gosa-core/plugins/admin/users/class_userManagement.inc index 51dc848bb..a8aa4369f 100644 --- a/gosa-core/plugins/admin/users/class_userManagement.inc +++ b/gosa-core/plugins/admin/users/class_userManagement.inc @@ -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...