From 7535b28eb75a87ad64f48c5b43d4703fb259d16c Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 6 Jul 2010 14:00:30 +0000 Subject: [PATCH] Updated account expiration git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6@18946 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../admin/users/class_userManagement.inc | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/gosa-core/plugins/admin/users/class_userManagement.inc b/gosa-core/plugins/admin/users/class_userManagement.inc index 663d598a4..807634a64 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,18 @@ 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... -- 2.30.2