When saving user IP, we should save user IP instead of server IP

This commit is contained in:
MacWarrior 2016-10-09 15:29:55 +02:00
parent 9d904e2faf
commit dc2ba7b8a7
2 changed files with 11 additions and 8 deletions

View file

@ -36,14 +36,14 @@ class CBLogs
{
global $db,$userquery;
$a = $details_array;
//$ip = $_SERVER['REMOTE_ADDR'];
$ipv = $this->get_local_ipv4();
$ip = $_SERVER['REMOTE_ADDR'];
/*$ipv = $this->get_local_ipv4();
if($ipv['eth0']){
$ip = $ipv['eth0'];
}
if($ipv['wlan0']){
$ip = $ipv['wlan0'];
}
}*/
$agent = $_SERVER['HTTP_USER_AGENT'];
$userid = getArrayValue($a, 'userid');
$username = $a['username'];

View file

@ -320,15 +320,18 @@ class userquery extends CBCategory{
//$sess->set('user_session_key',$udetails['user_session_key']);
//$sess->set('user_session_code',$udetails['user_session_code']);
//local client ip access
$ip = $cblog->get_local_ipv4();
//local client ip access - only works on linux : is it really useful ??
/*$ip = $cblog->get_local_ipv4();
if($ip['eth0']){
if( isset($ip['eth0']) ){
$ipv = $ip['eth0'];
}
if($ip['wlan0']){
if( isset($ip['wlan0']) ){
$ipv = $ip['wlan0'];
}
}*/
$ipv = $_SERVER["REMOTE_ADDR"];
//Setting Vars
$this->userid = $udetails['userid'];
$this->username = $udetails['username'];