4 +-------------------------------------------------------------------------+
5 | Roundcube Webmail setup tool |
8 | Copyright (C) 2009-2011, The Roundcube Dev Team |
10 | This program is free software; you can redistribute it and/or modify |
11 | it under the terms of the GNU General Public License version 2 |
12 | as published by the Free Software Foundation. |
14 | This program is distributed in the hope that it will be useful, |
15 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
17 | GNU General Public License for more details. |
19 | You should have received a copy of the GNU General Public License along |
20 | with this program; if not, write to the Free Software Foundation, Inc., |
21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
23 +-------------------------------------------------------------------------+
24 | Author: Thomas Bruederli <roundcube@gmail.com> |
25 +-------------------------------------------------------------------------+
31 ini_set('error_reporting', E_ALL&~E_NOTICE);
32 ini_set('display_errors', 1);
34 define('INSTALL_PATH', realpath(dirname(__FILE__) . '/../').'/');
35 define('RCMAIL_CONFIG_DIR', INSTALL_PATH . 'config');
37 $include_path = INSTALL_PATH . 'program/lib' . PATH_SEPARATOR;
38 $include_path .= INSTALL_PATH . 'program' . PATH_SEPARATOR;
39 $include_path .= INSTALL_PATH . 'program/include' . PATH_SEPARATOR;
40 $include_path .= ini_get('include_path');
42 set_include_path($include_path);
44 require_once 'utils.php';
45 require_once 'main.inc';
49 $RCI = rcube_install::get_instance();
52 if (isset($_GET['_getfile']) && in_array($_GET['_getfile'], array('main', 'db'))) {
53 $filename = $_GET['_getfile'] . '.inc.php';
54 if (!empty($_SESSION[$filename])) {
55 header('Content-type: text/plain');
56 header('Content-Disposition: attachment; filename="'.$filename.'"');
57 echo $_SESSION[$filename];
61 header('HTTP/1.0 404 Not found');
62 die("The requested configuration was not found. Please run the installer from the beginning.");
66 if ($RCI->configured && ($RCI->getprop('enable_installer') || $_SESSION['allowinstaller']) &&
67 isset($_GET['_mergeconfig']) && in_array($_GET['_mergeconfig'], array('main', 'db'))) {
68 $filename = $_GET['_mergeconfig'] . '.inc.php';
70 header('Content-type: text/plain');
71 header('Content-Disposition: attachment; filename="'.$filename.'"');
74 echo $RCI->create_config($_GET['_mergeconfig'], true);
78 // go to 'check env' step if we have a local configuration
79 if ($RCI->configured && empty($_REQUEST['_step'])) {
80 header("Location: ./?_step=1");
85 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
86 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
87 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
89 <title>Roundcube Webmail Installer</title>
90 <meta name="Robots" content="noindex,nofollow" />
91 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
92 <link rel="stylesheet" type="text/css" href="styles.css" />
93 <script type="text/javascript" src="client.js"></script>
99 <div class="banner-bg"></div>
100 <div class="banner-logo"><a href="http://roundcube.net"><img src="images/rcube_logo.gif" width="210" height="55" border="0" alt="Roundcube - Open source webmail project" /></a></div>
104 <a href="http://trac.roundcube.net/wiki/Howto_Install">How-to Wiki</a>
111 // exit if installation is complete
112 if ($RCI->configured && !$RCI->getprop('enable_installer') && !$_SESSION['allowinstaller']) {
113 // header("HTTP/1.0 404 Not Found");
114 echo '<h2 class="error">The installer is disabled!</h2>';
115 echo '<p>To enable it again, set <tt>$rcmail_config[\'enable_installer\'] = true;</tt> in RCMAIL_CONFIG_DIR/main.inc.php</p>';
116 echo '</div></body></html>';
122 <h1>Roundcube Webmail Installer</h1>
127 foreach (array('Check environment', 'Create config', 'Test config') as $i => $item) {
129 $link = ($RCI->step >= $j || $RCI->configured) ? '<a href="./index.php?_step='.$j.'">' . Q($item) . '</a>' : Q($item);
130 printf('<li class="step%d%s">%s</li>', $j+1, $RCI->step > $j ? ' passed' : ($RCI->step == $j ? ' current' : ''), $link);
136 $include_steps = array('./welcome.html', './check.php', './config.php', './test.php');
138 if ($include_steps[$RCI->step]) {
139 include $include_steps[$RCI->step];
142 header("HTTP/1.0 404 Not Found");
143 echo '<h2 class="error">Invalid step</h2>';
150 Installer by the Roundcube Dev Team. Copyright © 2008-2011 - Published under the GNU Public License;
151 Icons by <a href="http://famfamfam.com">famfamfam</a>