X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=classes%2Fcorelogger.php;h=8d06056fe3afb9b63c9f1c95a850b5c2bf75b97c;hb=2669eb7ddb20749fd6d1e99e611f6d199daa5580;hp=e5784c614e583c66d4709bfd51f3a1b0b2a64c6a;hpb=670b0ac0977d685aa05ba490bef58fd2995bcffb;p=platal.git diff --git a/classes/corelogger.php b/classes/corelogger.php index e5784c6..8d06056 100644 --- a/classes/corelogger.php +++ b/classes/corelogger.php @@ -28,6 +28,11 @@ class CoreLogger /** list of available actions */ private $actions; + public $ip; + public $host; + public $proxy_ip; + public $proxy_host; + /** The constructor, creates a new entry in the sessions table * * @param $uid the id of the logged user @@ -49,7 +54,7 @@ class CoreLogger } /** Creates a new session entry in database and return its ID. - * + * * @param $uid the id of the logged user * @param $suid the id of the administrator who has just su'd to the user * @return session the session id @@ -72,7 +77,16 @@ class CoreLogger XDB::execute("INSERT INTO logger.sessions SET uid={?}, host={?}, ip={?}, forward_ip={?}, forward_host={?}, browser={?}, suid={?}, flags={?}", - $uid, $host, $ip, $forward_ip, $forward_host, $browser, $suid, $proxy); + $uid, $host, ip_to_uint($ip), ip_to_uint($forward_ip), $forward_host, $browser, $suid, $proxy); + if ($forward_ip) { + $this->proxy_ip = $ip; + $this->proxy_host = $host; + $this->ip = $forward_ip; + $this->host = $forward_host; + } else { + $this->ip = $ip; + $this->host = $host; + } return XDB::insertId(); }