optionally alllow anonymous login
This commit is contained in:
parent
e107104da7
commit
b22545c8b8
|
@ -84,13 +84,14 @@ class Ldap{
|
||||||
*
|
*
|
||||||
* @param string $user user name
|
* @param string $user user name
|
||||||
* @param string $passwd password
|
* @param string $passwd password
|
||||||
|
* @param boolean $allowAnonymous specifies if anonymous binds are allowed
|
||||||
* @return mixed if connect succeeds the server handle is returned, else false
|
* @return mixed if connect succeeds the server handle is returned, else false
|
||||||
*/
|
*/
|
||||||
function connect($user, $passwd) {
|
function connect($user, $passwd, $allowAnonymous=false) {
|
||||||
// close any prior connection
|
// close any prior connection
|
||||||
@$this->close();
|
@$this->close();
|
||||||
// do not allow anonymous bind
|
// do not allow anonymous bind
|
||||||
if ((!$user)||($user == "")||(!$passwd)) {
|
if (!$allowAnonymous && ((!$user)||($user == "")||(!$passwd))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// save password und username encrypted
|
// save password und username encrypted
|
||||||
|
|
Loading…
Reference in New Issue