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