This repository has been archived by the owner on Mar 21, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
update.php
197 lines (163 loc) · 5.12 KB
/
update.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
<?php
/**
This is a necessary system file. Do not modify this page unless you are highly
knowledgeable as to the structure of the system. Modification of this file may
cause the system to no longer function.
Author: David VanScott [ [email protected] ]
File: update.php
Purpose: New update system that will dynamically pull the right update file based
on what version of the system is in use
System Version: 2.6.9
Last Modified: 2009-06-15 0623 EST
**/
/* define the step var */
if (isset($_GET['step']) && is_numeric($_GET['step']))
{
$step = $_GET['step'];
}
else
{
$step = 1;
}
if (isset($_GET['version']) && is_numeric($_GET['version']))
{
$urlVersion = $_GET['version'];
}
else
{
$urlVersion = FALSE;
}
/* array for controlling trailing zeroes */
$versionArray = array(
0 => 20,
1 => 21,
2 => 22,
3 => 23,
4 => 24,
5 => 25,
6 => 26
);
/* array with all the possible versions */
$versionsArray = array(
230,
231,
240,
241,
242,
243,
244,
250,
251,
2511,
252,
253,
254,
255,
256,
260,
261,
262,
263,
264,
265,
266,
267,
268
);
/* count the number of items in the versions array */
$versionsCount = count($versionsArray);
/* make sure the version is formatted right */
if (in_array($urlVersion, $versionArray))
{
$urlVersion = $urlVersion . 0;
}
/* destroy the session if it exists */
session_unset();
/* pull in the globals files */
require_once('framework/functionsGlobal.php');
include_once('framework/functionsUtility.php');
switch($step)
{
case 2:
/* if there's not version specified in the URL, try to find out what version it is */
if( $urlVersion === FALSE ) {
$getUpdateVersion = "SELECT sysVersion FROM sms_system WHERE sysid = 1 LIMIT 1";
$getUpdateVersionResult = mysql_query( $getUpdateVersion );
$updateVersion = mysql_fetch_array( $getUpdateVersionResult );
/* make sure the periods have been removed */
$urlVersion = str_replace(".", "", $updateVersion[0]);
}
if ($urlVersion == 2441)
{
$urlVersion = 244;
}
/** PULL IN THE UPDATE FILE **/
foreach ($versionsArray as $key1 => $value1)
{
/* if we're at the right point in the array, start the update code */
if ($urlVersion == $value1)
{
/* duplicate the versions array */
$versionsArrayNew = $versionsArray;
/* slice the array so it only includes the files that need to be used */
$versionsArrayNew = array_slice($versionsArray, $key1);
/* loop through the new array and pull in the update files */
foreach ($versionsArrayNew as $key2 => $value2)
{
/* pull in the update files sequentially */
include_once( "update/" . $value2 . ".php" );
}
}
}
/** UPDATE THE VERSION IN THE DATABASE **/
$updateVersion = "UPDATE sms_system SET sysVersion = '2.6.9', sysBaseVersion = '2.6', ";
$updateVersion.= "sysIncrementVersion = '.9', sysLaunchStatus = 'n' WHERE sysid = 1 LIMIT 1";
$updateVersionResult = mysql_query( $updateVersion );
break;
case 3:
/** PULL IN THE UPDATE FILE **/
require_once("update/starbase.php");
break;
}
?>
<html>
<head>
<title>SMS 2.6 :: Update</title>
<link rel="stylesheet" href="update/update.css" type="text/css" />
</head>
<body>
<div id="install">
<div class="header">
<img src="update/update.jpg" alt="" border="0" />
</div> <!-- close .header -->
<div class="content">
<? if( $step == "1" ) { ?>
SMS 2.6.9 is an update to latest release of SMS which updates the system with the following changes:
<ul>
<li>Fixed typos in docking request email sent out to the starbase CO</li>
<li>Fixed bug with docked ship activation and rejection where the docking CO wouldn’t be sent a copy of the acceptance or rejection email</li>
<li>Fixed location of the Facebox loading graphic</li>
<li>Fixed bug in database management page where only entries with a display flag of yes would be shown instead of all entries</li>
<li>Fixed bug in database display page where departments with database use turned off still appeared</li>
<li>Updated the version check class with the following changes:
<ul>
<li>SMS now understands that version 3.0 is actually Nova 1.0</li>
<li>Updated the download link to go straight to the Anodyne site instead of the SMS download page (done because the Anodyne site has been re-built from the ground up and the old URLs won't work</li>
<li>Updated the XML file to version_sms.xml so that SMS and Nova can use separate version files</li>
</ul>
</li>
</ul>
<h1><a href="update.php?step=2&version=<?=$urlVersion;?>">Next Step »</a></h1>
<? } elseif( $step == "2" ) { ?>
The changes have been made to your system. If you still experience problems with any of the issues that have been fixed, please report them on the Anodyne Support Forum.
<h1>
<a href="<?=$webLocation;?>index.php?page=main">Return to your site »</a>
</h1>
<? } ?>
</div>
<div class="footer">
Copyright © <?php echo date('Y'); ?> by <a href="http://www.anodyne-productions.com/" target="_blank">Anodyne Productions</a>
</div> <!-- close .footer -->
</div> <!-- close #install -->
</body>
</html>