Skip to content

Commit

Permalink
* [MOD] Log invalid IP address. Related #498
Browse files Browse the repository at this point in the history
  • Loading branch information
nuxsmin committed Mar 13, 2017
1 parent c953de9 commit 4c91a0a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions inc/SP/Controller/LoginController.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ private function checkTracking()
$attempts = count(Track::getItem($TrackData)->getTracksForClientFromTime(time() - self::TIME_TRACKING));
} catch (SPException $e) {
$this->LogMessage->addDescription($e->getMessage());
$this->LogMessage->addDescription($e->getHint());

throw new AuthException(SPException::SP_ERROR, __('Error interno', false), '', self::STATUS_INTERNAL_ERROR);
}
Expand Down
5 changes: 4 additions & 1 deletion inc/SP/DataModel/TrackData.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
*/

namespace SP\DataModel;

use SP\Core\Exceptions\InvalidArgumentException;
use SP\Core\Exceptions\SPException;

Expand Down Expand Up @@ -151,7 +152,9 @@ public function setTrackIp($track_ip)
} elseif (strlen($ip) > 4) {
$this->track_ipv6 = $ip;
} elseif ($ip === false) {
throw new InvalidArgumentException(SPException::SP_ERROR, __('IP inválida'));
debugLog(sprintf('%s : %s', __('IP inválida', true), $track_ip));

throw new InvalidArgumentException(SPException::SP_ERROR, __('IP inválida'), $track_ip);
}
}

Expand Down

0 comments on commit 4c91a0a

Please sign in to comment.