From roundcube@gmail.com Tue Jul 15 10:06:58 2008 From: Thomas Bruederli To: dev@lists.roundcube.net Subject: Re: [RCD] Ticket #1484984 (bugs closed): Installer should save configs. Date: Tue, 15 Jul 2008 19:06:49 +0200 Message-ID: <793f54f40807151006x5c5f0d64ufaddc344f3d65b30@mail.gmail.com> In-Reply-To: <48070114.1040308@introweb.nl> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6031171804946325482==" --===============6031171804946325482== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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 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 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- installer/config.php (revision 1321) > +++ installer/config.php (working copy) > @@ -28,10 +28,10 @@ > > $textbox =3D new html_textarea(array('rows' =3D> 16, 'cols' =3D> 60, 'cla= ss' =3D> "configfile")); > > - echo '
main.inc.php
'; > + echo '
main.inc.php (downl= oad)
'; > 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. > Index: installer/rcube_install.php > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- installer/rcube_install.php (revision 1321) > +++ installer/rcube_install.php (working copy) > @@ -173,9 +173,21 @@ > "'\\1 =3D ' . var_export(\$value, true) . ';'", > $out); > } > - > + > + $_SESSION[$which.'.inc.php'] =3D $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.p= hp'] : $this->create_config($which)); > + } > > > /** > Index: installer/index.php > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- installer/index.php (revision 1321) > +++ installer/index.php (working copy) > @@ -23,6 +23,16 @@ > include_once $filename. '.php'; > } > > +$RCI =3D rcube_install::get_instance(); > +$RCI->load_config(); > + > +if (!empty($_GET['_getfile']) && preg_match('/^(main|db)$/', $_GET['_getfi= le'])) { > + header('Content-type: text/plain'); > + header('Content-Disposition: attachment; filename=3D"'.$_GET['_getf= ile'].'.inc.php'); > + echo $RCI->get_config($_GET['_getfile']); > + exit; > +} > + > ?> > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> > @@ -50,9 +60,6 @@ > > > - $RCI =3D 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/ --===============6031171804946325482==--