mirror of
https://github.com/roundcube/roundcubemail.git
synced 2026-03-06 00:04:01 +01:00
Enable direct download of (main|db).inc.php from the installer.
This commit is contained in:
@@ -22,16 +22,16 @@ $_SESSION['allowinstaller'] = true;
|
||||
|
||||
if (!empty($_POST['submit'])) {
|
||||
|
||||
echo '<p class="notice">Copy the following configurations and save them in two files (names above the text box)';
|
||||
echo ' within the <tt>config/</tt> directory of your RoundCube installation.<br/>';
|
||||
echo '<p class="notice">Copy or download the following configurations and save them in two files';
|
||||
echo ' (names above the text box) within the <tt>config/</tt> directory of your RoundCube installation.<br/>';
|
||||
echo ' Make sure that there are no characters outside the <tt><?php ?></tt> brackets when saving the files.</p>';
|
||||
|
||||
$textbox = new html_textarea(array('rows' => 16, 'cols' => 60, 'class' => "configfile"));
|
||||
|
||||
echo '<div><em>main.inc.php</em></div>';
|
||||
echo '<div><em>main.inc.php (<a href="index.php?_getfile=main">download</a>)</em></div>';
|
||||
echo $textbox->show($RCI->create_config('main'));
|
||||
|
||||
echo '<div style="margin-top:1em"><em>db.inc.php</em></div>';
|
||||
echo '<div style="margin-top:1em"><em>db.inc.php (<a href="index.php?_getfile=db">download</a>)</em></div>';
|
||||
echo $textbox->show($RCI->create_config('db'));
|
||||
|
||||
echo '<p class="hint">Of course there are more options to configure.
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
@@ -52,9 +64,6 @@ function __autoload($classname)
|
||||
|
||||
<?php
|
||||
|
||||
$RCI = rcube_install::get_instance();
|
||||
$RCI->load_config();
|
||||
|
||||
// exit if installation is complete
|
||||
if ($RCI->configured && !$RCI->getprop('enable_installer') && !$_SESSION['allowinstaller']) {
|
||||
// header("HTTP/1.0 404 Not Found");
|
||||
|
||||
Reference in New Issue
Block a user