]> git.donarmstrong.com Git - roundcube.git/blob - installer/index.php
Merge commit 'debian/0.2_alpha-1' into experimental
[roundcube.git] / installer / index.php
1 <?php
2 ini_set('error_reporting', E_ALL&~E_NOTICE);
3 ini_set('display_errors', 1);
4
5 define('INSTALL_PATH', realpath(dirname(__FILE__) . '/../').'/');
6 $include_path  = INSTALL_PATH . 'program/lib' . PATH_SEPARATOR;
7 $include_path .= INSTALL_PATH . 'program' . PATH_SEPARATOR;
8 $include_path .= INSTALL_PATH . 'program/include' . PATH_SEPARATOR;
9 $include_path .= ini_get('include_path');
10
11 set_include_path($include_path);
12
13 session_start();
14
15 /**
16  * Use PHP5 autoload for dynamic class loading
17  * (copy from program/incllude/iniset.php)
18  */
19 function __autoload($classname)
20 {
21   $filename = preg_replace(
22       array('/MDB2_(.+)/', '/Mail_(.+)/', '/^html_.+/', '/^utf8$/'),
23       array('MDB2/\\1', 'Mail/\\1', 'html', 'utf8.class'),
24       $classname
25   );
26   include_once $filename. '.php';
27 }
28 ?>
29 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
30         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
31 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
32 <head>
33 <title>RoundCube Webmail Installer</title>
34 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
35 <link rel="stylesheet" type="text/css" href="styles.css" />
36 <script type="text/javascript" src="client.js"></script>
37 </head>
38
39 <body>
40
41 <div id="banner">
42   <div id="header">
43     <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>
44     <div class="banner-right"><img src="images/banner_right.gif" width="10" height="56" alt="" /></div>
45   </div>
46   <div id="topnav">
47     <a href="http://trac.roundcube.net/wiki/Howto_Install">How-to Wiki</a>
48   </div>
49  </div>
50
51 <div id="content">
52
53 <?php
54
55   $RCI = rcube_install::get_instance();
56   $RCI->load_config();
57
58   // exit if installation is complete
59   if ($RCI->configured && !$RCI->getprop('enable_installer') && !$_SESSION['allowinstaller']) {
60     // header("HTTP/1.0 404 Not Found");
61     echo '<h2 class="error">The installer is disabled!</h2>';
62     echo '<p>To enable it again, set <tt>$rcmail_config[\'enable_installer\'] = true;</tt> in config/main.inc.php</p>';
63     echo '</div></body></html>';
64     exit;
65   }
66   
67 ?>
68
69 <h1>RoundCube Webmail Installer</h1>
70
71 <ol id="progress">
72 <?php
73   
74   foreach (array('Check environment', 'Create config', 'Test config') as $i => $item) {
75     $j = $i + 1;
76     $link = ($RCI->step >= $j || $RCI->configured) ? '<a href="./index.php?_step='.$j.'">' . Q($item) . '</a>' : Q($item);
77     printf('<li class="step%d%s">%s</li>', $j+1, $RCI->step > $j ? ' passed' : ($RCI->step == $j ? ' current' : ''), $link);
78   }
79 ?>
80 </ol>
81
82 <?php
83 $include_steps = array('welcome.html', 'check.php', 'config.php', 'test.php');
84
85 if ($include_steps[$RCI->step]) {
86   include $include_steps[$RCI->step];
87 }
88 else {
89   header("HTTP/1.0 404 Not Found");
90   echo '<h2 class="error">Invalid step</h2>';
91 }
92
93 ?>
94 </div>
95
96 <div id="footer">
97   Installer by the RoundCube Dev Team. Copyright &copy; 2008 - Published under the GNU Public License;&nbsp;
98   Icons by <a href="http://famfamfam.com">famfamfam</a>
99 </div>
100 </body>
101 </html>