summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsvncommit <devs@roundcube.net>2008-06-06 11:11:30 +0000
committersvncommit <devs@roundcube.net>2008-06-06 11:11:30 +0000
commit5e0045b128b46cd9611d86731803bc3a910cd275 (patch)
tree53b9b9ea501959c4c3bfba496058f99f65528a46
parent70a05665624822dbba5a6417a782709b7067d190 (diff)
Add option to log successful logins.
-rw-r--r--CHANGELOG4
-rw-r--r--config/main.inc.php.dist3
-rw-r--r--index.php7
3 files changed, 14 insertions, 0 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 5250cce04..707797a15 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,10 @@
CHANGELOG RoundCube Webmail
---------------------------
+2008/06/06 (robin)
+----------
+- Add option to log successful logins
+
2008/06/06 (alec)
----------
- TLS support in LDAP connections: 'use_tls' property (#1485104)
diff --git a/config/main.inc.php.dist b/config/main.inc.php.dist
index 5d43c1a7d..e3e223a3a 100644
--- a/config/main.inc.php.dist
+++ b/config/main.inc.php.dist
@@ -341,5 +341,8 @@ $rcmail_config['logout_expunge'] = FALSE;
*/
$rcmail_config['delete_always'] = false;
+// Log successful logins
+// $rcmail_config['log_logins'] = false;
+
// end of config file
?>
diff --git a/index.php b/index.php
index ea62f9aea..9f4d9148a 100644
--- a/index.php
+++ b/index.php
@@ -86,6 +86,13 @@ if ($RCMAIL->action=='login' && $RCMAIL->task=='mail') {
// send auth cookie if necessary
$RCMAIL->authenticate_session();
+ // log successful login
+ if ($RCMAIL->config->get('log_logins') && $RCMAIL->config->get('debug_level') & 1)
+ console(sprintf('Successful login for %s (id %d) from %s',
+ trim(get_input_value('_user', RCUBE_INPUT_POST), ' '),
+ $_SESSION['user_id'],
+ $_SERVER['REMOTE_ADDR']));
+
// send redirect
header("Location: {$RCMAIL->comm_path}");
exit;