From 2be1fd21311f57c261a71823f8b9b68df7aa436c Mon Sep 17 00:00:00 2001 From: Quentin Ligier Date: Wed, 16 Mar 2016 20:20:21 +0100 Subject: [PATCH] Add login logs --- php/Modules/Session.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/php/Modules/Session.php b/php/Modules/Session.php index 0b846ad..91ffbae 100755 --- a/php/Modules/Session.php +++ b/php/Modules/Session.php @@ -70,14 +70,15 @@ final class Session { // Call plugins Plugins::get()->activate(__METHOD__, 0, func_get_args()); - $username = crypt($username, Settings::get()['username']); + $username_crypt = crypt($username, Settings::get()['username']); $password = crypt($password, Settings::get()['password']); // Check login with crypted hash - if (Settings::get()['username']===$username&& + if (Settings::get()['username']===$username_crypt&& Settings::get()['password']===$password) { $_SESSION['login'] = true; $_SESSION['identifier'] = Settings::get()['identifier']; + Log::notice(Database::get(), __METHOD__, __LINE__, 'User ['.$username.'] has logged in from ['.$_SERVER['REMOTE_ADDR'].']'); return true; } @@ -87,6 +88,7 @@ final class Session { // Call plugins Plugins::get()->activate(__METHOD__, 1, func_get_args()); + Log::error(Database::get(), __METHOD__, __LINE__, 'User ['.$username.'] has tried to log in from ['.$_SERVER['REMOTE_ADDR'].']'); return false; }