tagging as ATutor 1.5.4-release
[atutor.git] / install / upgrade.php
1 <?php
2 /************************************************************************/
3 /* ATutor                                                                                                                               */
4 /************************************************************************/
5 /* Copyright (c) 2002-2006 by Greg Gay, Joel Kronenberg, Heidi Hazelton */
6 /* http://atutor.ca                                                                                                             */
7 /*                                                                                                                                              */
8 /* This program is free software. You can redistribute it and/or                */
9 /* modify it under the terms of the GNU General Public License                  */
10 /* as published by the Free Software Foundation.                                                */
11 /************************************************************************/
12 // $Id$
13
14 define('AT_INCLUDE_PATH', '../include/');
15
16 if (isset($_POST['new_version'])) {
17         $new_version = $_POST['new_version'];
18 }
19
20 if (isset($_POST['step'])) {
21         $step = intval($_POST['step']);
22 }
23
24 if (!isset($step) || ($step == 0)) {
25         $step = 1;
26 }
27
28 require('include/common.inc.php');
29
30 if (($step == 2) && isset($_POST['override']) && ($_POST['override'] == 0)) {
31         header('Location: index.php');
32         exit;
33 }
34
35 require('include/upgrade_header.php');
36
37 if ($step == 1) {
38         // in:  select directory
39         // out: confirm verions
40         require('include/ustep1.php');
41 }
42 if ($step == 2) {
43         // in:  update database
44         // out: -
45         require('include/ustep2.php');
46 }
47 if ($step == 3) {
48         // in:  display version specific notices
49         // out: update database with new options
50         require('include/ustep3.php');
51 }
52 if ($step == 4) {
53         // in:  determine where the old content dir is and if it has to be copied
54         // out: try to create the directory and set permissions
55         require('include/step5.php');
56 }
57 if ($step == 5) {
58         // in:  copy the content if needed
59         // out: -
60         require('include/ustep4.php');
61 }
62 if ($step == 6) {
63         // in:  copy the config file
64         // out: -
65         require('include/ustep5.php');
66 }
67 /* anonymous data collection */
68 if ($step == 7) {       
69         require('include/step7.php');
70 }
71
72 if ($step == 8) {
73         require('include/ustep6.php');
74 }
75
76 require('include/footer.php');
77 ?>