From c8a21d646ca96aaf00867b90b582a6572c591ee2 Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Fri, 05 Sep 2008 03:27:23 -0400
Subject: [PATCH] Killed one more global var + log logins to a separate file (not console)
---
index.php | 14 ++++++--------
program/steps/mail/list.inc | 1 -
program/include/main.inc | 2 +-
program/include/rcube_json_output.php | 1 +
program/include/rcube_template.php | 1 +
5 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/index.php b/index.php
index 46c4229..e620183 100644
--- a/index.php
+++ b/index.php
@@ -30,9 +30,6 @@
// include environment
require_once 'program/include/iniset.php';
-// define global vars
-$OUTPUT_TYPE = 'html';
-
// init application and start session with requested task
$RCMAIL = rcmail::get_instance();
@@ -94,11 +91,12 @@
$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']));
+ if ($RCMAIL->config->get('log_logins')) {
+ write_log('userlogins', sprintf('Successful login for %s (id %d) from %s',
+ $RCMAIL->user->get_username(),
+ $RCMAIL->user->ID,
+ $_SERVER['REMOTE_ADDR']));
+ }
// send redirect
$OUTPUT->redirect();
diff --git a/program/include/main.inc b/program/include/main.inc
index 3fad9cb..a6ad93d 100644
--- a/program/include/main.inc
+++ b/program/include/main.inc
@@ -317,7 +317,7 @@
$is_iso_8859_1 = true;
}
if (!$enctype)
- $enctype = $GLOBALS['OUTPUT_TYPE'];
+ $enctype = $OUTPUT->type;
// encode for plaintext
if ($enctype=='text')
diff --git a/program/include/rcube_json_output.php b/program/include/rcube_json_output.php
index fa56329..00b7697 100644
--- a/program/include/rcube_json_output.php
+++ b/program/include/rcube_json_output.php
@@ -34,6 +34,7 @@
private $texts = array();
private $commands = array();
+ public $type = 'js';
public $ajax_call = true;
diff --git a/program/include/rcube_template.php b/program/include/rcube_template.php
index 847ea0d..3fdd817 100755
--- a/program/include/rcube_template.php
+++ b/program/include/rcube_template.php
@@ -39,6 +39,7 @@
var $js_commands = array();
var $object_handlers = array();
+ public $type = 'html';
public $ajax_call = false;
/**
diff --git a/program/steps/mail/list.inc b/program/steps/mail/list.inc
index e09919c..2014371 100644
--- a/program/steps/mail/list.inc
+++ b/program/steps/mail/list.inc
@@ -19,7 +19,6 @@
*/
-$OUTPUT_TYPE = 'js';
// is there a sort type for this request?
if ($sort = get_input_value('_sort', RCUBE_INPUT_GET))
{
--
Gitblit v1.9.1