gui: log unsuccessful login attempts

Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
Janos SUTO 2017-09-07 12:12:08 +02:00
parent 03900aef6e
commit 549d9cf03b
2 changed files with 7 additions and 1 deletions

View File

@ -83,6 +83,8 @@ class ControllerLoginLogin extends Controller {
} }
} }
else { else {
LOGGER('login failed', $this->request->post['username']);
$this->model_user_auth->increment_failed_login_count($this->data['failed_login_count']); $this->model_user_auth->increment_failed_login_count($this->data['failed_login_count']);
$this->data['failed_login_count']++; $this->data['failed_login_count']++;
} }

View File

@ -1,8 +1,12 @@
<?php <?php
function LOGGER($event = '', $username = '') { function LOGGER($event = '', $username = '') {
$ipaddr = '';
if($event == "") { return 0; } if($event == "") { return 0; }
if(isset($_SERVER['REMOTE_ADDR'])) { $ipaddr = $_SERVER['REMOTE_ADDR']; }
$session = Registry::get('session'); $session = Registry::get('session');
if($username == '') { if($username == '') {
@ -10,7 +14,7 @@ function LOGGER($event = '', $username = '') {
else { $username = 'unknown'; } else { $username = 'unknown'; }
} }
syslog(LOG_INFO, "username=$username, event='$event'"); syslog(LOG_INFO, "username=$username, event='$event', ipaddr=$ipaddr");
} }