Project

General

Profile

« Previous | Next » 

Revision 4772

Added by daigle almost 16 years ago

Include the dc in the user name when connecting to ldap to change password.

View differences:

src/perl/ldapweb.cgi
512 512
    
513 513
    my $errorMessage = 0;
514 514
    my $ldap;
515

  
516
    my $ldapUsername = $ldapConfig->{$o}{'user'} . ',' . $searchBase;
515 517
    
516 518
    #if main ldap server is down, a html file containing warning message will be returned
517 519
    $ldap = Net::LDAP->new($ldapurl, timeout => $timeout) or handleLDAPBindFailure($ldapurl);
......
519 521
    #$ldap->start_tls( verify => 'require',
520 522
                      #cafile => '/usr/share/ssl/ldapcerts/cacert.pem');
521 523
    $ldap->start_tls( verify => 'none');
522
    my $bindresult = $ldap->bind( version => 3, dn => $bindDN, 
524
    my $bindresult = $ldap->bind( version => 3, dn => $ldapUsername, 
523 525
                                  password => $bindPass );
524 526
    if ($bindresult->code) {
525
        $errorMessage = "Failed to log in. Are you sure your old " .
526
                        "password is correct? Try again...";
527
        $errorMessage = "Failed to log in. Are you sure your authentication client username/password " .
528
                        "password is correct? Please check your configuration and try again...";:q!
527 529
        return $errorMessage;
528 530
    }
529 531

  

Also available in: Unified diff