Thomas,
Can we not add a download-option to the installer, for main.inc.php and db.inc.php?
Something like attached patch (except that it doesn't really work right now because of output already sent).
Robin
--- 8< --- detachments --- 8< --- The following attachments have been detached and are available for viewing. http://detached.gigo.com/rc/rW/sN59DQSJ/_11484984-20080415.patch Only click these links if you trust the sender, as well as this message. --- 8< --- detachments --- 8< ---
List info: http://lists.roundcube.net/dev/
On Tue, Apr 15, 2008 at 11:42 AM, Robin Elfrink elfrink@introweb.nl wrote:
Thomas,
Can we not add a download-option to the installer, for main.inc.php and db.inc.php?
Something like attached patch (except that it doesn't really work right now because of output already sent).
Robin
Good idea, make it a separate file to call (download-files.php in installer) and make sure that you only let it download $_GET['file'] when it's escaped etc.. So people don't end up downloading the real configs etc.. ;-) "../inc/db.inc.php".
Till _______________________________________________ List info: http://lists.roundcube.net/dev/
Robin Elfrink wrote:
Thomas,
Can we not add a download-option to the installer, for main.inc.php and db.inc.php?
Actually a good idea. The config is built out of the POST vars from the installer form. We need to temporarily save this data in order to correctly build the config files when downloading them.
This needs some more code but your patch is good to start with.
~Thomas _______________________________________________ List info: http://lists.roundcube.net/dev/
Thomas Bruederli wrote:
Can we not add a download-option to the installer, for main.inc.php and db.inc.php?
Actually a good idea. The config is built out of the POST vars from the installer form. We need to temporarily save this data in order to correctly build the config files when downloading them.
This needs some more code but your patch is good to start with.
How's this (attached)? Works for me.
Robin
--- 8< --- detachments --- 8< --- The following attachments have been detached and are available for viewing. http://detached.gigo.com/rc/EC/N3SrT7Yd/_1484984.20080417094.patch Only click these links if you trust the sender, as well as this message. --- 8< --- detachments --- 8< ---
List info: http://lists.roundcube.net/dev/
Hi Robin
Sorry for not answering your mail. I think storing the config in the session is the easiest way. Go ahead and commit your path to the trunk.
~Thomas
On Thu, Apr 17, 2008 at 09:49, Robin Elfrink elfrink@introweb.nl wrote:
Thomas Bruederli wrote:
Can we not add a download-option to the installer, for main.inc.php and db.inc.php?
Actually a good idea. The config is built out of the POST vars from the installer form. We need to temporarily save this data in order to correctly build the config files when downloading them.
This needs some more code but your patch is good to start with.
How's this (attached)? Works for me.
Robin
Index: installer/config.php
--- installer/config.php (revision 1321) +++ installer/config.php (working copy) @@ -28,10 +28,10 @@
$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.
Index: installer/rcube_install.php
--- installer/rcube_install.php (revision 1321) +++ installer/rcube_install.php (working copy) @@ -173,9 +173,21 @@ "'\1 = ' . var_export($value, true) . ';'", $out); }
$_SESSION[$which.'.inc.php'] = $out; return trim($out); }
/**
- Get config as created in create_config()
- @return string The complete config file content
*/
function get_config($which)
{
return (isset($_SESSION[$which.'.inc.php']) ? $_SESSION[$which.'.inc.php'] : $this->create_config($which));
}
/**
Index: installer/index.php
--- installer/index.php (revision 1321) +++ installer/index.php (working copy) @@ -23,6 +23,16 @@ include_once $filename. '.php'; }
+$RCI = rcube_install::get_instance(); +$RCI->load_config();
+if (!empty($_GET['_getfile']) && preg_match('/^(main|db)$/', $_GET['_getfile'])) {
header('Content-type: text/plain');
header('Content-Disposition: attachment; filename="'.$_GET['_getfile'].'.inc.php');
echo $RCI->get_config($_GET['_getfile']);
exit;
+}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@@ -50,9 +60,6 @@
<?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");
List info: http://lists.roundcube.net/dev/
Thomas Bruederli wrote:
Sorry for not answering your mail. I think storing the config in the session is the easiest way. Go ahead and commit your path to the trunk.
Already did in r1511 :)
Robin _______________________________________________ List info: http://lists.roundcube.net/dev/