From c060677d209ad3eef97dd6711ddfd5cc7ff9f2f4 Mon Sep 17 00:00:00 2001 From: svncommit Date: Thu, 12 Jun 2008 07:32:04 +0000 Subject: Enable direct download of (main|db).inc.php from the installer. --- installer/config.php | 8 ++++---- installer/index.php | 15 ++++++++++++--- 2 files changed, 16 insertions(+), 7 deletions(-) (limited to 'installer') diff --git a/installer/config.php b/installer/config.php index c257f8131..26262db31 100644 --- a/installer/config.php +++ b/installer/config.php @@ -22,16 +22,16 @@ $_SESSION['allowinstaller'] = true; if (!empty($_POST['submit'])) { - echo '

Copy the following configurations and save them in two files (names above the text box)'; - echo ' within the config/ directory of your RoundCube installation.
'; + echo '

Copy or download the following configurations and save them in two files'; + echo ' (names above the text box) within the config/ directory of your RoundCube installation.
'; echo ' Make sure that there are no characters outside the <?php ?> brackets when saving the files.

'; $textbox = new html_textarea(array('rows' => 16, 'cols' => 60, 'class' => "configfile")); - echo '
main.inc.php
'; + echo '
main.inc.php (download)
'; echo $textbox->show($RCI->create_config('main')); - echo '
db.inc.php
'; + echo '
db.inc.php (download)
'; echo $textbox->show($RCI->create_config('db')); echo '

Of course there are more options to configure. diff --git a/installer/index.php b/installer/index.php index 4bd37f3ca..4d0e6c448 100644 --- a/installer/index.php +++ b/installer/index.php @@ -25,6 +25,18 @@ function __autoload($classname) ); include_once $filename. '.php'; } + +$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; +} + ?> @@ -52,9 +64,6 @@ function __autoload($classname) load_config(); - // exit if installation is complete if ($RCI->configured && !$RCI->getprop('enable_installer') && !$_SESSION['allowinstaller']) { // header("HTTP/1.0 404 Not Found"); -- cgit v1.2.3