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