38 parent::__construct(
$dao);
54 $authenticated =
false;
55 if (!extension_loaded(
'ldap')) {
57 return $authenticated;
59 $this->ds = ldap_connect($this->ldap_server, $this->ldap_port);
61 ldap_set_option($this->ds, LDAP_OPT_PROTOCOL_VERSION, $this->ldap_version);
62 ldap_set_option($this->ds, LDAP_OPT_REFERRALS, 0);
63 if ($this->ldap_use_TLS) {
64 if (!ldap_start_tls($this->ds)) {
78 $authenticated = ldap_bind($this->ds, $userUPN, stripslashes($pwd));
88 $this->
setErrors(ldap_errno($this->ds), ldap_err2str(ldap_errno($this->ds)) .
'(' . $userUPN .
')');
93 @ldap_close($this->ds);
94 return $authenticated;
loadXoopsUser($userdn, $uname, $pwd=null)
const E_CANNOT_CONNECT_TO_SERVER
authenticate($uname, $pwd=null)
__construct(Connection $dao=null)
const E_EXTENSION_PHP_LDAP_NOT_LOADED
setErrors($err_no, $err_str)
const E_TLS_CONNECTION_NOT_OPENED