0
|
1 |
<?php
|
|
2 |
/*
|
|
3 |
* Decir
|
|
4 |
* Version 0.1
|
|
5 |
* Copyright (C) 2007 Dan Fuhry
|
|
6 |
* install.php - Database installation wizard
|
|
7 |
*
|
|
8 |
* This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
|
|
9 |
* as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
|
|
10 |
*
|
|
11 |
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
|
|
12 |
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.
|
|
13 |
*/
|
|
14 |
|
|
15 |
require('common.php');
|
|
16 |
|
|
17 |
if ( $session->auth_level < USER_LEVEL_ADMIN )
|
|
18 |
{
|
|
19 |
header('Location: ' . makeUrlComplete('Special', 'Login/' . $paths->page, 'level=9', true));
|
|
20 |
exit;
|
|
21 |
}
|
|
22 |
|
|
23 |
if ( $v = getConfig('decir_version') )
|
|
24 |
{
|
|
25 |
$mode = 'upgrade';
|
|
26 |
$upg_ver = $v;
|
|
27 |
}
|
|
28 |
else
|
|
29 |
{
|
|
30 |
$mode = 'install';
|
|
31 |
}
|
|
32 |
|
|
33 |
$page = ( isset($_POST['step']) && in_array($_POST['step'], array('welcome', 'install', 'finish')) ) ? $_POST['step'] : 'welcome';
|
|
34 |
|
|
35 |
$template->header();
|
|
36 |
|
|
37 |
switch($page)
|
|
38 |
{
|
|
39 |
case 'welcome':
|
|
40 |
?>
|
|
41 |
<h3>Welcome to Decir, the Enano bulletin board suite.</h3>
|
|
42 |
<p>Before you can use your forum, we'll need to run a few database queries to get the forum set up.</p>
|
|
43 |
<form action="<?php echo makeUrl($paths->page); ?>" method="post">
|
|
44 |
<input type="hidden" name="step" value="install" />
|
|
45 |
<input type="submit" value="Continue" style="display: block; margin: 0 auto;" />
|
|
46 |
</form>
|
|
47 |
<?php
|
|
48 |
break;
|
|
49 |
case 'install':
|
|
50 |
setConfig('decir_version', ENANO_DECIR_VERSION);
|
|
51 |
?>
|
|
52 |
<form action="<?php echo makeUrl($paths->page); ?>" method="post">
|
|
53 |
<input type="hidden" name="step" value="finish" />
|
|
54 |
<input type="submit" name="do_install_finish" value="Next >" style="display: block; margin: 0 auto;" />
|
|
55 |
</form>
|
|
56 |
<?php
|
|
57 |
break;
|
|
58 |
}
|
|
59 |
|
|
60 |
$template->footer();
|
|
61 |
|