2 /************************************************************************/
4 /************************************************************************/
5 /* Copyright (c) 2002-2010 */
7 /* This program is free software. You can redistribute it and/or */
8 /* modify it under the terms of the GNU General Public License */
9 /* as published by the Free Software Foundation. */
10 /************************************************************************/
13 // AT_INCLUDE_PATH is the relative path to atutor root include directory
14 // rather than the install include directory because this path is required
15 // by Module.class.php used in ustep3.php.
16 define('AT_INCLUDE_PATH', '../include/');
18 if (isset($_POST['new_version'])) {
19 $new_version = $_POST['new_version'];
22 if (isset($_POST['step'])) {
23 $step = intval($_POST['step']);
26 if (!isset($step) || ($step == 0)) {
30 // Be careful at modifying AT_UPGRADE_INCLUDE_PATH constant which is used by
31 // get_atutor_installation_path() @ common.inc.php in ustep3.php. Must make sure the
32 // function doesn't get broken at modifying this constant.
33 define('AT_UPGRADE_INCLUDE_PATH', 'include/');
34 require(AT_UPGRADE_INCLUDE_PATH.'common.inc.php');
36 if (($step == 2) && isset($_POST['override']) && ($_POST['override'] == 0)) {
37 header('Location: index.php');
41 require('include/upgrade_header.php');
45 echo 'You cannot access this page directly. <a href="index.php">Upgrade from here</a> using the <em>Upgrade</em> button.';
46 require('include/footer.php');
49 // in: select directory
50 // out: confirm verions
51 require('include/ustep1.php');
54 // in: update database
56 require('include/ustep2.php');
60 // out: convert database from <encoding> to UTF-8
61 require('include/ustep7.php');
64 // in: display version specific notices
65 // out: update database with new options
66 require('include/ustep3.php');
69 // in: determine where the old content dir is and if it has to be copied
70 // out: try to create the directory and set permissions
71 require('include/step5.php');
74 // in: copy the content if needed
76 require('include/ustep4.php');
79 // in: copy the config file
81 require('include/ustep5.php');
83 /* anonymous data collection */
85 require('include/step7.php');
89 require('include/ustep6.php');
91 require('include/footer.php');