diff options
author | Lukas Reschke <lukas@owncloud.com> | 2014-08-15 12:13:00 +0200 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2014-08-15 16:52:13 +0200 |
commit | e7cea79ee7311c41c5f95082cba6e75e0236beac (patch) | |
tree | f46b249986f5a6b843f2edf0f9da3c6543889011 | |
parent | 1a2bae347ad734a82d042eb34aeff3558962026e (diff) | |
download | nextcloud-server-e7cea79ee7311c41c5f95082cba6e75e0236beac.tar.gz nextcloud-server-e7cea79ee7311c41c5f95082cba6e75e0236beac.zip |
Move authentication failed logging to checkPassword
Fixes https://github.com/owncloud/core/issues/10366
-rwxr-xr-x | config/config.sample.php | 3 | ||||
-rw-r--r-- | lib/base.php | 7 | ||||
-rw-r--r-- | lib/private/user/manager.php | 2 |
3 files changed, 2 insertions, 10 deletions
diff --git a/config/config.sample.php b/config/config.sample.php index 1cf2c22866a..402c84fe0c7 100755 --- a/config/config.sample.php +++ b/config/config.sample.php @@ -185,9 +185,6 @@ $CONFIG = array( (watch out, this option can increase the size of your log file)*/ "log_query" => false, -/* Enable or disable the logging of IP addresses in case of webform auth failures */ -"log_authfailip" => false, - /* Whether ownCloud should log the last successfull cron exec */ "cron_log" => true, diff --git a/lib/base.php b/lib/base.php index 85049bb69c6..ed0830c1f72 100644 --- a/lib/base.php +++ b/lib/base.php @@ -842,13 +842,6 @@ class OC { } // logon via web form elseif (OC::tryFormLogin()) { $error[] = 'invalidpassword'; - if ( OC_Config::getValue('log_authfailip', false) ) { - OC_Log::write('core', 'Login failed: user \''.$_POST["user"].'\' , wrong password, IP:'.$_SERVER['REMOTE_ADDR'], - OC_Log::WARN); - } else { - OC_Log::write('core', 'Login failed: user \''.$_POST["user"].'\' , wrong password, IP:set log_authfailip=true in conf', - OC_Log::WARN); - } } OC_Util::displayLoginPage(array_unique($error)); diff --git a/lib/private/user/manager.php b/lib/private/user/manager.php index d4d91163003..a897545e550 100644 --- a/lib/private/user/manager.php +++ b/lib/private/user/manager.php @@ -164,6 +164,8 @@ class Manager extends PublicEmitter implements IUserManager { } } } + + \OC::$server->getLogger()->warning('Login failed: \''. $loginname .'\' (Remote IP: \''. $_SERVER['REMOTE_ADDR'] .'\', X-Forwarded-For: \''. $_SERVER['HTTP_X_FORWARDED_FOR'] .'\')', array('app' => 'core')); return false; } |