From bf2f39ea6d2b49c7495a43cca19ab18f27f8292e Mon Sep 17 00:00:00 2001 From: alecpl <alec@alec.pl> Date: Mon, 29 Sep 2008 09:02:02 -0400 Subject: [PATCH] - #1485290: Fix unread counter when displaying cached massage in preview panel - remove some empty lines in app.js --- installer/index.php | 22 +++++++++++++++------- 1 files changed, 15 insertions(+), 7 deletions(-) diff --git a/installer/index.php b/installer/index.php index 4d0e6c4..d14e6ff 100644 --- a/installer/index.php +++ b/installer/index.php @@ -3,6 +3,8 @@ ini_set('display_errors', 1); define('INSTALL_PATH', realpath(dirname(__FILE__) . '/../').'/'); +define('RCMAIL_CONFIG_DIR', INSTALL_PATH . 'config'); + $include_path = INSTALL_PATH . 'program/lib' . PATH_SEPARATOR; $include_path .= INSTALL_PATH . 'program' . PATH_SEPARATOR; $include_path .= INSTALL_PATH . 'program/include' . PATH_SEPARATOR; @@ -29,12 +31,18 @@ $RCI = rcube_install::get_instance(); $RCI->load_config(); -if (isset($_GET['_getfile']) && in_array($_GET['_getfile'], array('main', 'db'))) -{ - header('Content-type: text/plain'); - header('Content-Disposition: attachment; filename="'.$_GET['_getfile'].'.inc.php"'); - echo $RCI->create_config($_GET['_getfile']); - exit; +if (isset($_GET['_getfile']) && in_array($_GET['_getfile'], array('main', 'db'))) { + $filename = $_GET['_getfile'] . '.inc.php'; + if (!empty($_SESSION[$filename])) { + header('Content-type: text/plain'); + header('Content-Disposition: attachment; filename="'.$filename.'"'); + echo $_SESSION[$filename]; + exit; + } + else { + header('HTTP/1.0 404 Not found'); + die("The requested configuration was not found. Please run the installer from the beginning."); + } } ?> @@ -68,7 +76,7 @@ if ($RCI->configured && !$RCI->getprop('enable_installer') && !$_SESSION['allowinstaller']) { // header("HTTP/1.0 404 Not Found"); echo '<h2 class="error">The installer is disabled!</h2>'; - echo '<p>To enable it again, set <tt>$rcmail_config[\'enable_installer\'] = true;</tt> in config/main.inc.php</p>'; + echo '<p>To enable it again, set <tt>$rcmail_config[\'enable_installer\'] = true;</tt> in '.RCMAIL_CONFIG_DIR.'/main.inc.php</p>'; echo '</div></body></html>'; exit; } -- Gitblit v1.9.1