Ignore:
Timestamp:
08/30/12 17:59:54 (12 years ago)
Author:
eduardow
Message:

Ticket #3075 - Corrigir tamanho de tabela de logs do Expresso .

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.4/header.session.inc.php

    r6830 r7136  
    1919 
    2020if( !isset($_SESSION) )  
    21 session_start( );  
     21        session_start( );  
    2222 
    2323$sess = $_SESSION[ 'phpgw_session' ]; 
     
    2626if (isset($GLOBALS['phpgw']) && !isset($_SESSION['connection_db_info'])){  
    2727        $_SESSION['phpgw_info']['admin']['server']['sessions_checkip'] = $GLOBALS['phpgw_info']['server']['sessions_checkip']; 
    28         if($GLOBALS['phpgw_info']['server']['use_https'] == 1) {  
    29                 $new_ip = (isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR']."," : ""). $_SERVER['REMOTE_ADDR'];  
    30                 $GLOBALS['phpgw']->db->query("UPDATE phpgw_access_log SET ip='$new_ip' WHERE account_id <> 0 and lo = 0 and sessionid='{$GLOBALS['sessionid']}'",__LINE__,__FILE__);  
     28        if($GLOBALS['phpgw_info']['server']['use_https'] == 1){   
     29            $new_ip = (isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR']."," : ""). $_SERVER['REMOTE_ADDR'];                 
     30            if(strlen($new_ip)>30){  
     31                    $ip_exploded = explode(",",$new_ip);  
     32                    $new_ip = "";  
     33                    for($i=0;$i<2;$i++)  
     34                            $new_ip .= isset($ip_exploded[$i])?(($i==1?",":"").trim($ip_exploded[$i])):("");  
     35                    if(strlen($new_ip)>30)  
     36                            $new_ip = $ip_exploded[0];  
     37            }                 
     38            $GLOBALS['phpgw']->db->query("UPDATE phpgw_access_log SET ip='$new_ip' WHERE account_id <> 0 and lo = 0 and sessionid='{$GLOBALS['sessionid']}'",__LINE__,__FILE__);  
    3139        }  
    3240         $GLOBALS['phpgw']->db->query("select trim(sessionid),".($_SESSION['phpgw_info']['admin']['server']['sessions_checkip'] ? "ip," : "")."browser from phpgw_access_log where account_id <> 0 and lo = 0 and sessionid='{$GLOBALS['sessionid']}' limit 1",__LINE__,__FILE__);  
Note: See TracChangeset for help on using the changeset viewer.