Ignore:
Timestamp:
07/08/10 17:52:20 (14 years ago)
Author:
amuller
Message:

Ticket #1135 - Aplicando alterações do branches 2.0 no branches 2.2

File:
1 edited

Legend:

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

    r1464 r3018  
    343343                        } 
    344344 
    345                         /* ExpressoLivre 
    346                            Necessário comentar para que o redirecionamento de uma sessão 
    347                            https para uma http funcionasse atrás de um proxy 
    348                         */ 
    349  
    350                         /* 
    351                         if (@$GLOBALS['phpgw_info']['server']['sessions_checkip']) 
    352                         { 
    353                                 if((PHP_OS != 'Windows') && (PHP_OS != 'WINNT') && 
    354                                         (!$GLOBALS['phpgw_info']['user']['session_ip'] || $GLOBALS['phpgw_info']['user']['session_ip'] != $this->getuser_ip()) 
    355                                 ) 
    356                                 { 
    357                                         //echo "IP do cliente com https   ---->  ".$GLOBALS['phpgw_info']['user']['session_ip']; 
    358                                         //echo "<BR>IP do cliente com http ---->  ".$this->getuser_ip(); 
    359                                         if(is_object($GLOBALS['phpgw']->log)) 
    360                                         { 
    361                                                 // This needs some better wording 
    362                                                 $GLOBALS['phpgw']->log->message(array( 
    363                                                         'text' => 'W-VerifySession, IP %1 doesn\'t match IP %2 in session table', 
    364                                                         'p1'   => $this->getuser_ip(), 
    365                                                         'p2'   => $GLOBALS['phpgw_info']['user']['session_ip'], 
    366                                                         'line' => __LINE__, 
    367                                                         'file' => __FILE__ 
    368                                                 )); 
    369                                                 $GLOBALS['phpgw']->log->commit(); 
    370                                         } 
    371                                         return False; 
    372                                 } 
    373                         } 
    374                         */ 
    375  
     345                         
    376346                        $GLOBALS['phpgw']->acl->acl($this->account_id); 
    377347                        $GLOBALS['phpgw']->accounts->accounts($this->account_id); 
     
    408378                function getuser_ip() 
    409379                { 
    410                 /* 
    411                         if (getenv(HTTP_X_FORWARDED_FOR)) 
    412                         { 
    413                                 if (getenv(HTTP_CLIENT_IP)) 
    414                                 { 
    415                                         $ip=getenv(HTTP_CLIENT_IP); 
    416                                 } 
    417                                 else 
    418                                 { 
    419                                         $ip=getenv(HTTP_X_FORWARDED_FOR); 
    420                                 } 
    421                                 $ip_proxy=getenv(REMOTE_ADDR); 
    422                         } 
    423                         else 
    424                         { 
    425                                 $ip=getenv(REMOTE_ADDR); 
    426                         } 
    427                         return $ip; 
    428                 */ 
    429                         return (isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR']); 
     380                        return (isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR']."," : "").$_SERVER['REMOTE_ADDR'];  
    430381                } 
    431382 
Note: See TracChangeset for help on using the changeset viewer.