From 7f281207688eb5810fd04aac63d3a618afaa52d6 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Fri, 21 Feb 2014 10:27:35 -0500
Subject: [PATCH] Prevent from "Call to undefined method rcmail_output_json::add_footer()" error

---
 index.php |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/index.php b/index.php
index cc81bb9..e1b654c 100644
--- a/index.php
+++ b/index.php
@@ -207,6 +207,15 @@
         $session_error = true;
     }
 
+    if ($session_error || $_REQUEST['_err'] == 'session') {
+        $OUTPUT->show_message('sessionerror', 'error', null, true, -1);
+    }
+
+    if ($OUTPUT->ajax_call || !empty($_REQUEST['_framed'])) {
+        $OUTPUT->command('session_error', $RCMAIL->url(array('_err' => 'session')));
+        $OUTPUT->send('iframe');
+    }
+
     // check if installer is still active
     if ($RCMAIL->config->get('enable_installer') && is_readable('./installer/index.php')) {
         $OUTPUT->add_footer(html::div(array('style' => "background:#ef9398; border:2px solid #dc5757; padding:0.5em; margin:2em auto; width:50em"),
@@ -216,15 +225,6 @@
                 these files may expose sensitive configuration data like server passwords and encryption keys
                 to the public. Make sure you cannot access the <a href=\"./installer/\">installer script</a> from your browser.")
         ));
-    }
-
-    if ($session_error || $_REQUEST['_err'] == 'session') {
-        $OUTPUT->show_message('sessionerror', 'error', null, true, -1);
-    }
-
-    if ($OUTPUT->ajax_call || !empty($_REQUEST['_framed'])) {
-        $OUTPUT->command('session_error', $RCMAIL->url(array('_err' => 'session')));
-        $OUTPUT->send('iframe');
     }
 
     $plugin = $RCMAIL->plugins->exec_hook('unauthenticated', array('task' => 'login', 'error' => $session_error));

--
Gitblit v1.9.1