r1389: Forgot to add the template diff
[bugdar.git] / install / upgrade.php
1 <?php
2 /*=====================================================================*\
3 || ###################################################################
4 || # Bugdar [#]version[#]
5 || # Copyright ©2002-[#]year[#] Blue Static
6 || #
7 || # This program is free software; you can redistribute it and/or modify
8 || # it under the terms of the GNU General Public License as published by
9 || # the Free Software Foundation; version [#]gpl[#] of the License.
10 || #
11 || # This program is distributed in the hope that it will be useful, but
12 || # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 || # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 || # more details.
15 || #
16 || # You should have received a copy of the GNU General Public License along
17 || # with this program; if not, write to the Free Software Foundation, Inc.,
18 || # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
19 || ###################################################################
20 \*=====================================================================*/
21
22 require_once('./global.php');
23
24 // ###################################################################
25
26 if (!isset($bugsys->in['next']))
27 {
28 $db->showerrors = false;
29
30 $version = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "setting WHERE varname = 'trackerversion'");
31 $version = $version['value'];
32
33 if (!$version)
34 {
35 die('You have done something to your database and this script cannot determine Edoc\'s version... or you have no upgrade to perform...');
36 }
37
38 if ($bugsys->versions["$version"] == -1)
39 {
40 page_start();
41
42 echo "<h1>Bugdar Upgrade System</h1>\n\n";
43
44 echo "<p>Your Bugdar installation is up-to-date!</p>\n\n";
45
46 page_end(false);
47 }
48 else
49 {
50 header("Location: upgrade.php?next=$version");
51 }
52
53 $db->showerrors = true;
54 }
55
56 // ###################################################################
57
58 else
59 {
60 if ($bugsys->versions[ $bugsys->in['next'] ] == -1)
61 {
62 die('Bugdar is up-to-date already');
63 }
64
65 header("Location: upgrade" . $bugsys->versions[ $bugsys->in['next'] ] . ".php");
66 }
67
68 /*=====================================================================*\
69 || ###################################################################
70 || # $HeadURL$
71 || # $Id$
72 || ###################################################################
73 \*=====================================================================*/
74 ?>