Fix httpldap auth plugin logic in case of mismatch

(user authenticated but not in LDAP)
This commit is contained in:
Daniel Berteaud 2014-07-05 10:33:55 +02:00
parent f20cef3931
commit 659fa46978
1 changed files with 5 additions and 8 deletions

View File

@ -52,14 +52,11 @@ class auth_plugin_authhttpldap extends auth_plugin_authldap {
$this->_debug('LemonLDAP::NG Login Name: '.htmlspecialchars($username),0,__LINE__,__FILE__);
if (!empty($username)){
$USERINFO = $this->getUserData($username,true);
$success = true;
$_SESSION[DOKU_COOKIE]['auth']['user'] = $username;
$_SESSION[DOKU_COOKIE]['auth']['info'] = $USERINFO;
}
// Deny access if user is not found in LDAP
// This should never happen
if (!empty($USERINFO['dn'])){
$success = false;
if ($USERINFO !== false){
$success = true;
$_SESSION[DOKU_COOKIE]['auth']['user'] = $username;
$_SESSION[DOKU_COOKIE]['auth']['info'] = $USERINFO;
}
}
return $success;
}