Move authentication failed logging to checkPassword

Fixes https://github.com/owncloud/core/issues/10366
remotes/origin/fix-10825
Lukas Reschke 11 years ago
parent 93f5e90c9f
commit 5bb4772858
  1. 3
      config/config.sample.php
  2. 7
      lib/base.php
  3. 2
      lib/private/user/manager.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,

@ -856,13 +856,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));

@ -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;
}

Loading…
Cancel
Save