Revision #8                                    has been created by 
 Navarr                                    on Dec 7, 2013, 1:51:25 AM with the memo:
                                
                                
                                    Silence ldap_bind errors                                
                                                                    « previous (#7)                                                                                            
                            Changes
                            
    Title
    unchanged
    How to use ldap in UserIdentity for authentication
    Category
    unchanged
    Tutorials
    Yii version
    unchanged
    
    Tags
    unchanged
    Authentication, LDAP
    Content
    changed
    [...]
ldap_set_option($connection, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($connection, LDAP_OPT_REFERRALS, 0);
 
if($connection)
{
    // Note: in general it is bad to hide errors, however we're checking for an error below
 
    $bind = 
@ldap_bind($connection, "uid={$this->username},ou={$options['ou']},{$dc_string}", $this->password);
 
    if(!$bind) $this->errorCode = self::ERROR_PASSWORD_INVALID;
    else $this->errorCode = self::ERROR_NONE;
}
return !$this->errorCode;[...]