summaryrefslogtreecommitdiff
path: root/inc/adLDAP.php
diff options
context:
space:
mode:
authorAndreas Gohr <gohr@cosmocode.de>2011-10-28 14:24:56 +0200
committerAndreas Gohr <gohr@cosmocode.de>2011-10-31 16:02:26 +0100
commitabb56b33e0993b3c6a7f114fbd074cc59626c394 (patch)
treef88e486b61cc32008d604067f4601ab7df14c5fc /inc/adLDAP.php
parent222298bcee7f8e8fd98bb6fc1bcfb821ac1e55cd (diff)
downloadrpg-abb56b33e0993b3c6a7f114fbd074cc59626c394.tar.gz
rpg-abb56b33e0993b3c6a7f114fbd074cc59626c394.tar.bz2
Check password expiry times in Active Directory backend
When a user logs in, the password expiry time is checked and compared to the $conf['auth']['ad']['expirywarn'] setting (in days). If the password is about to expire in the specified timeframe, a warning is issued on login. This patch adds a new method to the adLDAP class for querying domain parameters.
Diffstat (limited to 'inc/adLDAP.php')
-rw-r--r--inc/adLDAP.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/inc/adLDAP.php b/inc/adLDAP.php
index a64096b85..24be6e475 100644
--- a/inc/adLDAP.php
+++ b/inc/adLDAP.php
@@ -1021,6 +1021,26 @@ class adLDAP {
}
/**
+ * Return info about the domain itself
+ *
+ * @authot Andreas Gohr <gohr@cosmocode.de>
+ * @param array $fields The fields to query
+ * @return array
+ */
+ public function domain_info($fields){
+ if (!$this->_bind){ return (false); }
+
+ $sr = ldap_read($this->_conn, $this->_base_dn, 'objectclass=*', $fields);
+ if (!$sr) {
+ return false;
+ }
+ $info = ldap_get_entries($this->_conn, $sr);
+ if(count($info)) return $info[0];
+
+ return false;
+ }
+
+ /**
* Determine a user's password expiry date
*
* @param string $username The username to query