Ignore:
Timestamp:
10/26/11 08:59:42 (13 years ago)
Author:
brunocosta
Message:

Ticket #2299 - Trata o erro 53 do LDAP na autenticação do usuário.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.3/phpgwapi/inc/class.sessions.inc.php

    r4945 r5118  
    487487                        $this->account_id = $GLOBALS['phpgw']->accounts->name2id($this->account_lid); 
    488488 
     489                        $ldapAuth = $GLOBALS['phpgw']->auth->authenticate($this->account_lid, $this->passwd, $this->passwd_type); 
     490 
    489491                        if (($blocked = $this->login_blocked($login,$user_ip)) ||       // too many unsuccessful attempts 
    490492                                $GLOBALS['phpgw_info']['server']['global_denied_users'][$this->account_lid] || 
    491                                 !$GLOBALS['phpgw']->auth->authenticate($this->account_lid, $this->passwd, $this->passwd_type) || 
     493                                !$ldapAuth || 
    492494                                $this->account_id && $GLOBALS['phpgw']->accounts->get_type($this->account_id) == 'g') 
    493495                        { 
    494                                 $this->reason = $blocked ? 'blocked, too many attempts' : 'bad login or password'; 
    495                                 $this->cd_reason = $blocked ? 99 : 5; 
    496  
    497                                 $this->log_access($this->reason,$login,$user_ip,0);     // log unsuccessfull login 
    498                                 return False; 
     496                                if($ldapAuth === 0){ 
     497                                          $this->reason = 'Ldap blocked'; 
     498                                          $this->cd_reason = 97; 
     499                                          return False; 
     500                                }else{ 
     501                                        $this->reason = $blocked ? 'blocked, too many attempts' : 'bad login or password'; 
     502                                        $this->cd_reason = $blocked ? 99 : 5; 
     503                                        $this->log_access($this->reason,$login,$user_ip,0);     // log unsuccessfull login 
     504                                        return False; 
     505                                } 
    499506                        } 
    500507                        // Só verifica tempo de inatividade do usuário, caso esteja configurado no Administrador. 
Note: See TracChangeset for help on using the changeset viewer.