Author Topic: Failed login not logged  (Read 2995 times)

Offline framelio

  • Newbie
  • *
  • Posts: 3
Failed login not logged
« on: March 17, 2015, 08:26:47 AM »
Hello,
using RC 1.1.1 with

$config['log_session'] = true;
$config['log_logins'] = true;
$config['debug_level'] = 2;
$config['log_driver'] = 'file';

The unsuccessful logins are not logged in any of the log files while the successfull are.

I've also noticed that in the index.php file (in the root), you call the deprecated function (if it's deprecated) rcmail_log_login() instead of calling

$RCMAIL->log_login();

I've tested a patch and add in the else section (if the login fail) the code:

$RCMAIL->log_login($auth['user'], true, $error_code);

$error_message = $error_labels[$error_code] ? $error_labels[$error_code] : 'loginfailed';
$RCMAIL->log_login($auth['user'], true, $error_code);
$OUTPUT->show_message($error_message, 'warning');


And after this change, the log error message appears as expected.



Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,850
Re: Failed login not logged
« Reply #1 on: March 17, 2015, 08:41:15 AM »
Code: [Select]
$error_message = $error_labels[$error_code] ? $error_labels[$error_code] : 'loginfailed';
there is no code like that in the (soon to be relased) roundcube 1.1.1 or in roundcube 1.1.0 and logging of failed loging was added in roundcube 1.0. Please make sure you are running an upto date index.php file. You should see the version in the comment block at the top of the file.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and moreā€¦

Offline alec

  • Hero Member
  • *****
  • Posts: 1,365
Re: Failed login not logged
« Reply #2 on: March 17, 2015, 08:42:31 AM »
And use debug_level=1 not 2.

Offline framelio

  • Newbie
  • *
  • Posts: 3
Re: Failed login not logged
« Reply #3 on: March 17, 2015, 08:59:38 AM »
Thank you very much guys!
It's indeed right, I had an old version of index.php (probably from 0.8).

With the new index.php everything is ok!