117 if (!extension_loaded(
'ldap')) {
126 foreach (
$configs as $key => $val) {
144 $authenticated =
false;
145 $this->ds = ldap_connect($this->ldap_server, $this->ldap_port);
147 ldap_set_option($this->ds, LDAP_OPT_PROTOCOL_VERSION, $this->ldap_version);
148 if ($this->ldap_use_TLS) {
149 if (!ldap_start_tls($this->ds)) {
156 if (!(is_string($userDN))) {
160 $authenticated = ldap_bind($this->ds, $userDN, stripslashes($pwd));
161 if ($authenticated) {
165 $this->
setErrors(ldap_errno($this->ds), ldap_err2str(ldap_errno($this->ds)) .
'(' . $userDN .
')');
170 @ldap_close($this->ds);
172 return $authenticated;
185 if (!$this->ldap_loginname_asdn) {
187 if (!ldap_bind($this->ds, $this->ldap_manager_dn, stripslashes($this->ldap_manager_pass))) {
189 ldap_errno($this->ds),
190 ldap_err2str(ldap_errno($this->ds)) .
'(' . $this->ldap_manager_dn .
')'
196 $sr = ldap_search($this->ds, $this->ldap_base_dn,
$filter);
197 $info = ldap_get_entries($this->ds, $sr);
198 if (
$info[
'count'] > 0) {
199 $userDN =
$info[0][
'dn'];
224 if ($this->ldap_filter_person !=
'') {
225 $filter = str_replace(
'@@loginname@@',
$uname, $this->ldap_filter_person);
246 $sr = ldap_read($this->ds, $userdn,
'(objectclass=*)');
247 $entries = ldap_get_entries($this->ds, $sr);
248 if ($entries[
'count'] > 0) {
const F_EXTENSION_PHP_NOT_LOADED
authenticate($uname, $pwd=null)
loadXoopsUser($userdn, $uname, $pwd=null)
const E_CANNOT_CONNECT_TO_SERVER
setErrors($err_no, $err_str)
if(isset($_POST['name'])) $info
const E_TLS_CONNECTION_NOT_OPENED
static getInstance(AuthAbstract $auth_instance)
__construct(Connection $dao=null)
const EF_USER_NOT_FOUND_IN_DIRECTORY_SERVER