commit | author | age
|
8b8bcc
|
1 |
<?php |
T |
2 |
ini_set('error_reporting', E_ALL&~E_NOTICE); |
|
3 |
ini_set('display_errors', 1); |
|
4 |
|
47124c
|
5 |
define('INSTALL_PATH', realpath(dirname(__FILE__) . '/../').'/'); |
bba657
|
6 |
define('RCMAIL_CONFIG_DIR', INSTALL_PATH . 'config'); |
T |
7 |
|
afe50a
|
8 |
$include_path = INSTALL_PATH . 'program/lib' . PATH_SEPARATOR; |
T |
9 |
$include_path .= INSTALL_PATH . 'program' . PATH_SEPARATOR; |
|
10 |
$include_path .= INSTALL_PATH . 'program/include' . PATH_SEPARATOR; |
|
11 |
$include_path .= ini_get('include_path'); |
|
12 |
|
47124c
|
13 |
set_include_path($include_path); |
T |
14 |
|
8b8bcc
|
15 |
session_start(); |
47124c
|
16 |
|
T |
17 |
/** |
|
18 |
* Use PHP5 autoload for dynamic class loading |
|
19 |
* (copy from program/incllude/iniset.php) |
|
20 |
*/ |
|
21 |
function __autoload($classname) |
|
22 |
{ |
|
23 |
$filename = preg_replace( |
|
24 |
array('/MDB2_(.+)/', '/Mail_(.+)/', '/^html_.+/', '/^utf8$/'), |
|
25 |
array('MDB2/\\1', 'Mail/\\1', 'html', 'utf8.class'), |
|
26 |
$classname |
|
27 |
); |
|
28 |
include_once $filename. '.php'; |
|
29 |
} |
c06067
|
30 |
|
S |
31 |
$RCI = rcube_install::get_instance(); |
|
32 |
$RCI->load_config(); |
|
33 |
|
7d7f67
|
34 |
if (isset($_GET['_getfile']) && in_array($_GET['_getfile'], array('main', 'db'))) { |
T |
35 |
$filename = $_GET['_getfile'] . '.inc.php'; |
|
36 |
if (!empty($_SESSION[$filename])) { |
|
37 |
header('Content-type: text/plain'); |
|
38 |
header('Content-Disposition: attachment; filename="'.$filename.'"'); |
|
39 |
echo $_SESSION[$filename]; |
|
40 |
exit; |
|
41 |
} |
|
42 |
else { |
|
43 |
header('HTTP/1.0 404 Not found'); |
|
44 |
die("The requested configuration was not found. Please run the installer from the beginning."); |
|
45 |
} |
c06067
|
46 |
} |
S |
47 |
|
32eb29
|
48 |
if ($RCI->configured && ($RCI->getprop('enable_installer') || $_SESSION['allowinstaller']) && |
T |
49 |
isset($_GET['_mergeconfig']) && in_array($_GET['_mergeconfig'], array('main', 'db'))) { |
e10712
|
50 |
$filename = $_GET['_mergeconfig'] . '.inc.php'; |
T |
51 |
|
|
52 |
header('Content-type: text/plain'); |
|
53 |
header('Content-Disposition: attachment; filename="'.$filename.'"'); |
|
54 |
|
|
55 |
$RCI->merge_config(); |
|
56 |
echo $RCI->create_config($_GET['_mergeconfig'], true); |
|
57 |
exit; |
|
58 |
} |
|
59 |
|
|
60 |
// go to 'test' step if we have a local configuration |
|
61 |
if ($RCI->configured && empty($_REQUEST['_step'])) { |
|
62 |
header("Location: ./?_step=3"); |
|
63 |
exit; |
|
64 |
} |
|
65 |
|
8b8bcc
|
66 |
?> |
354978
|
67 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
T |
68 |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|
69 |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
|
70 |
<head> |
|
71 |
<title>RoundCube Webmail Installer</title> |
|
72 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> |
|
73 |
<link rel="stylesheet" type="text/css" href="styles.css" /> |
c5042d
|
74 |
<script type="text/javascript" src="client.js"></script> |
354978
|
75 |
</head> |
T |
76 |
|
|
77 |
<body> |
|
78 |
|
|
79 |
<div id="banner"> |
|
80 |
<div id="header"> |
|
81 |
<div class="banner-logo"><a href="http://www.roundcube.net"><img src="images/banner_logo.gif" width="200" height="56" border="0" alt="RoundCube Webmal Project" /></a></div> |
|
82 |
<div class="banner-right"><img src="images/banner_right.gif" width="10" height="56" alt="" /></div> |
|
83 |
</div> |
|
84 |
<div id="topnav"> |
|
85 |
<a href="http://trac.roundcube.net/wiki/Howto_Install">How-to Wiki</a> |
|
86 |
</div> |
|
87 |
</div> |
|
88 |
|
|
89 |
<div id="content"> |
|
90 |
|
|
91 |
<?php |
967b34
|
92 |
|
T |
93 |
// exit if installation is complete |
|
94 |
if ($RCI->configured && !$RCI->getprop('enable_installer') && !$_SESSION['allowinstaller']) { |
e01084
|
95 |
// header("HTTP/1.0 404 Not Found"); |
967b34
|
96 |
echo '<h2 class="error">The installer is disabled!</h2>'; |
32eb29
|
97 |
echo '<p>To enable it again, set <tt>$rcmail_config[\'enable_installer\'] = true;</tt> in RCMAIL_CONFIG_DIR/main.inc.php</p>'; |
967b34
|
98 |
echo '</div></body></html>'; |
T |
99 |
exit; |
|
100 |
} |
b3f9df
|
101 |
|
354978
|
102 |
?> |
T |
103 |
|
967b34
|
104 |
<h1>RoundCube Webmail Installer</h1> |
T |
105 |
|
354978
|
106 |
<ol id="progress"> |
T |
107 |
<?php |
|
108 |
|
|
109 |
foreach (array('Check environment', 'Create config', 'Test config') as $i => $item) { |
|
110 |
$j = $i + 1; |
b3f9df
|
111 |
$link = ($RCI->step >= $j || $RCI->configured) ? '<a href="./index.php?_step='.$j.'">' . Q($item) . '</a>' : Q($item); |
354978
|
112 |
printf('<li class="step%d%s">%s</li>', $j+1, $RCI->step > $j ? ' passed' : ($RCI->step == $j ? ' current' : ''), $link); |
T |
113 |
} |
|
114 |
?> |
|
115 |
</ol> |
|
116 |
|
|
117 |
<?php |
|
118 |
$include_steps = array('welcome.html', 'check.php', 'config.php', 'test.php'); |
|
119 |
|
|
120 |
if ($include_steps[$RCI->step]) { |
|
121 |
include $include_steps[$RCI->step]; |
|
122 |
} |
|
123 |
else { |
|
124 |
header("HTTP/1.0 404 Not Found"); |
|
125 |
echo '<h2 class="error">Invalid step</h2>'; |
|
126 |
} |
|
127 |
|
|
128 |
?> |
|
129 |
</div> |
|
130 |
|
|
131 |
<div id="footer"> |
ad43e6
|
132 |
Installer by the RoundCube Dev Team. Copyright © 2008 - Published under the GNU Public License; |
T |
133 |
Icons by <a href="http://famfamfam.com">famfamfam</a> |
354978
|
134 |
</div> |
T |
135 |
</body> |
|
136 |
</html> |