mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-12-25 08:50:11 +01:00
gui: log unsuccessful login attempts
Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
parent
03900aef6e
commit
549d9cf03b
@ -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']++;
|
||||||
}
|
}
|
||||||
|
@ -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");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user