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