Full name in LDAP is usually cn; compare ldap_connect() to false

Signed-off-by: Olivier Mehani <shtrom+friendica@ssji.net>
pull/343/head
Olivier Mehani 2016-02-10 11:08:40 +00:00
parent bba50284ca
commit d6f727974b
1 changed files with 2 additions and 2 deletions

View File

@ -47,7 +47,7 @@
* // attribute to get email - optional - default : 'mail' * // attribute to get email - optional - default : 'mail'
* $a->config['ldapauth']['ldap_autocreateaccount_emailattribute'] = 'mail'; * $a->config['ldapauth']['ldap_autocreateaccount_emailattribute'] = 'mail';
* // attribute to get nickname - optional - default : 'givenName' * // attribute to get nickname - optional - default : 'givenName'
* $a->config['ldapauth']['ldap_autocreateaccount_nameattribute'] = 'givenName'; * $a->config['ldapauth']['ldap_autocreateaccount_nameattribute'] = 'cn';
* *
* ...etc. * ...etc.
*/ */
@ -97,7 +97,7 @@ function ldapauth_authenticate($username,$password) {
$connect = @ldap_connect($ldap_server); $connect = @ldap_connect($ldap_server);
if(! $connect) { if($connect === false) {
logger("ldapauth: could not connect to $ldap_server"); logger("ldapauth: could not connect to $ldap_server");
return false; return false;
} }