diff options
author | Andreas Gohr <gohr@cosmocode.de> | 2011-11-07 14:15:29 +0100 |
---|---|---|
committer | Andreas Gohr <gohr@cosmocode.de> | 2011-11-07 14:15:29 +0100 |
commit | 22ffffcf6892924895d9ad45f749a307d05e09e0 (patch) | |
tree | 1383eef88adb20376c0282a2482d06468b493155 | |
parent | abb56b33e0993b3c6a7f114fbd074cc59626c394 (diff) | |
download | rpg-22ffffcf6892924895d9ad45f749a307d05e09e0.tar.gz rpg-22ffffcf6892924895d9ad45f749a307d05e09e0.tar.bz2 |
always check expire time when configured
-rw-r--r-- | inc/auth/ad.class.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/inc/auth/ad.class.php b/inc/auth/ad.class.php index 6b022d217..c3df2417b 100644 --- a/inc/auth/ad.class.php +++ b/inc/auth/ad.class.php @@ -189,14 +189,16 @@ class auth_ad extends auth_basic { $info['grps'][] = $conf['defaultgroup']; } - // password will expire, let's warn the current user - if($_SERVER['REMOTE_USER'] == $user && $info['expires'] && $this->cnf['expirywarn']){ + // check expiry time + if($info['expires'] && $this->cnf['expirywarn']){ $result = $this->adldap->domain_info(array('maxpwdage')); // maximum pass age $maxage = -1 * $result['maxpwdage'][0] / 10000000; // negative 100 nanosecs $timeleft = $maxage - (time() - $info['lastpwd']); $timeleft = round($timeleft/(24*60*60)); + $info['expiresin'] = $timeleft; - if($timeleft <= $this->cnf['expirywarn']){ + // if this is the current user, warn him + if( ($_SERVER['REMOTE_USER'] == $user) && ($timeleft <= $this->cnf['expirywarn'])){ msg('Your password will expire in '.$timeleft.' days. You should change it.'); } } |