Changeset 368


Ignore:
Timestamp:
07/24/08 14:25:44 (16 years ago)
Author:
niltonneto
Message:

Código para atenuar eventuais problemas de conexão com LDAP,
tentando reconectar em seguida.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/phpgwapi/inc/class.common.inc.php

    r266 r368  
    305305                        } 
    306306                        // bind as admin 
    307                         if($dn && $passwd && ! ldap_bind($ds,$dn,$passwd)) 
    308                         { 
    309                                 if(is_object($GLOBALS['phpgw']->log)) 
    310                                 { 
    311                                         $GLOBALS['phpgw']->log->message('F-Abort, Failed binding to LDAP server'); 
    312                                         $GLOBALS['phpgw']->log->commit(); 
    313                                 } 
    314  
    315                                 echo '<center><b>'.lang("ExpressoLivre is unavailable at this moment. Code %1<br>Please, try later.","002").'</b></center>'; 
    316                                 //printf("<b>Error: Can't bind to LDAP server: %s!</b><br>",$dn); 
    317                                 return False; 
     307                        if($dn && $passwd && !@ldap_bind($ds,$dn,$passwd)) 
     308                        {                                
     309                                // Try rebind for connection problem 
     310                                if(!@ldap_bind($ds,$dn,$passwd)) { 
     311                                        if(is_object($GLOBALS['phpgw']->log)) 
     312                                        { 
     313                                                $GLOBALS['phpgw']->log->message('F-Abort, Failed binding to LDAP server'); 
     314                                                $GLOBALS['phpgw']->log->commit(); 
     315                                        } 
     316 
     317                                        echo '<center><b>'.lang("ExpressoLivre is unavailable at this moment. Code %1<br>Please, try later.","002").'</b></center>'; 
     318                                        return False; 
     319                                } 
    318320                        } 
    319321                        // bind as anonymous 
    320                         if(!$dn && !$passwd && ! ldap_bind($ds)) 
     322                        if(!$dn && !$passwd && !@ldap_bind($ds)) 
    321323                        { 
    322324                                if(is_object($GLOBALS['phpgw']->log)) 
Note: See TracChangeset for help on using the changeset viewer.