Changeset 7136 for branches/2.4/header.session.inc.php
- Timestamp:
- 08/30/12 17:59:54 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.4/header.session.inc.php
r6830 r7136 19 19 20 20 if( !isset($_SESSION) ) 21 session_start( );21 session_start( ); 22 22 23 23 $sess = $_SESSION[ 'phpgw_session' ]; … … 26 26 if (isset($GLOBALS['phpgw']) && !isset($_SESSION['connection_db_info'])){ 27 27 $_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__); 31 39 } 32 40 $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.