Changeset 5118 for branches


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

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

Location:
branches/2.3/phpgwapi
Files:
4 edited

Legend:

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

    r4867 r5118  
    122122                                        } 
    123123                                        return True; 
    124                                 } 
     124                                }else{ 
     125                                    if(ldap_errno($ldap) == 53) 
     126                                        return 0; 
     127                                } 
    125128                        } 
    126129                        /* dn not found or password wrong */ 
  • 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. 
  • branches/2.3/phpgwapi/templates/default/login_default.php

    r5010 r5118  
    3131                                return '<font color="FF0000">' . lang('Your password has expired, and you do not have access to change it') . '</font>'; 
    3232                                 
    33                         case 98: 
     33                        case 97: 
     34                                return '<font color="FF0000">' . lang('Account blocked, please contact the system administrator.') . '</font>'; 
     35                        case 98: 
    3436                                return '<font color="FF0000">' . lang('Account is expired') . '</font>'; 
    3537                                 
Note: See TracChangeset for help on using the changeset viewer.