Ignore:
Timestamp:
06/09/10 11:26:44 (10 years ago)
Author:
niltonneto
Message:

Ticket #1041 - Reativada configuração "Verificar endereço IP de todas sessões".

File:
1 edited

Legend:

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

    r2885 r2911  
    99        $user_agent = array(); 
    1010        if (isset($GLOBALS['phpgw']) && !isset($_SESSION['connection_db_info'])){ 
     11                $_SESSION['phpgw_info']['admin']['server']['sessions_checkip'] = $GLOBALS['phpgw_info']['server']['sessions_checkip']; 
    1112                if($GLOBALS['phpgw_info']['server']['use_https'] == 1) { 
    1213                $new_ip = (isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR']."," : ""). $_SERVER['REMOTE_ADDR']; 
    1314                $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__); 
    1415                } 
    15                 $GLOBALS['phpgw']->db->query("select trim(sessionid), ip, browser from phpgw_access_log where account_id <> 0 and lo = 0 and sessionid='{$GLOBALS['sessionid']}' limit 1",__LINE__,__FILE__); 
     16                $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__); 
    1617                $GLOBALS['phpgw']->db->next_record(); 
    1718                if($GLOBALS['phpgw']->db->row( )) 
     
    2223                $http_user_agent = substr($_SERVER[ 'HTTP_USER_AGENT' ],0,199); 
    2324                $user_ip = isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? array($_SERVER['REMOTE_ADDR'], $_SERVER['HTTP_X_FORWARDED_FOR']) : array($_SERVER['REMOTE_ADDR']); 
    24                 $user_agent[] = "{$sess['session_id']}{$user_ip[0]}".$http_user_agent; 
     25                $user_agent[] = ($_SESSION['phpgw_info']['admin']['server']['sessions_checkip'] ? "{$sess['session_id']}{$user_ip[0]}" : "{$sess['session_id']}").$http_user_agent; 
    2526                if(count($user_ip) == 2) { 
    2627                        $user_agent[] = "{$sess['session_id']}{$user_ip[1]}".$http_user_agent; 
Note: See TracChangeset for help on using the changeset viewer.