Author: ralfbecker
New Revision: 26765
URL: http://www.egroupware.org/viewvc/egroupware?rev=3D26765&view=3Drev
Log:
Fixed not (always) updated last password change date
Modified:
branches/1.6/phpgwapi/inc/class.accounts_ldap.inc.php
branches/1.6/phpgwapi/inc/class.accounts_sql.inc.php
branches/1.6/phpgwapi/inc/class.auth_ldap.inc.php
Modified: branches/1.6/phpgwapi/inc/class.accounts_ldap.inc.php
URL: http://www.egroupware.org/viewvc/egroupware/branches/1.6/phpgwapi/inc/=
class.accounts_ldap.inc.php?rev=3D26765&r1=3D26764&r2=3D26765&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
— branches/1.6/phpgwapi/inc/class.accounts_ldap.inc.php (original)
+++ branches/1.6/phpgwapi/inc/class.accounts_ldap.inc.php Thu Apr 9 08:44:=
02 2009
@@ -488,7 +488,7 @@
// shadowexpire is in days since 1970/01/01 (equivalent to a timestamp =
(int UTC!) / (246060)
‘account_status’ =3D> isset($data[‘shadowexpire’]) && $data[‘shadowe=
xpire’][0]243600+$utc_diff < time() ? false : ‘A’,
‘account_expires’ =3D> isset($data[‘shadowexpire’]) && $data[‘shadowe=
xpire’][0] ? $data[‘shadowexpire’][0]243600+$utc_diff : -1, // LDAP date =
is in UTC
-
'account_lastpasswd_change' =3D> isset($data['shadowlastchange']) ? $da=
ta[‘shadowlastchange’][0]243600 : null,
-
'account_lastpasswd_change' =3D> isset($data['shadowlastchange']) ? $da=
ta[‘shadowlastchange’][0]243600+$utc_diff : null,
// lastlogin and lastlogin from are not availible via the shadowAccount=
object class
// ‘account_lastlogin’ =3D> $data[‘phpgwaccountlastlogin’][0],
// ‘account_lastloginfrom’ =3D> $data[‘phpgwaccountlastloginfrom’][0],
@@ -548,6 +548,7 @@
}
$to_write[‘cn’] =3D $data[‘account_fullname’] ? $data[‘account_fu=
llname’] : $data[‘account_firstname’].’ '.$data[‘account_lastname’];
-
$utc_diff =3D date('Z'); if (isset($data['account_passwd']) && $data['account_passwd']) { if (!preg_match('/^\\{[a-z5]{3,5}\\}.+/i',$data['account_passwd'])) // =
if it’s not already entcrypted, do so now
@@ -555,13 +556,13 @@
$data[‘account_passwd’] =3D auth::encrypt_ldap($data[‘account_passwd’]=
);
}
$to_write[‘userpassword’] =3D $data[‘account_passwd’];
-
$to_write['shadowLastChange'] =3D (time()-$utc_diff) / (24*3600); } // both status and expires are encoded in the single shadowexpire value =
in LDAP
// - if it’s unset an account is enabled AND does never expire
// - if it’s set to 0, the account is disabled
// - if it’s set to > 0, it will or already has expired --> acount is ac=
tive if it not yet expired
// shadowexpire is in days since 1970/01/01 (equivalent to a timestamp (=
int UTC!) / (246060)
-
$utc_diff =3D date('Z'); $shadowexpire =3D ($data['account_expires']-$utc_diff) / (24*3600); $account_expire =3D $shadowexpire*3600*24+$utc_diff; //echo "<p align=3Dright>account_expires=3D".date('Y-m-d H:i',$data['acc=
ount_expires’])." --> $shadowexpire --> “.date(‘Y-m-d H:i’,$account_expire)=
.”
@@ -714,7 +715,7 @@
$relevantAccounts =3D is_numeric($start) ? array_slice(array_keys($ful=
lSet), $start, $offset) : array_keys($fullSet);
// if we do not have a start, or want the members of a certain group, =
we want all, that way we dont want to or the uids
// since if we have a whole lot of members, it slows the query down
-
// if you work with very big groups, it may present a problem =
-
// if you work with very big groups, it may present a problem if (is_numeric($start) || is_numeric($param['type'])) { $filter =3D "(" . "&(objectclass=3Dposixaccount)" . '(|(uid=3D'.implo=
de(’)(uid=3D’,$relevantAccounts).’))’ . $this->account_filter . “)”;
} else {
Modified: branches/1.6/phpgwapi/inc/class.accounts_sql.inc.php
URL: http://www.egroupware.org/viewvc/egroupware/branches/1.6/phpgwapi/inc/=
class.accounts_sql.inc.php?rev=3D26765&r1=3D26764&r2=3D26765&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
— branches/1.6/phpgwapi/inc/class.accounts_sql.inc.php (original)
+++ branches/1.6/phpgwapi/inc/class.accounts_sql.inc.php Thu Apr 9 08:44:0=
2 2009
@@ -167,6 +167,7 @@
$data[‘account_passwd’] =3D $GLOBALS[‘egw’]->auth->encrypt_sql($data[’=
account_passwd’]);
}
$to_write[‘account_pwd’] =3D $data[‘account_passwd’];
-
$to_write['account_lastpwd_change'] =3D time(); } if (!(int)$data['account_id'] || !$this->id2name($data['account_id'])) {
Modified: branches/1.6/phpgwapi/inc/class.auth_ldap.inc.php
URL: http://www.egroupware.org/viewvc/egroupware/branches/1.6/phpgwapi/inc/=
class.auth_ldap.inc.php?rev=3D26765&r1=3D26764&r2=3D26765&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
— branches/1.6/phpgwapi/inc/class.auth_ldap.inc.php (original)
+++ branches/1.6/phpgwapi/inc/class.auth_ldap.inc.php Thu Apr 9 08:44:02 2=
009
@@ -1,10 +1,10 @@