Skip to content

Commit

Permalink
#142 do not log suspect if no file is defined in pathfinder.ini
Browse files Browse the repository at this point in the history
  • Loading branch information
exodus4d committed May 7, 2016
1 parent 26d0aaf commit e1dba5c
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions app/main/controller/controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,16 +122,18 @@ protected function initSession(){
$f3 = $this->getF3();
if( ($ip = $session->ip() )!= $f3->get('IP') ){
// IP address changed -> not critical
$this->getLogger(
$f3->get('PATHFINDER.LOGFILES.SESSION_SUSPECT')
)->write( sprintf(
self::ERROR_SESSION_SUSPECT,
$sid,
$session->ip(),
$f3->get('IP'),
$f3->get('AGENT')
));

$sessionSuspectLogFile = 'PATHFINDER.LOGFILES.SESSION_SUSPECT';
if( !$f3->devoid($sessionSuspectLogFile) ){
$this->getLogger(
$f3->get($sessionSuspectLogFile)
)->write( sprintf(
self::ERROR_SESSION_SUSPECT,
$sid,
$session->ip(),
$f3->get('IP'),
$f3->get('AGENT')
));
}
// no more error handling here
return true;
}elseif($session->agent() != $f3->get('AGENT') ){
Expand Down

0 comments on commit e1dba5c

Please sign in to comment.