AC_4897, AC_4898, AC_4899: Multifile uploader fixes.
[acontent.git] / install / upgrade.php
1 <?php
2 /************************************************************************/
3 /* AContent                                                             */
4 /************************************************************************/
5 /* Copyright (c) 2010                                                   */
6 /* Inclusive Design Institute                                           */
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
13 define('TR_INCLUDE_PATH', '../include/');
14
15 if (isset($_POST['new_version'])) {
16         $new_version = $_POST['new_version'];
17 }
18
19 if (isset($_POST['step'])) {
20         $step = intval($_POST['step']);
21 }
22
23 if (!isset($step) || ($step == 0)) {
24         $step = 1;
25 }
26
27 require('include/common.inc.php');
28
29 if (($step == 2) && isset($_POST['override']) && ($_POST['override'] == 0)) {
30         header('Location: index.php');
31         exit;
32 }
33 session_start();
34 require('include/upgrade_header.php');
35 if ($step == 1) {
36         if (!$new_version) {
37                 echo 'You cannot access this page directly. <a href="index.php">Upgrade from here</a> using the <em>Upgrade</em> button.';
38                 require('include/footer.php');
39                 exit;
40         }
41         // in:  select directory
42         // out: confirm verions
43         require('include/ustep1.php');
44 }
45 if ($step == 2) {
46         // in:  update database
47         // out: -
48         require('include/ustep2.php');
49 }
50 if ($step == 3) {
51         // in:  display version specific notices
52         // out: update database with new options
53         require('include/ustep3.php');
54 }
55 if ($step == 4) {
56         // in:  determine where the old content dir is and if it has to be copied
57         // out: try to create the directory and set permissions
58         require('include/step4.php');
59 }
60 if ($step == 5) {
61         // in:  copy the content if needed
62         // out: -
63         require('include/ustep4.php');
64 }
65 if ($step == 6) {
66         // in:  copy the config file
67         // out: -
68         require('include/ustep5.php');
69 }
70 /* anonymous data collection */
71 if ($step == 7) {       
72         require('include/step6.php');
73 }
74 if ($step == 8) {
75         require('include/ustep6.php');
76 }
77 require('include/footer.inc.php');
78 ?>