r2072 + more changes to make compact URLs work
[racktables] / upgrade.php
1 <?php
2
3 // At the moment we assume, that for any two releases we can
4 // sequentally execute all batches, that separate them, and
5 // nothing will break. If this changes one day, the function
6 // below will have to generate smarter upgrade paths, while
7 // the upper layer will remain the same.
8 // Returning an empty array means that no upgrade is necessary.
9 function getDBUpgradePath ($v1, $v2)
10 {
11 $versionhistory = array
12 (
13 '0.14.4',
14 '0.14.5',
15 '0.14.6',
16 '0.14.7',
17 '0.14.8',
18 '0.14.9',
19 '0.14.10',
20 '0.14.11',
21 '0.14.12',
22 '0.15.0',
23 '0.15.1',
24 '0.16.0',
25 '0.16.1',
26 );
27 if (!in_array ($v1, $versionhistory) || !in_array ($v2, $versionhistory))
28 {
29 showError ("An upgrade path has been requested for versions '${v1}' and '${v2}', " .
30 "and at least one of those isn't known to me.");
31 die;
32 }
33 $skip = TRUE;
34 $path = array();
35 // Now collect all versions > $v1 and <= $v2
36 foreach ($versionhistory as $v)
37 {
38 if ($v == $v1)
39 {
40 $skip = FALSE;
41 continue;
42 }
43 if ($skip)
44 continue;
45 $path[] = $v;
46 if ($v == $v2)
47 break;
48 }
49 return $path;
50 }
51
52 function printReleaseNotes ($batchid)
53 {
54 switch ($batchid)
55 {
56 case '0.16.0':
57 echo "<font color=red><strong>Release notes for ${batchid}</strong></font><br>";
58 echo 'The user permission records of this system have been automatically converted ';
59 echo 'to switch to the new RackCode authorization system. To prevent possible data ';
60 echo 'leak, the second line of the automatically created configuration bans everything ';
61 echo '(and the first allows everything to you, the administrator). The whole config can ';
62 echo "be reviewed on the Permissions page (under Configuration). Sorry for the inconvenience.<br><br>\n";
63 break;
64 case '0.16.1':
65 echo "<font color=red><strong>Release notes for ${batchid}</strong></font><br>";
66 echo 'This release fixes a missing UNIQUE key in the database. However, this fix may sometimes fail, ';
67 echo 'if the DB contains duplicate records. If you see a failed ADD UNIQUE query, the only solution is to delete the duplicates manually.';
68 break;
69 default:
70 break;
71 }
72 }
73
74 // Upgrade batches are name exactly as the release where they first appear.
75 // That simple, but seems sufficient for beginning.
76 function executeUpgradeBatch ($batchid)
77 {
78 $query = array();
79 global $dbxlink;
80 switch ($batchid)
81 {
82 case '0.14.5':
83 // We can't realiably distinguish between 0.14.4 and 0.14.5, but
84 // luckily the SQL statements below can be safely executed for both.
85
86
87 // This has to be checked once more to be sure IPAddress allocation
88 // conventions are correct.
89 $query[] = "delete from IPAddress where name = '' and reserved = 'no'";
90
91 // In the 0.14.4 release we had AUTO_INCREMENT low in the dictionary and auth
92 // data tables, thus causing new user's data to take primary keys equal to
93 // the values of shipped data in future releases. Let's shift user's data
94 // up and keep DB consistent.
95 $query[] = "alter table Attribute AUTO_INCREMENT = 10000";
96 $query[] = "alter table Chapter AUTO_INCREMENT = 10000";
97 $query[] = "alter table Dictionary AUTO_INCREMENT = 10000";
98 $query[] = "alter table UserAccount AUTO_INCREMENT = 10000";
99 $query[] = "update UserAccount set user_id = user_id + 10000 where user_id between 2 and 10000";
100 $query[] = "update UserPermission set user_id = user_id + 10000 where user_id between 2 and 10000";
101 $query[] = "update Attribute set attr_id = attr_id + 10000 where attr_id between 25 and 10000";
102 $query[] = "update AttributeMap set attr_id = attr_id + 10000 where attr_id between 25 and 10000";
103 $query[] = "update Chapter set chapter_no = chapter_no + 10000 where chapter_no between 21 and 10000";
104 $query[] = "update AttributeMap set chapter_no = chapter_no + 10000 where chapter_no between 21 and 10000";
105 break; // --------------------------------------------
106 case '0.14.6':
107 // This version features new dictionary entries, the correction above should allow us
108 // inject them w/o a problem.
109 $query[] = "INSERT INTO `Dictionary` (`chapter_no`, `dict_key`, `dict_value`) VALUES (13,25,'FreeBSD 1.x')";
110 $query[] = "INSERT INTO `Dictionary` (`chapter_no`, `dict_key`, `dict_value`) VALUES (13,26,'FreeBSD 2.x')";
111 $query[] = "INSERT INTO `Dictionary` (`chapter_no`, `dict_key`, `dict_value`) VALUES (13,27,'FreeBSD 3.x')";
112 $query[] = "INSERT INTO `Dictionary` (`chapter_no`, `dict_key`, `dict_value`) VALUES (13,28,'FreeBSD 4.x')";
113 $query[] = "INSERT INTO `Dictionary` (`chapter_no`, `dict_key`, `dict_value`) VALUES (13,29,'FreeBSD 5.x')";
114 $query[] = "INSERT INTO `Dictionary` (`chapter_no`, `dict_key`, `dict_value`) VALUES (13,30,'FreeBSD 6.x')";
115 $query[] = "INSERT INTO `Dictionary` (`chapter_no`, `dict_key`, `dict_value`) VALUES (13,31,'RHFC8')";
116 $query[] = "INSERT INTO `Dictionary` (`chapter_no`, `dict_key`, `dict_value`) VALUES (13,32,'ALTLinux Master 4.0')";
117 $query[] = "INSERT INTO `PortCompat` (`type1`, `type2`) VALUES (20,20)";
118 $query[] = "INSERT INTO `PortCompat` (`type1`, `type2`) VALUES (21,21)";
119 $query[] = "INSERT INTO `PortCompat` (`type1`, `type2`) VALUES (22,22)";
120 $query[] = "INSERT INTO `PortCompat` (`type1`, `type2`) VALUES (23,23)";
121 $query[] = "INSERT INTO `PortCompat` (`type1`, `type2`) VALUES (24,24)";
122 $query[] = "INSERT INTO `PortCompat` (`type1`, `type2`) VALUES (25,25)";
123 $query[] = "INSERT INTO `PortCompat` (`type1`, `type2`) VALUES (26,26)";
124 $query[] = "INSERT INTO `PortCompat` (`type1`, `type2`) VALUES (27,27)";
125 $query[] = "INSERT INTO `PortCompat` (`type1`, `type2`) VALUES (28,28)";
126 $query[] = "INSERT INTO `Dictionary` (`chapter_no`, `dict_key`, `dict_value`) VALUES (2,20,'KVM')";
127 $query[] = "INSERT INTO `Dictionary` (`chapter_no`, `dict_key`, `dict_value`) VALUES (2,21,'1000Base-ZX')";
128 $query[] = "INSERT INTO `Dictionary` (`chapter_no`, `dict_key`, `dict_value`) VALUES (2,22,'10GBase-ER')";
129 $query[] = "INSERT INTO `Dictionary` (`chapter_no`, `dict_key`, `dict_value`) VALUES (2,23,'10GBase-LR')";
130 $query[] = "INSERT INTO `Dictionary` (`chapter_no`, `dict_key`, `dict_value`) VALUES (2,24,'10GBase-LRM')";
131 $query[] = "INSERT INTO `Dictionary` (`chapter_no`, `dict_key`, `dict_value`) VALUES (2,25,'10GBase-ZR')";
132 $query[] = "INSERT INTO `Dictionary` (`chapter_no`, `dict_key`, `dict_value`) VALUES (2,26,'10GBase-LX4')";
133 $query[] = "INSERT INTO `Dictionary` (`chapter_no`, `dict_key`, `dict_value`) VALUES (2,27,'10GBase-CX4')";
134 $query[] = "INSERT INTO `Dictionary` (`chapter_no`, `dict_key`, `dict_value`) VALUES (2,28,'10GBase-Kx')";
135 $query[] = "INSERT INTO `Dictionary` (`chapter_no`, `dict_key`, `dict_value`) VALUES (12,114,'Cisco Catalyst 2970G-24T')";
136 $query[] = "INSERT INTO `Dictionary` (`chapter_no`, `dict_key`, `dict_value`) VALUES (12,115,'Cisco Catalyst 2970G-24TS')";
137 $query[] = "INSERT INTO `UserPermission` (`user_id`, `page`, `tab`, `access`) VALUES (0,'help','%','yes')";
138 // And 0.14.6 is the first release, which features Config table. Let's create
139 // and fill it with default values.
140 $query[] = "
141 CREATE TABLE `Config` (
142 `varname` char(32) NOT NULL,
143 `varvalue` char(64) NOT NULL,
144 `vartype` enum('string','uint') NOT NULL default 'string',
145 `emptyok` enum('yes','no') NOT NULL default 'no',
146 `is_hidden` enum('yes','no') NOT NULL default 'yes',
147 `description` text,
148 PRIMARY KEY (`varname`)
149 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
150 ";
151 $query[] = "INSERT INTO `Config` VALUES ('rtwidth_0','9','uint','no','yes','')";
152 $query[] = "INSERT INTO `Config` VALUES ('rtwidth_1','21','uint','no','yes','')";
153 $query[] = "INSERT INTO `Config` VALUES ('rtwidth_2','9','uint','no','yes','')";
154 $query[] = "INSERT INTO `Config` VALUES ('color_F','8fbfbf','string','no','no','HSV: 180-25-75. Free atoms, they are available for allocation to objects.')";
155 $query[] = "INSERT INTO `Config` VALUES ('color_A','bfbfbf','string','no','no','HSV: 0-0-75. Absent atoms.')";
156 $query[] = "INSERT INTO `Config` VALUES ('color_U','bf8f8f','string','no','no','HSV: 0-25-75. Unusable atoms. Some problems keep them from being free.')";
157 $query[] = "INSERT INTO `Config` VALUES ('color_T','408080','string','no','no','HSV: 180-50-50. Taken atoms, object_id should be set for such.')";
158 $query[] = "INSERT INTO `Config` VALUES ('color_Th','80ffff','string','no','no','HSV: 180-50-100. Taken atoms with highlight. They are not stored in the database and are only used for highlighting.')";
159 $query[] = "INSERT INTO `Config` VALUES ('color_Tw','804040','string','no','no','HSV: 0-50-50. Taken atoms with object problem. This is detected at runtime.')";
160 $query[] = "INSERT INTO `Config` VALUES ('color_Thw','ff8080','string','no','no','HSV: 0-50-100. An object can be both current and problematic. We run highlightObject() first and markupObjectProblems() second.')";
161 $query[] = "INSERT INTO `Config` VALUES ('default_port_type','11','uint','no','no','Default value for port type selects.')";
162 $query[] = "INSERT INTO `Config` VALUES ('MASSCOUNT','15','uint','no','no','Number of lines in object mass-adding form.')";
163 $query[] = "INSERT INTO `Config` VALUES ('MAXSELSIZE','30','uint','no','no','Maximum size of a SELECT HTML element.')";
164 $query[] = "INSERT INTO `Config` VALUES ('enterprise','MyCompanyName','string','no','no','Fit to your needs.')";
165 $query[] = "INSERT INTO `Config` VALUES ('NAMEFUL_OBJTYPES','4,7,8','string','yes','no','These are the object types, which assume a common name to be normally configured. If a name is absent for an object of one of such types, HTML output is corrected to accent this misconfiguration.')";
166 $query[] = "INSERT INTO `Config` VALUES ('ROW_SCALE','2','uint','no','no','Row-scope picture scale factor.')";
167 $query[] = "INSERT INTO `Config` VALUES ('PORTS_PER_ROW','12','uint','no','yes','Max switch port per one row on the switchvlans dynamic tab.')";
168 $query[] = "INSERT INTO `Config` VALUES ('DB_VERSION','0.14.6','string','no','yes','Database version.')";
169 break; // --------------------------------------------
170 case '0.14.7':
171 // IPAddress is hopefully fixed now finally.
172 $query[] = "delete from IPAddress where name = '' and reserved != 'yes'";
173
174 // Now rebuild the dictionary into a new table with the same data,
175 // but proper indexing. We are going to convert compound index
176 // into 1-field one to employ AUTO_INCREMENT properly. This means
177 // renumbering lots of records in Dictionary and adjusting records
178 // in related tables. After that we can safely swap the tables.
179 $query[] = "
180 CREATE TABLE `Dictionary_0_14_7_new` (
181 `chapter_no` int(10) unsigned NOT NULL,
182 `dict_key` int(10) unsigned NOT NULL auto_increment,
183 `dict_value` char(128) default NULL,
184 PRIMARY KEY (`dict_key`),
185 UNIQUE KEY `chap_to_key` (`chapter_no`,`dict_key`),
186 UNIQUE KEY `chap_to_val` (`chapter_no`,`dict_value`)
187 ) TYPE=MyISAM AUTO_INCREMENT=50000
188 ";
189
190 echo '<pre>';
191 // Find all chapter numbers, which will require AttributeValue adjustment.
192 $q2 = 'select distinct chapter_no from AttributeMap where chapter_no != 0';
193 $r2 = $dbxlink->query ($q2);
194 $chaplist = array();
195 while ($row = $r2->fetch (PDO::FETCH_NUM))
196 $chaplist[] = $row[0];
197 $r2->closeCursor();
198 unset ($r2);
199
200 $stock = array();
201 // Below I list the records, which are known to be the stock
202 // dictionary records of 0.14.6 release.
203 $stock[1] = array
204 (
205 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 15, 16
206 );
207 $stock[2] = array
208 (
209 3, 4, 5, 6, 7, 8, 9,
210 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
211 20, 21, 22, 23, 24, 25, 26, 27, 28
212 );
213 $stock[11] = array
214 (
215 1, 3, 4, 5, 6, 7, 8, 9,
216 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
217 21, 22, 24, 25, 26, 27, 28, 29,
218 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
219 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
220 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
221 60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
222 70, 71, 72, 73, 74, 75, 76
223 );
224 $stock[12] = array
225 (
226 1, 11, 13, 14, 15, 16, 17, 18, 19, 20, 26, 29,
227 31, 32, 33, 34, 35, 36, 37, 38, 39,
228 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
229 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
230 60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
231 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
232 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
233 90, 91, 92, 93, 94, 95, 96, 97, 98, 99,
234 100, 101, 102, 103, 104, 105, 106, 107, 108, 109,
235 110, 111, 112, 113, 114, 115
236 );
237 $stock[13] = array
238 (
239 1, 2, 3, 4, 5, 6, 7, 8, 9,
240 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
241 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
242 30, 31, 32
243 );
244 $stock[14] = array
245 (
246 1, 2, 9, 11, 13, 15, 19, 20, 21, 22
247 );
248 $stock[16] = array
249 (
250 1, 2, 3, 4, 5, 6, 7, 8
251 );
252 $stock[17] = array
253 (
254 1, 2, 3, 4, 5, 6, 7, 8, 9,
255 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
256 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
257 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
258 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
259 50
260 );
261 $stock[18] = array
262 (
263 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14
264 );
265 $stock[19] = array
266 (
267 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
268 );
269 $stock[20] = array
270 (
271 1, 2
272 );
273
274 // Load dictionary and transform into two tree structures for
275 // stock and user record sets.
276 $dict = array();
277 $q3 = 'select chapter_no, dict_key, dict_value from Dictionary order by chapter_no, dict_key';
278 $r3 = $dbxlink->query ($q3);
279
280 while ($row = $r3->fetch (PDO::FETCH_ASSOC))
281 {
282 $tree = 'user';
283 $dict_key = $row['dict_key'];
284 $chapter_no = $row['chapter_no'];
285 switch ($chapter_no)
286 {
287 case 1: // RackObjectType
288 case 2: // PortType
289 case 11: // server models
290 case 12: // network switch models
291 case 13: // server OS type
292 case 14: // network switch OS type
293 case 16: // router OS type
294 case 17: // router models
295 case 18: // disk array models
296 case 19: // tape library models
297 case 20: // Protocols
298 if (in_array ($dict_key, $stock[$chapter_no]))
299 $tree = 'stock';
300 break;
301 }
302 $dict[$tree][$chapter_no][$dict_key] = array ('value' => $row['dict_value']);
303 }
304 $r3->closeCursor();
305 unset ($r3);
306
307
308 // Now we store stock dataset first, bump up key value and store
309 // user's data. After that we will know the new dict_key for all
310 // records.
311 // The result of both datasets processing is saved in $new_dict.
312 // Save on calling LAST_ISERT_ID() each time by keeping own key.
313 $newkey = 1;
314 $new_dict = array();
315 foreach ($dict['stock'] as $chapter_no => $words)
316 {
317 $new_dict[$chapter_no] = array();
318 foreach ($words as $dict_key => $entry)
319 {
320 $query[] = "insert into Dictionary_0_14_7_new (chapter_no, dict_key, dict_value) " .
321 "values (${chapter_no}, ${newkey}, '${entry['value']}')";
322 $new_dict[$chapter_no][$dict_key] = $entry;
323 $new_dict[$chapter_no][$dict_key]['newkey'] = $newkey;
324 $newkey++;
325 }
326 }
327 $newkey = 50000;
328 foreach ($dict['user'] as $chapter_no => $words)
329 {
330 // Some chapters may appear on the user dataset only.
331 if (!isset ($new_dict[$chapter_no]))
332 $new_dict[$chapter_no] = array();
333 foreach ($words as $dict_key => $entry)
334 {
335 $query[] = "insert into Dictionary_0_14_7_new " .
336 "values (${chapter_no}, ${newkey}, '${entry['value']}')";
337 $new_dict[$chapter_no][$dict_key] = $entry;
338 $new_dict[$chapter_no][$dict_key]['newkey'] = $newkey;
339 $newkey++;
340 }
341 }
342 // The new table should now have adequate AUTO_INCREMENT w/o our care.
343 // Install the new data.
344 $query[] = 'drop table Dictionary';
345 $query[] = 'alter table Dictionary_0_14_7_new rename to Dictionary';
346
347 // Now we iterate over the joint dataset, picking some chapters and
348 // performing additional processing:
349 // 1 (RackObjectType) --- adjust RackObject and regenerate AttributeMap
350 // 2 (PortType) --- adjust Port and regenerate PortCompat (at a latter point)
351 // 3 (RackRow) --- adjust Rack
352 // 20 (Protocols) --- adjust PortForwarding
353 // All other chapters listed in $chaplist --- adjust AttributeValue
354
355 $query[] = "delete from AttributeMap";
356 foreach ($new_dict as $chapter_no => $words)
357 {
358 foreach ($words as $oldkey => $data)
359 {
360 $value = $data['value'];
361 $newkey = $data['newkey'];
362 // Even if the key doesn't change, go on to have
363 // AttributeMap regenerated completely.
364 if ($chapter_no == 1)
365 {
366 $q4 = "select id from RackObject where objtype_id = ${oldkey}";
367 $r4 = $dbxlink->query ($q4);
368 while ($row = $r4->fetch (PDO::FETCH_ASSOC))
369 $query[] = "update RackObject set objtype_id = ${newkey} where id = ${row['id']} limit 1";
370 $r4->closeCursor();
371 unset ($r4);
372
373 $q5 = "select attr_id, chapter_no from AttributeMap where objtype_id = ${oldkey}";
374 $r5 = $dbxlink->query ($q5);
375 while ($row = $r5->fetch (PDO::FETCH_ASSOC))
376 $query[] = "insert into AttributeMap (objtype_id, attr_id, chapter_no) values (${newkey}, ${row['attr_id']}, ${row['chapter_no']})";
377 $r5->closeCursor();
378 unset ($r5);
379 }
380 elseif ($chapter_no == 2)
381 {
382 $q46 = "select id from Port where type = ${oldkey}";
383 $r46 = $dbxlink->query ($q46);
384 if ($r46 == NULL)
385 echo 'ERROR';
386 while ($row = $r46->fetch (PDO::FETCH_ASSOC))
387 $query[] = "update Port set type = ${newkey} where id = ${row['id']} limit 1";
388 $r46->closeCursor();
389 unset ($r46);
390 }
391 elseif ($chapter_no == 3)
392 {
393 $q7 = "select id from Rack where row_id = ${oldkey}";
394 $r7 = $dbxlink->query ($q7);
395 while ($row = $r7->fetch (PDO::FETCH_ASSOC))
396 $query[] = "update Rack set row_id = ${newkey} where id = ${row['id']} limit 1";
397 $r7->closeCursor();
398 unset ($r7);
399 }
400 elseif ($chapter_no == 20)
401 {
402 $q8 = "select object_id, localip, localport, remoteip, remoteport from PortForwarding where proto = ${oldkey}";
403 $r8 = $dbxlink->query ($q8);
404 while ($row = $r8->fetch (PDO::FETCH_ASSOC))
405 $query[] = "update PortForwarding set proto = ${newkey} where " .
406 "object_id = ${row['object_id']} and localip = ${row['localip']} and " .
407 "localport = ${row['localport']} and remoteip = ${row['remoteip']} and " .
408 "remoteport = ${row['remoteport']} and proto = ${oldkey} limit 1";
409 $r8->closeCursor();
410 unset ($r8);
411 }
412 elseif (in_array ($chapter_no, $chaplist))
413 {
414 $q81 = "select object_id, AttributeValue.attr_id from " .
415 "AttributeValue natural join Attribute natural join AttributeMap " .
416 "inner join RackObject on RackObject.id = object_id and RackObject.objtype_id = AttributeMap.objtype_id " .
417 "where attr_type = 'dict' and chapter_no = ${chapter_no} and uint_value = ${oldkey}";
418 $r81 = $dbxlink->query ($q81);
419 while ($row = $r81->fetch (PDO::FETCH_ASSOC))
420 $query[] = "update AttributeValue set uint_value = ${newkey} " .
421 "where object_id = ${row['object_id']} and attr_id = ${row['attr_id']}";
422 $r81->closeCursor();
423 unset ($r81);
424 }
425 }
426 }
427 // Now it's possible to schedule PortCompat regeneration.
428 // Convert the fields to unsigned on occasion.
429 $query[] = 'drop table PortCompat';
430 $query[] = 'create table PortCompat (type1 int(10) unsigned NOT NULL, type2 int(10) unsigned NOT NULL)';
431 $q9 = "select type1, type2 from PortCompat";
432 $r9 = $dbxlink->query ($q9);
433 while ($row = $r9->fetch (PDO::FETCH_ASSOC))
434 {
435 $new_type1 = $new_dict[2][$row['type1']]['newkey'];
436 $new_type2 = $new_dict[2][$row['type2']]['newkey'];
437 $query[] = "insert into PortCompat (type1, type2) values (${new_type1}, ${new_type2})";
438 }
439 $r9->closeCursor();
440 unset ($r9);
441 echo '</pre>';
442
443 // Give the configuration some finish
444 $query[] = "update Config set is_hidden = 'yes' where varname = 'color_F'";
445 $query[] = "update Config set is_hidden = 'yes' where varname = 'color_A'";
446 $query[] = "update Config set is_hidden = 'yes' where varname = 'color_U'";
447 $query[] = "update Config set is_hidden = 'yes' where varname = 'color_T'";
448 $query[] = "update Config set is_hidden = 'yes' where varname = 'color_Th'";
449 $query[] = "update Config set is_hidden = 'yes' where varname = 'color_Tw'";
450 $query[] = "update Config set is_hidden = 'yes' where varname = 'color_Thw'";
451 $query[] = "update Config set description = 'Default port type' where varname = 'default_port_type'";
452 $query[] = "update Config set description = 'Picture scale for rack row display' where varname = 'ROW_SCALE'";
453 $query[] = "update Config set description = 'Organization name' where varname = 'enterprise'";
454 $query[] = "update Config set description = 'Expect common name configured for the following object types' where varname = 'NAMEFUL_OBJTYPES'";
455 $query[] = "update Config set description = '&lt;SELECT&gt; lists height' where varname = 'MAXSELSIZE'";
456 $query[] = "update Config set description = '&quot;Fast&quot; form is this many records tall' where varname = 'MASSCOUNT'";
457 $query[] = "update Config set is_hidden = 'no', description = 'Ports per row in VLANs tab' where varname = 'PORTS_PER_ROW'";
458 $query[] = "INSERT INTO `Config` VALUES ('IPV4_ADDRS_PER_PAGE','256','uint','no','no','IPv4 addresses per page')";
459 $query[] = "INSERT INTO `Config` VALUES ('DEFAULT_RACK_HEIGHT','42','uint','yes','no','Default rack height')";
460 // After Dictionary transformation we ought to list 337 stock records in DB. Add more.
461 $new_words = array();
462 $new_words[338] = array (12 => 'Dell PowerConnect 2216');
463 $new_words[] = array (12 => 'Dell PowerConnect 2224');
464 $new_words[] = array (12 => 'Dell PowerConnect 2324');
465 $new_words[] = array (12 => 'Dell PowerConnect 2708');
466 $new_words[] = array (12 => 'Dell PowerConnect 2716');
467 $new_words[] = array (12 => 'Dell PowerConnect 2724');
468 $new_words[] = array (12 => 'Dell PowerConnect 2748');
469 $new_words[] = array (12 => 'Dell PowerConnect 3424');
470 $new_words[] = array (12 => 'Dell PowerConnect 3424P');
471 $new_words[] = array (12 => 'Dell PowerConnect 3448');
472 $new_words[] = array (12 => 'Dell PowerConnect 3448P');
473 $new_words[] = array (12 => 'Dell PowerConnect 5324');
474 $new_words[] = array (12 => 'Dell PowerConnect 6224');
475 $new_words[] = array (12 => 'Dell PowerConnect 6224P');
476 $new_words[] = array (12 => 'Dell PowerConnect 6224F');
477 $new_words[] = array (12 => 'Dell PowerConnect 6248');
478 $new_words[] = array (12 => 'Dell PowerConnect 6248P');
479 $new_words[] = array (11 => 'Dell PowerEdge 6850');
480 $new_words[] = array (11 => 'Dell PowerEdge 6950');
481 $new_words[] = array (11 => 'Dell PowerEdge R900');
482 $new_words[] = array (11 => 'Dell PowerEdge 4400');
483 $new_words[] = array (11 => 'Dell PowerEdge 2650');
484 $new_words[] = array (11 => 'Dell PowerEdge 2550');
485 $new_words[] = array (11 => 'Dell PowerEdge 750');
486 $new_words[] = array (11 => 'Dell PowerEdge 2450');
487 $new_words[] = array (11 => 'Dell PowerEdge 850');
488 $new_words[] = array (11 => 'Dell PowerEdge 1850');
489 $new_words[] = array (11 => 'Dell PowerEdge 860');
490 $new_words[] = array (11 => 'Dell PowerEdge 2900');
491 $new_words[] = array (11 => 'Dell PowerEdge 2970');
492 $new_words[] = array (11 => 'Dell PowerEdge SC1435');
493 $new_words[] = array (12 => 'Cisco Catalyst 6509');
494 $new_words[] = array (12 => 'Cisco ME 6524GS-8S');
495 $new_words[] = array (12 => 'Cisco ME 6524GT-8S');
496 $new_words[] = array (12 => 'Cisco Catalyst 4503-E');
497 $new_words[] = array (12 => 'Cisco Catalyst 4506-E');
498 $new_words[] = array (12 => 'Cisco Catalyst 4507R-E');
499 $new_words[] = array (12 => 'Cisco Catalyst 4510R-E');
500 $new_words[] = array (12 => 'Cisco Catalyst 3750-24TE-M');
501 $new_words[] = array (12 => 'Cisco Catalyst 4948-10GE');
502 $new_words[] = array (12 => 'Cisco ME 4924-10GE');
503 $new_words[] = array (12 => 'Cisco Catalyst 2960-24');
504 $new_words[] = array (12 => 'Cisco Catalyst 2950-24');
505 $new_words[] = array (12 => 'Cisco Catalyst 2950-12');
506 $new_words[] = array (12 => 'Cisco Catalyst 2950C-24');
507 $new_words[] = array (12 => 'Cisco Catalyst 2950G-24-DC');
508 $new_words[] = array (12 => 'Cisco Catalyst 2950SX-48');
509 $new_words[] = array (12 => 'Cisco Catalyst 2950SX-24');
510 $new_words[] = array (12 => 'Cisco Catalyst 2950T-24');
511 $new_words[] = array (12 => 'Cisco Catalyst 2950T-48');
512 $new_words[] = array (12 => 'Cisco Catalyst 2950G-12');
513 $new_words[] = array (12 => 'Cisco Catalyst 2950G-24');
514 $new_words[] = array (12 => 'Cisco Catalyst 2950G-48');
515 $new_words[] = array (12 => 'Cisco Catalyst 3508G XL');
516 $new_words[] = array (12 => 'Cisco Catalyst 3512 XL');
517 $new_words[] = array (12 => 'Cisco Catalyst 3524 XL');
518 $new_words[] = array (12 => 'Cisco Catalyst 3524 PWR XL');
519 $new_words[] = array (12 => 'Cisco Catalyst 3548 XL');
520 $new_words[] = array (12 => 'Cisco ME 2400-24TS-A');
521 $new_words[] = array (12 => 'Cisco ME 2400-24TS-D');
522 $new_words[] = array (12 => 'Cisco Catalyst 3550-12T');
523 $new_words[] = array (12 => 'Cisco Catalyst 3550-12G');
524 $new_words[] = array (12 => 'Cisco Catalyst 3550-24');
525 $new_words[] = array (12 => 'Cisco Catalyst 3550-24 FX');
526 $new_words[] = array (12 => 'Cisco Catalyst 3550-24 DC');
527 $new_words[] = array (12 => 'Cisco Catalyst 3550-24 PWR');
528 $new_words[] = array (12 => 'Cisco Catalyst 3550-48');
529 $new_words[] = array (12 => 'Cisco ME 3400G-12CS-A');
530 $new_words[] = array (12 => 'Cisco ME 3400G-12CS-D');
531 $new_words[] = array (12 => 'Cisco ME 3400G-2CS-A');
532 $new_words[] = array (12 => 'Cisco ME 3400-24TS-A');
533 $new_words[] = array (12 => 'Cisco ME 3400-24TS-D');
534 $new_words[] = array (12 => 'Cisco ME 3400-24FS-A');
535 $new_words[] = array (12 => 'Foundry FastIron GS 624XGP');
536 $new_words[] = array (12 => 'Foundry FastIron GS 624XGP-POE');
537 $new_words[] = array (12 => 'Foundry FastIron LS 624');
538 $new_words[] = array (12 => 'Foundry FastIron LS 648');
539 $new_words[] = array (12 => 'Foundry NetIron M2404F');
540 $new_words[] = array (12 => 'Foundry NetIron M2404C');
541 $new_words[] = array (17 => 'Foundry BigIron RX-32');
542 $new_words[] = array (13 => 'Debian 2.0 (hamm)');
543 $new_words[] = array (13 => 'Debian 2.1 (slink)');
544 $new_words[] = array (13 => 'Debian 2.2 (potato)');
545 $new_words[] = array (13 => 'Debian 4.0 (etch)');
546 $new_words[] = array (13 => 'ALTLinux Server 4.0');
547 $new_words[] = array (13 => 'ALTLinux Sisyphus');
548 $new_words[] = array (13 => 'openSUSE 10.0');
549 $new_words[] = array (13 => 'openSUSE 10.1');
550 $new_words[] = array (13 => 'openSUSE 10.2');
551 $new_words[] = array (13 => 'openSUSE 10.3');
552 $new_words[] = array (13 => 'Ubuntu 4.10');
553 $new_words[] = array (13 => 'Ubuntu 5.04');
554 $new_words[] = array (13 => 'Ubuntu 5.10');
555 $new_words[] = array (13 => 'Ubuntu 6.06 LTS');
556 $new_words[] = array (13 => 'Ubuntu 6.10');
557 $new_words[] = array (13 => 'Ubuntu 7.04');
558 $new_words[] = array (13 => 'Ubuntu 7.10');
559 $new_words[] = array (13 => 'Ubuntu 8.04 LTS');
560 $new_words[] = array (13 => 'RHEL5');
561 $new_words[] = array (18 => 'Dell PowerVault 210S');
562 $new_words[] = array (18 => 'Dell PowerVault 221S');
563 $new_words[] = array (2 => 'dry contact');
564 $new_words[] = array (2 => 'unknown');
565 // Two above records ought to take keys 439 and 440.
566 $query[] = "INSERT INTO `PortCompat` (`type1`, `type2`) VALUES (439,439)";
567 $new_words[] = array (13 => 'CentOS-2');
568 $new_words[] = array (13 => 'CentOS-3');
569 $new_words[] = array (13 => 'CentOS-4');
570 $new_words[] = array (13 => 'CentOS-5');
571 foreach ($new_words as $dict_key => $tmp)
572 foreach ($tmp as $chapter_no => $dict_value)
573 $query[] = 'INSERT INTO `Dictionary` (`chapter_no`, `dict_key`, `dict_value`) ' .
574 "VALUES (${chapter_no}, ${dict_key}, '${dict_value}')";
575 // Resetting to defaults is worse, than remapping, but better than
576 // leaving messed values.
577 $query[] = "update Config set varvalue = '24' where varname = 'default_port_type' limit 1";
578 // We are done.
579 $query[] = "update Config set varvalue = '0.14.7' where varname = 'DB_VERSION'";
580 break; // --------------------------------------------
581 case '0.14.8':
582 $query[] = "INSERT INTO `Config` (varname, varvalue, vartype, emptyok, is_hidden, description) VALUES ('REQUIRE_ASSET_TAG_FOR','4,7,8','string','yes','no','Require asset tag for the following object types')";
583 $query[] = "alter table Port modify column id int(10) unsigned NOT NULL auto_increment";
584 $query[] = "alter table Port modify column object_id int(10) unsigned NOT NULL";
585 $query[] = "alter table Port modify column type int(10) unsigned NOT NULL";
586 $query[] = "alter table Link modify column porta int(10) unsigned";
587 $query[] = "alter table Link modify column portb int(10) unsigned";
588 $query[] = "alter table PortForwarding modify column object_id int(10) unsigned not null";
589 $query[] = "alter table PortForwarding modify column localport smallint(5) unsigned not null";
590 $query[] = "alter table PortForwarding modify column remoteport smallint(5) unsigned not null";
591 $query[] = "alter table IPBonds modify column object_id int(10) unsigned not null";
592 $query[] = "alter table IPRanges modify column id int(10) unsigned not null";
593 $query[] = "alter table IPRanges modify column mask int(10) unsigned not null";
594 $query[] = "alter table Port add index `type` (type)";
595 $query[] = "alter table PortCompat add index `type1` (type1)";
596 $query[] = "alter table PortCompat add index `type2` (type2)";
597 $query[] = "update Dictionary set dict_value = 'Debian 3.0 (woody)' where dict_key = 234";
598 $query[] = "update Dictionary set dict_value = 'Debian 3.1 (sarge)' where dict_key = 235";
599 $query[] = "update Dictionary set dict_value = 'Foundry BigIron 15000' where dict_key = 311";
600 $query[] = "update Dictionary set dict_value = 'RHF7' where dict_key = 232";
601 $query[] = "update Dictionary set dict_value = 'RHF8' where dict_key = 242";
602 $query[] = "INSERT INTO `Attribute` (`attr_id`, `attr_type`, `attr_name`) VALUES (25,'string','UUID');";
603 $query[] = "INSERT INTO `AttributeMap` (`objtype_id`, `attr_id`, `chapter_no`) VALUES (4,25,0);";
604 $query[] = "update Dictionary set dict_value = '[[Cisco Catalyst 2970G-24T | http://www.cisco.com/en/US/products/hw/switches/ps5206/ps5313/index.html]]' where dict_key = 210";
605 $query[] = "update Dictionary set dict_value = '[[Cisco Catalyst 2970G-24TS | http://www.cisco.com/en/US/products/hw/switches/ps5206/ps5437/index.html]]' where dict_key = 211";
606 $query[] = "update Config set varvalue = '0.14.8' where varname = 'DB_VERSION'";
607 break; // --------------------------------------------
608 case '0.14.9':
609 $query[] = "alter table IPRanges modify column id int(10) unsigned not null auto_increment";
610 $query[] = "alter table Rack modify column height tinyint(3) unsigned not null default '42'";
611 $query[] = "alter table Rack add column thumb_data blob after comment";
612 $query[] = "
613 CREATE TABLE `IPLoadBalancer` (
614 `object_id` int(10) unsigned default NULL,
615 `rspool_id` int(10) unsigned default NULL,
616 `vs_id` int(10) unsigned default NULL,
617 `vsconfig` text,
618 `rsconfig` text,
619 UNIQUE KEY `LB-VS` (`object_id`,`vs_id`)
620 ) ENGINE=MyISAM";
621 $query[] = "
622 CREATE TABLE `IPRSPool` (
623 `id` int(10) unsigned NOT NULL auto_increment,
624 `name` char(255) default NULL,
625 `vsconfig` text,
626 `rsconfig` text,
627 PRIMARY KEY (`id`)
628 ) ENGINE=MyISAM";
629 $query[] = "
630 CREATE TABLE `IPRealServer` (
631 `id` int(10) unsigned NOT NULL auto_increment,
632 `inservice` enum('yes','no') NOT NULL default 'no',
633 `rsip` int(10) unsigned default NULL,
634 `rsport` smallint(5) unsigned default NULL,
635 `rspool_id` int(10) unsigned default NULL,
636 `rsconfig` text,
637 PRIMARY KEY (`id`),
638 UNIQUE KEY `pool-endpoint` (`rspool_id`,`rsip`,`rsport`)
639 ) ENGINE=MyISAM";
640 $query[] = "
641 CREATE TABLE `IPVirtualService` (
642 `id` int(10) unsigned NOT NULL auto_increment,
643 `vip` int(10) unsigned default NULL,
644 `vport` smallint(5) unsigned default NULL,
645 `proto` enum('TCP','UDP') NOT NULL default 'TCP',
646 `name` char(255) default NULL,
647 `vsconfig` text,
648 `rsconfig` text,
649 PRIMARY KEY (`id`)
650 ) ENGINE=MyISAM";
651 $query[] = "INSERT INTO `Config` VALUES ('DEFAULT_SLB_VS_PORT','','uint','yes','no','Default port of SLB virtual service')";
652 $query[] = "INSERT INTO `Config` VALUES ('DEFAULT_SLB_RS_PORT','','uint','yes','no','Default port of SLB real server')";
653 $query[] = "INSERT INTO `Config` VALUES ('IPV4_PERFORMERS','1,4,7,8,12,14','string','yes','no','IPv4-capable object types')";
654 $query[] = "INSERT INTO `Config` VALUES ('NATV4_PERFORMERS','4,7,8','string','yes','no','NATv4-capable object types')";
655 $query[] = "INSERT INTO `Config` VALUES ('USER_AUTH_SRC','database','string','no','no','User authentication source')";
656 $query[] = "alter table RackSpace drop column problem_id";
657 $query[] = "update Config set varvalue = '0.14.9' where varname = 'DB_VERSION'";
658 break; // --------------------------------------------
659 case '0.14.10':
660 $query[] = "INSERT INTO `Config` (varname, varvalue, vartype, emptyok, is_hidden, description) VALUES ('DETECT_URLS','no','string','yes','no','Detect URLs in text fields')";
661 $query[] = "alter table RackHistory modify column height tinyint(3) unsigned";
662 $query[] = "alter table RackHistory add column thumb_data blob after comment";
663 $query[] = "INSERT INTO `Config` VALUES ('RACK_PRESELECT_THRESHOLD','1','uint','no','no','Rack pre-selection threshold')";
664 $query[] = "update Config set varvalue = '0.14.10' where varname = 'DB_VERSION'";
665 break; // --------------------------------------------
666 case '0.14.11':
667 $new_words = array();
668 $new_words[445] = array (1 => 'KVM switch');
669 $new_words[] = array (2 => 'KVM (console)');
670 $new_words[] = array (1 => 'multiplexer');
671 $query[] = "update Dictionary set dict_value = 'network switch' where dict_key = 8";
672 $query[] = "update Dictionary set dict_value = 'KVM (host)' where dict_key = 33";
673 $query[] = "delete from PortCompat where type1 = 33 and type2 = 33";
674 $query[] = "insert into PortCompat (type1, type2) values (33, 446)";
675 $query[] = "insert into PortCompat (type1, type2) values (446, 33)";
676 $query[] = "insert into Chapter (chapter_no, sticky, chapter_name) values (21, 'no', 'KVM switch models')";
677 $query[] = "insert into Chapter (chapter_no, sticky, chapter_name) values (22, 'no', 'multiplexer models')";
678 $query[] = "update Chapter set chapter_name = 'network switch models' where chapter_no = 12";
679 $new_words[] = array (21 => '[[Avocent DSR1021 | http://www.avocent.com/WorkArea/linkit.aspx?LinkIdentifier=id&ItemID=2418]]');
680 $new_words[] = array (21 => '[[Avocent DSR1022 | http://www.avocent.com/WorkArea/linkit.aspx?LinkIdentifier=id&ItemID=2498]]');
681 $new_words[] = array (21 => '[[Avocent DSR1024 | http://www.avocent.com/WorkArea/linkit.aspx?LinkIdentifier=id&ItemID=2588]]');
682 $new_words[] = array (21 => '[[Avocent DSR1031 | http://www.avocent.com/WorkArea/linkit.aspx?LinkIdentifier=id&ItemID=2804]]');
683 $new_words[] = array (21 => '[[Avocent DSR1020 | http://www.avocent.com/WorkArea/linkit.aspx?LinkIdentifier=id&ItemID=2340]]');
684 $new_words[] = array (21 => '[[Avocent DSR2020 | http://www.avocent.com/WorkArea/linkit.aspx?LinkIdentifier=id&ItemID=2884]]');
685 $new_words[] = array (21 => '[[Avocent DSR4020 | http://www.avocent.com/WorkArea/linkit.aspx?LinkIdentifier=id&ItemID=3100]]');
686 $new_words[] = array (21 => '[[Avocent DSR8020 | http://www.avocent.com/WorkArea/linkit.aspx?LinkIdentifier=id&ItemID=3358]]');
687 $new_words[] = array (21 => '[[Avocent DSR1030 | http://www.avocent.com/WorkArea/linkit.aspx?LinkIdentifier=id&ItemID=2726]]');
688 $new_words[] = array (21 => '[[Avocent DSR2030 | http://www.avocent.com/WorkArea/linkit.aspx?LinkIdentifier=id&ItemID=2988]]');
689 $new_words[] = array (21 => '[[Avocent DSR2035 | http://www.avocent.com/WorkArea/linkit.aspx?LinkIdentifier=id&ItemID=3050]]');
690 $new_words[] = array (21 => '[[Avocent DSR4030 | http://www.avocent.com/WorkArea/linkit.aspx?LinkIdentifier=id&ItemID=3196]]');
691 $new_words[] = array (21 => '[[Avocent DSR8030 | http://www.avocent.com/WorkArea/linkit.aspx?LinkIdentifier=id&ItemID=3472]]');
692 $new_words[] = array (21 => '[[Avocent DSR8035 | http://www.avocent.com/WorkArea/linkit.aspx?LinkIdentifier=id&ItemID=3580]]');
693 $new_words[] = array (21 => '[[Avocent AutoView 1415 | http://www.avocent.com/WorkArea/linkit.aspx?LinkIdentifier=id&ItemID=1612]]');
694 $new_words[] = array (21 => '[[Avocent AutoView 1515 | http://www.avocent.com/WorkArea/linkit.aspx?LinkIdentifier=id&ItemID=1736]]');
695 $new_words[] = array (21 => '[[Avocent AutoView 2015 | http://www.avocent.com/WorkArea/linkit.aspx?LinkIdentifier=id&ItemID=1930]]');
696 $new_words[] = array (21 => '[[Avocent AutoView 2020 | http://www.avocent.com/WorkArea/linkit.aspx?LinkIdentifier=id&ItemID=2012]]');
697 $new_words[] = array (21 => '[[Avocent AutoView 2030 | http://www.avocent.com/WorkArea/linkit.aspx?LinkIdentifier=id&ItemID=2114]]');
698 $new_words[] = array (21 => '[[Avocent AutoView 3100 | http://www.avocent.com/WorkArea/linkit.aspx?LinkIdentifier=id&ItemID=2222]]');
699 $new_words[] = array (21 => '[[Avocent AutoView 3200 | http://www.avocent.com/WorkArea/linkit.aspx?LinkIdentifier=id&ItemID=2266]]');
700 $new_words[] = array (21 => '[[Avocent SwitchView 1000 4-port | http://www.avocent.com/WorkArea/linkit.aspx?LinkIdentifier=id&ItemID=4016]]');
701 $new_words[] = array (21 => '[[Avocent SwitchView 1000 8-port | http://www.avocent.com/WorkArea/linkit.aspx?LinkIdentifier=id&ItemID=4094]]');
702 $new_words[] = array (21 => '[[Avocent SwitchView 1000 16-port | http://www.avocent.com/WorkArea/linkit.aspx?LinkIdentifier=id&ItemID=3934]]');
703 $new_words[] = array (22 => '[[Cronyx FMUX/S-4E1 | http://www.cronyx.ru/hardware/fmux-ring.html]]');
704 $new_words[] = array (22 => '[[Cronyx FMUX/S-4E1/ETS | http://www.cronyx.ru/hardware/fmux-ring.html]]');
705 $new_words[] = array (22 => '[[Cronyx FMUX/S-4E1/M | http://www.cronyx.ru/hardware/fmux-ring.html]]');
706 $new_words[] = array (22 => '[[Cronyx FMUX/S-8E1 | http://www.cronyx.ru/hardware/fmux-ring.html]]');
707 $new_words[] = array (22 => '[[Cronyx FMUX/S-8E1/ETS | http://www.cronyx.ru/hardware/fmux-ring.html]]');
708 $new_words[] = array (22 => '[[Cronyx FMUX/S-8E1/M | http://www.cronyx.ru/hardware/fmux-ring.html]]');
709 $new_words[] = array (22 => '[[Cronyx FMUX/S-16E1 | http://www.cronyx.ru/hardware/fmux-ring.html]]');
710 $new_words[] = array (22 => '[[Cronyx FMUX/S-16E1/ETS | http://www.cronyx.ru/hardware/fmux-ring.html]]');
711 $new_words[] = array (22 => '[[Cronyx FMUX/S-16E1/M | http://www.cronyx.ru/hardware/fmux-ring.html]]');
712 $new_words[] = array (22 => '[[Cronyx E1-XL/S | http://www.cronyx.ru/hardware/e1xl-s.html]]');
713 $new_words[] = array (22 => '[[Cronyx E1-DXC/S | http://www.cronyx.ru/hardware/e1dxc-s.html]]');
714 $new_words[] = array (22 => '[[Cronyx FMUX-4-E2 | http://www.cronyx.ru/hardware/fmux4-e2.html]]');
715 $new_words[] = array (22 => '[[Cronyx FMUX-4-E3 | http://www.cronyx.ru/hardware/fmux16-e3.html]]');
716 $new_words[] = array (22 => '[[Cronyx FMUX/SAT | http://www.cronyx.ru/hardware/fmux-sat.html]]');
717 $new_words[] = array (22 => '[[Cronyx E1-XL/S-IP | http://www.cronyx.ru/hardware/e1xl-ip.html]]');
718 $new_words[] = array (17 => '[[RAD FCD-IPM | http://www.rad.com/Article/0,6583,36426-E1_T1_or_Fractional_E1_T1_Modular_Access_Device_with_Integrated_Router,00.html]]');
719 $new_words[] = array (22 => '[[RAD FCD-E1M | http://www.rad.com/Article/0,6583,36723-E1_T1_Modular_Access_Multiplexer,00.html]]');
720 $new_words[] = array (22 => '[[RAD FCD-T1M | http://www.rad.com/Article/0,6583,36723-E1_T1_Modular_Access_Multiplexer,00.html]]');
721 $new_words[] = array (22 => '[[RAD FCD-155E | http://www.rad.com/Article/0,6583,36276-Ethernet_over_SDH_SONET_ADM,00.html]]');
722 $query[] = "insert into AttributeMap (objtype_id, attr_id, chapter_no) values (445, 1, 0)";
723 $query[] = "insert into AttributeMap (objtype_id, attr_id, chapter_no) values (445, 2, 21)";
724 $query[] = "insert into AttributeMap (objtype_id, attr_id, chapter_no) values (445, 3, 0)";
725 $query[] = "insert into AttributeMap (objtype_id, attr_id, chapter_no) values (445, 5, 0)";
726 $query[] = "insert into AttributeMap (objtype_id, attr_id, chapter_no) values (445, 14, 0)";
727 $query[] = "insert into AttributeMap (objtype_id, attr_id, chapter_no) values (445, 22, 0)";
728 $query[] = "insert into AttributeMap (objtype_id, attr_id, chapter_no) values (447, 1, 0)";
729 $query[] = "insert into AttributeMap (objtype_id, attr_id, chapter_no) values (447, 2, 22)";
730 $query[] = "insert into AttributeMap (objtype_id, attr_id, chapter_no) values (447, 3, 0)";
731 $query[] = "insert into AttributeMap (objtype_id, attr_id, chapter_no) values (447, 5, 0)";
732 $query[] = "insert into AttributeMap (objtype_id, attr_id, chapter_no) values (447, 14, 0)";
733 $query[] = "insert into AttributeMap (objtype_id, attr_id, chapter_no) values (447, 22, 0)";
734 foreach ($new_words as $dict_key => $tmp)
735 foreach ($tmp as $chapter_no => $dict_value)
736 $query[] = 'INSERT INTO `Dictionary` (`chapter_no`, `dict_key`, `dict_value`) ' .
737 "VALUES (${chapter_no}, ${dict_key}, '${dict_value}')";
738 $query[] = "update Rack set thumb_data = NULL";
739 $query[] = "update Config set varvalue = '0.14.11' where varname = 'DB_VERSION'";
740 break; // --------------------------------------------
741 case '0.14.12':
742 $query[] = "INSERT INTO `Config` VALUES ('DEFAULT_IPV4_RS_INSERVICE','no','string','no','no','Inservice status for new SLB real servers')";
743 $query[] = "INSERT INTO `Config` VALUES ('AUTOPORTS_CONFIG','4 = 1*33*kvm + 2*24*eth%u;15 = 1*446*kvm','string','yes','no','AutoPorts configuration')";
744 $query[] = "INSERT INTO `Config` VALUES ('DEFAULT_OBJECT_TYPE','4','uint','yes','no','Default object type for new objects')";
745 $query[] = "insert into Chapter (chapter_no, sticky, chapter_name) values (23, 'no', 'console models')";
746 $query[] = "INSERT INTO `AttributeMap` (`objtype_id`, `attr_id`, `chapter_no`) VALUES (15, 2, 23)";
747 $query[] = "alter table Dictionary modify column dict_value char(255)";
748 $new_words[491] = array (21 => '[[Aten CS78 | http://www.aten.com/products/productItem.php?pcid=20070130111936003&psid=20070130133658002&pid=20070319151852001&layerid=subClass2]]');
749 $new_words[] = array (21 => '[[Aten ACS1208A | http://www.aten.com/products/productItem.php?pcid=20070130111936003&psid=20070130133658002&pid=20050224111025006&layerid=subClass2]]');
750 $new_words[] = array (21 => '[[Aten ACS1216A | http://www.aten.com/products/productItem.php?pcid=20070130111936003&psid=20070130133658002&pid=20050224111953008&layerid=subClass2]]');
751 $new_words[] = array (21 => '[[Aten CS1754 | http://www.aten.com/products/productItem.php?pcid=20070130111936003&psid=20070130133658002&pid=20050217161051008&layerid=subClass2]]');
752 $new_words[] = array (21 => '[[Aten CS1758 | http://www.aten.com/products/productItem.php?pcid=20070130111936003&psid=20070130133658002&pid=20050224093143008&layerid=subClass2]]');
753 $new_words[] = array (21 => '[[Aten CS9134 | http://www.aten.com/products/productItem.php?pcid=2005010513171002&psid=20070130133658002&pid=20050217172845005&layerid=subClass2]]');
754 $new_words[] = array (21 => '[[Aten CS9138 | http://www.aten.com/products/productItem.php?pcid=20070130111936003&psid=20070130133658002&pid=20050224094519006&layerid=subClass2]]');
755 $new_words[] = array (21 => '[[Aten CS1708 | http://www.aten.com/products/productItem.php?pcid=20070130111936003&psid=20070130133658002&pid=2005022410563008&layerid=subClass2]]');
756 $new_words[] = array (21 => '[[Aten CS1716 | http://www.aten.com/products/productItem.php?pcid=20070130111936003&psid=20070130133658002&pid=20050224110022008&layerid=subClass2]]');
757 $new_words[] = array (21 => '[[Aten CS1004 | http://www.aten.com/products/productItem.php?pcid=20070130111936003&psid=20070130133658002&pid=20050224100546008&layerid=subClass2]]');
758 $new_words[] = array (21 => '[[Aten CS228 | http://www.aten.com/products/productItem.php?pcid=20070130111936003&psid=20070130133658002&pid=20050224114323008&layerid=subClass2]]');
759 $new_words[] = array (21 => '[[Aten CS428 | http://www.aten.com/products/productItem.php?pcid=20070130111936003&psid=20070130133658002&pid=20050224114721008&layerid=subClass2]]');
760 $new_words[] = array (21 => '[[Aten CS138A | http://www.aten.com/products/productItem.php?pcid=20070130111936003&psid=20070130133658002&pid=20050224111458007&layerid=subClass2]]');
761 $new_words[] = array (21 => '[[Aten CS88A | http://www.aten.com/products/productItem.php?pcid=20070130111936003&psid=20070130133658002&pid=2005022411042006&layerid=subClass2]]');
762 $new_words[] = array (21 => '[[Aten KM0832 | http://www.aten.com/products/productItem.php?pcid=2005010513171002&psid=20060411131626002&pid=20060628154826001&layerid=subClass1]]');
763 $new_words[] = array (21 => '[[Aten KM0216 | http://www.aten.com/products/productItem.php?pcid=2006041110563001&psid=20060411131626002&pid=20060417153950007&layerid=subClass1]]');
764 $new_words[] = array (21 => '[[Aten KM0432 | http://www.aten.com/products/productItem.php?pcid=2006041110563001&psid=20060411131626002&pid=2006041715359007&layerid=subClass1]]');
765 $new_words[] = array (21 => '[[Aten KH1508 | http://www.aten.com/products/productItem.php?pcid=2006041110563001&psid=20060411130954001&pid=20061101174038001&layerid=subClass1]]');
766 $new_words[] = array (21 => '[[Aten KH1516 | http://www.aten.com/products/productItem.php?pcid=2006041110563001&psid=20060411130954001&pid=20061101175320001&layerid=subClass1]]');
767 $new_words[] = array (21 => '[[Aten KH0116 | http://www.aten.com/products/productItem.php?pcid=2006041110563001&psid=20060411130954001&pid=20060411145734003&layerid=subClass1]]');
768 $new_words[] = array (21 => '[[Aten KH98 | http://www.aten.com/products/productItem.php?pcid=2005010513171002&psid=2007012911116003&pid=20061221104352001&layerid=subClass1]]');
769 $new_words[] = array (23 => '[[Aten KL1100 | http://www.aten.com/products/productItem.php?pcid=2005010513171002&psid=20060411131050002&pid=20071225113046001&layerid=subClass1]]');
770 $new_words[] = array (23 => '[[Aten KL1508 | http://www.aten.com/products/productItem.php?pcid=2006041110563001&psid=20060411131050002&pid=20070710020717009&layerid=subClass1]]');
771 $new_words[] = array (23 => '[[Aten KL1516 | http://www.aten.com/products/productItem.php?pcid=2006041110563001&psid=20060411131050002&pid=20070716232614001&layerid=subClass1]]');
772 $new_words[] = array (23 => '[[Aten KL9108 | http://www.aten.com/products/productItem.php?pcid=2005010513171002&psid=20060411131050002&pid=20060811153413009&layerid=subClass1]]');
773 $new_words[] = array (23 => '[[Aten KL9116 | http://www.aten.com/products/productItem.php?pcid=2006041110563001&psid=20060411131050002&pid=2006081115384001&layerid=subClass1]]');
774 $new_words[] = array (23 => '[[Aten KL3116 | http://www.aten.com/products/productItem.php?pcid=2005010513171002&psid=20060411131050002&pid=20060913162532009&layerid=subClass1]]');
775 $new_words[] = array (23 => '[[Aten KL1116 | http://www.aten.com/products/productItem.php?pcid=2006041110563001&psid=20060411131050002&pid=20060420101520005&layerid=subClass1]]');
776 $new_words[] = array (23 => '[[Aten CS1208DL | http://www.aten.com/products/productItem.php?pcid=2005010513171002&psid=20060411131050002&pid=2005022413505007&layerid=subClass1]]');
777 $new_words[] = array (23 => '[[Aten CS1216DL | http://www.aten.com/products/productItem.php?pcid=2005010513171002&psid=20060411131050002&pid=2005022413505007&layerid=subClass1]]');
778 $new_words[] = array (23 => '[[Aten CS1200L | http://www.aten.com/products/productItem.php?pcid=2005010513171002&psid=20060411131050002&pid=20050224140854008&layerid=subClass1]]');
779 $new_words[] = array (23 => '[[Aten CL1758 | http://www.aten.com/products/productItem.php?pcid=2005010513171002&psid=20060411131050002&pid=20051229164553003&layerid=subClass1]]');
780 $new_words[] = array (23 => '[[Aten CL1208 | http://www.aten.com/products/productItem.php?pcid=2005010513171002&psid=20060411131050002&pid=2005072215482&layerid=subClass1]]');
781 $new_words[] = array (23 => '[[Aten CL1216 | http://www.aten.com/products/productItem.php?pcid=2005010513171002&psid=20060411131050002&pid=2005072215482&layerid=subClass1]]');
782 $new_words[] = array (23 => '[[Aten CL1200 | http://www.aten.com/products/productItem.php?pcid=2005010513171002&psid=20060411131050002&pid=20050722165040002&layerid=subClass1]]');
783 $new_words[] = array (23 => '[[Aten ACS1208AL | http://www.aten.com/products/productItem.php?pcid=2005010513171002&psid=20060411131050002&pid=2005022413597003&layerid=subClass1]]');
784 $new_words[] = array (23 => '[[Aten ACS1216AL | http://www.aten.com/products/productItem.php?pcid=2005010513171002&psid=20060411131050002&pid=2005022413597003&layerid=subClass1]]');
785 $new_words[] = array (22 => '[[Tainet MUXpro 8216 | http://www.tainet.net/Product/muxpro820_8216.htm]]');
786 $new_words[] = array (22 => '[[Tainet Mercury 3600+ | http://www.tainet.net/Product/mercury.htm]]');
787 $new_words[] = array (22 => '[[Tainet Mercury 3820 | http://www.tainet.net/Product/mercury.htm]]');
788 $new_words[] = array (22 => '[[Tainet Mercury 3630 | http://www.tainet.net/Product/mercury.htm]]');
789 $new_words[] = array (22 => '[[Tainet Mercury 3630E | http://www.tainet.net/Product/mercury.htm]]');
790 $new_words[] = array (22 => '[[Tainet DSD-08A | http://www.tainet.net/Product/dsd08a.htm]]');
791 $new_words[] = array (11 => '[[HP ProLiant DL160 | http://h10010.www1.hp.com/wwpc/us/en/en/WF05a/15351-15351-3328412-241644-3328421-3580694.html]]');
792 $new_words[] = array (11 => '[[HP ProLiant DL180 | http://h10010.www1.hp.com/wwpc/us/en/en/WF05a/15351-15351-3328412-241644-3328421-3580698.html]]');
793 $new_words[] = array (11 => '[[HP ProLiant DL185 | http://h10010.www1.hp.com/wwpc/us/en/en/WF05a/15351-15351-3328412-241644-3328421-3579900.html]]');
794 $new_words[] = array (11 => '[[HP ProLiant DL365 | http://h10010.www1.hp.com/wwpc/us/en/en/WF05a/15351-15351-3328412-241644-241475-3186080.html]]');
795 $new_words[] = array (11 => '[[HP ProLiant DL320s | http://h10010.www1.hp.com/wwpc/us/en/en/WF05a/15351-15351-3328412-241644-241475-3232017.html]]');
796 $new_words[] = array (11 => '[[HP ProLiant DL320p | http://h10010.www1.hp.com/wwpc/us/en/en/WF05a/15351-15351-3328412-241644-241475-3579703.html]]');
797 $new_words[] = array (11 => '[[HP ProLiant ML115 | http://h10010.www1.hp.com/wwpc/us/en/en/WF05a/15351-15351-241434-241646-3328424-3330535.html]]');
798 $old_words = array();
799 $old_words[487] = '[[RAD FCD-IPM | http://www.rad.com/Article/0,6583,36426-E1_T1_or_Fractional_E1_T1_Modular_Access_Device_with_Integrated_Router,00.html]]';
800 $old_words[484] = '[[Cronyx FMUX-16-E3 | http://www.cronyx.ru/hardware/fmux16-e3.html]]';
801 $old_words[101] = '[[HP ProLiant DL140 | http://h10010.www1.hp.com/wwpc/us/en/en/WF05a/15351-15351-3328412-241644-3328421-1842838.html]]';
802 $old_words[102] = '[[HP ProLiant DL145 | http://h10010.www1.hp.com/wwpc/us/en/en/WF05a/15351-15351-3328412-241644-3328421-3219755.html]]';
803 $old_words[103] = '[[HP ProLiant DL320 | http://h10010.www1.hp.com/wwpc/us/en/en/WF05a/15351-15351-3328412-241644-241475-3201178.html]]';
804 $old_words[104] = '[[HP ProLiant DL360 | http://h10010.www1.hp.com/wwpc/us/en/en/WF05a/15351-15351-3328412-241644-241475-1121486.html]]';
805 $old_words[105] = '[[HP ProLiant DL380 | http://h10010.www1.hp.com/wwpc/us/en/en/WF05a/15351-15351-3328412-241644-241475-1121516.html]]';
806 $old_words[106] = '[[HP ProLiant DL385 | http://h10010.www1.hp.com/wwpc/us/en/en/WF05a/15351-15351-3328412-241644-241475-3219233.html]]';
807 $old_words[107] = '[[HP ProLiant DL580 | http://h10010.www1.hp.com/wwpc/us/en/en/WF05a/15351-15351-3328412-241644-3328422-3454575.html]]';
808 $old_words[108] = '[[HP ProLiant DL585 | http://h10010.www1.hp.com/wwpc/us/en/en/WF05a/15351-15351-3328412-241644-3328422-3219717.html]]';
809 $old_words[109] = '[[HP ProLiant ML110 | http://h10010.www1.hp.com/wwpc/us/en/en/WF05a/15351-15351-241434-241646-3328424-3577708.html]]';
810 $old_words[110] = '[[HP ProLiant ML150 | http://h10010.www1.hp.com/wwpc/us/en/en/WF05a/15351-15351-241434-241646-3328424-3580609.html]]';
811 $old_words[111] = '[[HP ProLiant ML310 | http://h10010.www1.hp.com/wwpc/us/en/en/WF05a/15351-15351-241434-241646-241477-3580655.html]]';
812 $old_words[112] = '[[HP ProLiant ML350 | http://h10010.www1.hp.com/wwpc/us/en/en/WF05a/15351-15351-241434-241646-241477-1121586.html]]';
813 $old_words[113] = '[[HP ProLiant ML370 | http://h10010.www1.hp.com/wwpc/us/en/en/WF05a/15351-15351-241434-241646-241477-1121474.html]]';
814 $old_words[114] = '[[HP ProLiant ML570 | http://h10010.www1.hp.com/wwpc/us/en/en/WF05a/15351-15351-241434-241646-3328425-1842779.html]]';
815 foreach ($old_words as $dict_key => $dict_value)
816 $query[] = "update Dictionary set dict_value = '${dict_value}' where dict_key = ${dict_key} limit 1";
817 foreach ($new_words as $dict_key => $tmp)
818 foreach ($tmp as $chapter_no => $dict_value)
819 $query[] = 'INSERT INTO `Dictionary` (`chapter_no`, `dict_key`, `dict_value`) ' .
820 "VALUES (${chapter_no}, ${dict_key}, '${dict_value}')";
821 $query[] = "alter database character set utf8";
822 $query[] = "update Config set varvalue = '0.14.12' where varname = 'DB_VERSION'";
823 break; // --------------------------------------------
824 case '0.15.0':
825 $new_words[541] = array (12 => '[[Force10%GPASS%S2410CP | http://www.force10networks.com/products/s2410.asp]]');
826 $new_words[] = array (12 => '[[Force10%GPASS%S50N | http://www.force10networks.com/products/s50n.asp]]');
827 $new_words[] = array (12 => '[[Force10%GPASS%S50V | http://www.force10networks.com/products/s50v.asp]]');
828 $new_words[] = array (12 => '[[Force10%GPASS%S25P | http://www.force10networks.com/products/s25p.asp]]');
829 $new_words[] = array (12 => '[[Force10%GPASS%C150| http://www.force10networks.com/products/cseries.asp]]');
830 $new_words[] = array (12 => '[[Force10%GPASS%C300| http://www.force10networks.com/products/cseries.asp]]');
831 $new_words[] = array (12 => '[[Force10%GPASS%E300 | http://www.force10networks.com/products/eseries.asp]]');
832 $new_words[] = array (12 => '[[Force10%GPASS%E600 | http://www.force10networks.com/products/eseries.asp]]');
833 $new_words[] = array (12 => '[[Force10%GPASS%E1200 | http://www.force10networks.com/products/eseries.asp]]');
834 $new_words[] = array (12 => '[[NETGEAR%GPASS%JGS524F | http://www.netgear.com/Products/Switches/UnmanagedSwitches/JGS524F.aspx]]');
835 $new_words[] = array (12 => '[[NETGEAR%GPASS%JGS516 | http://www.netgear.com/Products/Switches/UnmanagedSwitches/JGS516.aspx]]');
836 $new_words[] = array (12 => '[[NETGEAR%GPASS%JFS524 | http://www.netgear.com/Products/Switches/UnmanagedSwitches/JFS524.aspx]]');
837 $new_words[] = array (12 => '[[NETGEAR%GPASS%JFS524F | http://www.netgear.com/Products/Switches/UnmanagedSwitches/JFS524F.aspx]]');
838 $new_words[] = array (12 => '[[NETGEAR%GPASS%JGS524 | http://www.netgear.com/Products/Switches/UnmanagedSwitches/JGS524.aspx]]');
839 $new_words[] = array (12 => '[[NETGEAR%GPASS%FS524 | http://www.netgear.com/Products/Switches/UnmanagedSwitches/FS524.aspx]]');
840 $new_words[] = array (12 => '[[NETGEAR%GPASS%JFS516 | http://www.netgear.com/Products/Switches/UnmanagedSwitches/JFS516.aspx]]');
841 $new_words[] = array (12 => '[[NETGEAR%GPASS%GSM7224R | http://www.netgear.com/Products/Switches/Layer2ManagedSwitches/GSM7224R.aspx]]');
842 $new_words[] = array (12 => '[[NETGEAR%GPASS%GSM7248 | http://www.netgear.com/Products/Switches/Layer2ManagedSwitches/GSM7248.aspx]]');
843 $new_words[] = array (12 => '[[NETGEAR%GPASS%GSM7212 | http://www.netgear.com/Products/Switches/Layer2ManagedSwitches/GSM7212.aspx]]');
844 $new_words[] = array (12 => '[[NETGEAR%GPASS%FSM726S | http://www.netgear.com/Products/Switches/Layer2ManagedSwitches/FSM726S.aspx]]');
845 $new_words[] = array (12 => '[[NETGEAR%GPASS%GSM7248R | http://www.netgear.com/Products/Switches/Layer2ManagedSwitches/GSM7248R.aspx]]');
846 $new_words[] = array (12 => '[[NETGEAR%GPASS%GSM7224 | http://www.netgear.com/Products/Switches/Layer2ManagedSwitches/GSM7224.aspx]]');
847 $new_words[] = array (12 => '[[NETGEAR%GPASS%FSM750S | http://www.netgear.com/Products/Switches/Layer2ManagedSwitches/FSM750S.aspx]]');
848 $new_words[] = array (12 => '[[NETGEAR%GPASS%FSM726 | http://www.netgear.com/Products/Switches/Layer2ManagedSwitches/FSM726.aspx]]');
849 $new_words[] = array (12 => '[[NETGEAR%GPASS%GS724TP | http://www.netgear.com/Products/Switches/SmartSwitches/GS724TP.aspx]]');
850 $new_words[] = array (12 => '[[NETGEAR%GPASS%GS748TS | http://www.netgear.com/Products/Switches/SmartSwitches/GS748TS.aspx]]');
851 $new_words[] = array (12 => '[[NETGEAR%GPASS%GS724T | http://www.netgear.com/Products/Switches/SmartSwitches/GS724T.aspx]]');
852 $new_words[] = array (12 => '[[NETGEAR%GPASS%FS728TP | http://www.netgear.com/Products/Switches/SmartSwitches/FS728TP.aspx]]');
853 $new_words[] = array (12 => '[[NETGEAR%GPASS%FS752TS | http://www.netgear.com/Products/Switches/SmartSwitches/FS752TS.aspx]]');
854 $new_words[] = array (12 => '[[NETGEAR%GPASS%FS728TS | http://www.netgear.com/Products/Switches/SmartSwitches/FS728TS.aspx]]');
855 $new_words[] = array (12 => '[[NETGEAR%GPASS%FS726T | http://www.netgear.com/Products/Switches/SmartSwitches/FS726T.aspx]]');
856 $new_words[] = array (12 => '[[NETGEAR%GPASS%GS748TP | http://www.netgear.com/Products/Switches/SmartSwitches/GS748TP.aspx]]');
857 $new_words[] = array (12 => '[[NETGEAR%GPASS%GS724TS | http://www.netgear.com/Products/Switches/SmartSwitches/GS724TS.aspx]]');
858 $new_words[] = array (12 => '[[NETGEAR%GPASS%GS748T | http://www.netgear.com/Products/Switches/SmartSwitches/GS748T.aspx]]');
859 $new_words[] = array (12 => '[[NETGEAR%GPASS%GS716T | http://www.netgear.com/Products/Switches/SmartSwitches/GS716T.aspx]]');
860 $new_words[] = array (12 => '[[NETGEAR%GPASS%FS752TPS | http://www.netgear.com/Products/Switches/SmartSwitches/FS752TPS.aspx]]');
861 $new_words[] = array (12 => '[[NETGEAR%GPASS%FS750T2 | http://www.netgear.com/Products/Switches/SmartSwitches/FS750T2.aspx]]');
862 $new_words[] = array (12 => '[[NETGEAR%GPASS%FS726TP | http://www.netgear.com/Products/Switches/SmartSwitches/FS726TP.aspx]]');
863 $new_words[] = array (12 => '[[NETGEAR%GPASS%FSM7328PS | http://www.netgear.com/Products/Switches/Layer3ManagedSwitches/FSM7328PS.aspx]]');
864 $new_words[] = array (12 => '[[NETGEAR%GPASS%GSM7352S | http://www.netgear.com/Products/Switches/Layer3ManagedSwitches/GSM7352S.aspx]]');
865 $new_words[] = array (12 => '[[NETGEAR%GPASS%GSM7324 | http://www.netgear.com/Products/Switches/Layer3ManagedSwitches/GSM7324.aspx]]');
866 $new_words[] = array (12 => '[[NETGEAR%GPASS%FSM7326P | http://www.netgear.com/Products/Switches/Layer3ManagedSwitches/FSM7326P.aspx]]');
867 $new_words[] = array (12 => '[[NETGEAR%GPASS%FSM7352PS | http://www.netgear.com/Products/Switches/Layer3ManagedSwitches/FSM7352PS.aspx]]');
868 $new_words[] = array (12 => '[[NETGEAR%GPASS%GSM7328FS | http://www.netgear.com/Products/Switches/Layer3ManagedSwitches/GSM7328FS.aspx]]');
869 $new_words[] = array (12 => '[[NETGEAR%GPASS%GSM7328S | http://www.netgear.com/Products/Switches/Layer3ManagedSwitches/GSM7328S.aspx]]');
870 $new_words[] = array (12 => '[[NETGEAR%GPASS%GSM7312 | http://www.netgear.com/Products/Switches/Layer3ManagedSwitches/GSM7312.aspx]]');
871 $new_words[] = array (12 => '[[NETGEAR%GPASS%FSM7328S | http://www.netgear.com/Products/Switches/Layer3ManagedSwitches/FSM7328S.aspx]]');
872 $new_words[] = array (12 => '[[NETGEAR%GPASS%FSM7352S | http://www.netgear.com/Products/Switches/Layer3ManagedSwitches/FSM7352S.aspx]]');
873 $new_words[] = array (12 => '[[D-Link%GPASS%DES-6500 | http://www.dlink.com/products/?sec=0&pid=341]]');
874 $new_words[] = array (12 => '[[D-Link%GPASS%DWS-3227 | http://www.dlink.com/products/?sec=0&pid=506]]');
875 $new_words[] = array (12 => '[[D-Link%GPASS%DWS-3227P | http://www.dlink.com/products/?sec=0&pid=507]]');
876 $new_words[] = array (12 => '[[D-Link%GPASS%DWS-3250 | http://www.dlink.com/products/?sec=0&pid=468]]');
877 $new_words[] = array (12 => '[[D-Link%GPASS%DWS-1008 | http://www.dlink.com/products/?sec=0&pid=434]]');
878 $new_words[] = array (12 => '[[D-Link%GPASS%DGS-3612G | http://www.dlink.com/products/?sec=0&pid=557]]');
879 $new_words[] = array (12 => '[[D-Link%GPASS%DGS-3627 | http://www.dlink.com/products/?sec=0&pid=639]]');
880 $new_words[] = array (12 => '[[D-Link%GPASS%DGS-3650 | http://www.dlink.com/products/?sec=0&pid=640]]');
881 $new_words[] = array (12 => '[[D-Link%GPASS%DGS-3324SR | http://www.dlink.com/products/?sec=0&pid=294]]');
882 $new_words[] = array (12 => '[[D-Link%GPASS%DGS-3324SRi | http://www.dlink.com/products/?sec=0&pid=309]]');
883 $new_words[] = array (12 => '[[D-Link%GPASS%DXS-3326GSR | http://www.dlink.com/products/?sec=0&pid=339]]');
884 $new_words[] = array (12 => '[[D-Link%GPASS%DXS-3350SR | http://www.dlink.com/products/?sec=0&pid=340]]');
885 $new_words[] = array (12 => '[[D-Link%GPASS%DES-3828 | http://www.dlink.com/products/?sec=0&pid=439]]');
886 $new_words[] = array (12 => '[[D-Link%GPASS%DES-3828P | http://www.dlink.com/products/?sec=0&pid=440]]');
887 $new_words[] = array (12 => '[[D-Link%GPASS%DGS-3100-24 | http://www.dlink.com/products/?sec=0&pid=635]]');
888 $new_words[] = array (12 => '[[D-Link%GPASS%DGS-3100-24P | http://www.dlink.com/products/?sec=0&pid=636]]');
889 $new_words[] = array (12 => '[[D-Link%GPASS%DGS-3100-48 | http://www.dlink.com/products/?sec=0&pid=637]]');
890 $new_words[] = array (12 => '[[D-Link%GPASS%DGS-3100-48P | http://www.dlink.com/products/?sec=0&pid=638]]');
891 $new_words[] = array (12 => '[[D-Link%GPASS%DXS-3227 | http://www.dlink.com/products/?sec=0&pid=483]]');
892 $new_words[] = array (12 => '[[D-Link%GPASS%DXS-3227P | http://www.dlink.com/products/?sec=0&pid=497]]');
893 $new_words[] = array (12 => '[[D-Link%GPASS%DXS-3250 | http://www.dlink.com/products/?sec=0&pid=443]]');
894 $new_words[] = array (12 => '[[D-Link%GPASS%DGS-3024 | http://www.dlink.com/products/?sec=0&pid=404]]');
895 $new_words[] = array (12 => '[[D-Link%GPASS%DGS-3224TGR | http://www.dlink.com/products/?sec=0&pid=269]]');
896 $new_words[] = array (12 => '[[D-Link%GPASS%DGS-3048 | http://www.dlink.com/products/?sec=0&pid=496]]');
897 $new_words[] = array (12 => '[[D-Link%GPASS%DES-3228PA | http://www.dlink.com/products/?sec=0&pid=644]]');
898 $new_words[] = array (12 => '[[D-Link%GPASS%DES-3028 | http://www.dlink.com/products/?sec=0&pid=630]]');
899 $new_words[] = array (12 => '[[D-Link%GPASS%DES-3028P | http://www.dlink.com/products/?sec=0&pid=631]]');
900 $new_words[] = array (12 => '[[D-Link%GPASS%DES-3052 | http://www.dlink.com/products/?sec=0&pid=632]]');
901 $new_words[] = array (12 => '[[D-Link%GPASS%DES-3052P | http://www.dlink.com/products/?sec=0&pid=633]]');
902 $new_words[] = array (12 => '[[D-Link%GPASS%DES-3010FA | http://www.dlink.com/products/?sec=0&pid=423]]');
903 $new_words[] = array (12 => '[[D-Link%GPASS%DES-3010GA | http://www.dlink.com/products/?sec=0&pid=424]]');
904 $new_words[] = array (12 => '[[D-Link%GPASS%DES-3010PA | http://www.dlink.com/products/?sec=0&pid=469]]');
905 $new_words[] = array (12 => '[[D-Link%GPASS%DES-3226L | http://www.dlink.com/products/?sec=0&pid=298]]');
906 $new_words[] = array (12 => '[[D-Link%GPASS%DES-3526 | http://www.dlink.com/products/?sec=0&pid=330]]');
907 $new_words[] = array (12 => '[[D-Link%GPASS%DES-3550 | http://www.dlink.com/products/?sec=0&pid=331]]');
908 $new_words[] = array (12 => '[[D-Link%GPASS%DGS-1216T | http://www.dlink.com/products/?sec=0&pid=324]]');
909 $new_words[] = array (12 => '[[D-Link%GPASS%DGS-1224T | http://www.dlink.com/products/?sec=0&pid=329]]');
910 $new_words[] = array (12 => '[[D-Link%GPASS%DGS-1248T | http://www.dlink.com/products/?sec=0&pid=367]]');
911 $new_words[] = array (12 => '[[D-Link%GPASS%DES-1316 | http://www.dlink.com/products/?sec=0&pid=353]]');
912 $new_words[] = array (12 => '[[D-Link%GPASS%DES-1228 | http://www.dlink.com/products/?sec=0&pid=540]]');
913 $new_words[] = array (12 => '[[D-Link%GPASS%DES-1228P | http://www.dlink.com/products/?sec=0&pid=541]]');
914 $new_words[] = array (12 => '[[D-Link%GPASS%DES-1252 | http://www.dlink.com/products/?sec=0&pid=555]]');
915 $new_words[] = array (12 => '[[D-Link%GPASS%DGS-1016D | http://www.dlink.com/products/?sec=0&pid=337]]');
916 $new_words[] = array (12 => '[[D-Link%GPASS%DGS-1024D | http://www.dlink.com/products/?sec=0&pid=338]]');
917 $new_words[] = array (12 => '[[D-Link%GPASS%DSS-24+ | http://www.dlink.com/products/?sec=0&pid=73]]');
918 $new_words[] = array (12 => '[[D-Link%GPASS%DES-1024D | http://www.dlink.com/products/?sec=0&pid=75]]');
919 $new_words[] = array (12 => '[[D-Link%GPASS%DES-1026G | http://www.dlink.com/products/?sec=0&pid=76]]');
920 $new_words[] = array (21 => '[[D-Link%GPASS%DKVM-16 | http://www.dlink.com/products/?sec=0&pid=228]]');
921 $new_words[] = array (21 => '[[D-Link%GPASS%DKVM-8E | http://www.dlink.com/products/?sec=0&pid=161]]');
922 $new_words[] = array (22 => '[[Raisecom%GPASS%RC702 | http://www.raisecom-international.com/p/RC702.htm]]');
923 $new_words[] = array (22 => '[[Raisecom%GPASS%RC702-GE | http://www.raisecom-international.com/p/RC702GE.htm]]');
924 $new_words[] = array (22 => '[[Raisecom%GPASS%ISCOM4300 | http://www.raisecom-international.com/p/ISCOM4300.htm]]');
925 $new_words[] = array (22 => '[[Raisecom%GPASS%RC953-FE4E1 | http://www.raisecom-international.com/p/RC953FE4E1.htm]]');
926 $new_words[] = array (22 => '[[Raisecom%GPASS%RC953-FX4E1 | http://www.raisecom-international.com/p/RC953FE4E1.htm]]');
927 $new_words[] = array (22 => '[[Raisecom%GPASS%RC953-FE8E1 | http://www.raisecom-international.com/p/RC953FE4E1.htm]]');
928 $new_words[] = array (22 => '[[Raisecom%GPASS%RC953-FX8E1 | http://www.raisecom-international.com/p/RC953FE4E1.htm]]');
929 $new_words[] = array (22 => '[[Raisecom%GPASS%RC953-8FE16E1 | http://www.raisecom-international.com/p/RC9538FE16E1.htm]]');
930 $new_words[] = array (22 => '[[Raisecom%GPASS%RC953E-3FE16E1 | http://www.raisecom-international.com/p/RC953E-3FE16E1.htm]]');
931 $new_words[] = array (22 => '[[Raisecom%GPASS%RC953-GESTM1 | http://www.raisecom-international.com/p/RC957.htm]]');
932 $new_words[] = array (22 => '[[Raisecom%GPASS%OPCOM3100-155 | http://www.raisecom-international.com/p/OPCOM3100.htm]]');
933 $new_words[] = array (22 => '[[Raisecom%GPASS%OPCOM3101-155 | http://www.raisecom-international.com/p/OPCOM3101.htm]]');
934 $new_words[] = array (22 => '[[Raisecom%GPASS%RC831-120 | http://www.raisecom-international.com/p/RC831.htm]]');
935 $new_words[] = array (22 => '[[Raisecom%GPASS%RC831-120-BL | http://www.raisecom-international.com/p/RC831.htm]]');
936 $new_words[] = array (22 => '[[Raisecom%GPASS%RC831-240 | http://www.raisecom-international.com/p/RC831.htm]]');
937 $new_words[] = array (22 => '[[Raisecom%GPASS%RC831-240E | http://www.raisecom-international.com/p/RC831.htm]]');
938 $new_words[] = array (22 => '[[Raisecom%GPASS%RCMS2801-480GE-BL | http://www.raisecom-international.com/p/RCMS280X.htm]]');
939 $new_words[] = array (22 => '[[Raisecom%GPASS%RCMS2801-120FE | http://www.raisecom-international.com/p/RCMS2801.htm]]');
940 $new_words[] = array (22 => '[[Raisecom%GPASS%RCMS2801-120FE-BL | http://www.raisecom-international.com/p/RCMS2801.htm]]');
941 $new_words[] = array (22 => '[[Raisecom%GPASS%RCMS2801-240FE | http://www.raisecom-international.com/p/RCMS2801.htm]]');
942 $new_words[] = array (22 => '[[Raisecom%GPASS%RCMS2801-240FE-BL | http://www.raisecom-international.com/p/RCMS2801.htm]]');
943 $new_words[] = array (22 => '[[Raisecom%GPASS%RCMS2801-240EFE | http://www.raisecom-international.com/p/RCMS2801.htm]]');
944 $new_words[] = array (22 => '[[Raisecom%GPASS%RCMS2811-120FE | http://www.raisecom-international.com/p/RCMS2811.htm]]');
945 $new_words[] = array (22 => '[[Raisecom%GPASS%RCMS2811-240FE | http://www.raisecom-international.com/p/RCMS2811.htm]]');
946 $new_words[] = array (22 => '[[Raisecom%GPASS%RCMS2811-240FE-BL | http://www.raisecom-international.com/p/RCMS2811.htm]]');
947 $new_words[] = array (22 => '[[Raisecom%GPASS%RCMS2811-480FE | http://www.raisecom-international.com/p/RCMS2811.htm]]');
948 $new_words[] = array (22 => '[[Raisecom%GPASS%RCMS2811-480FE-BL | http://www.raisecom-international.com/p/RCMS2811.htm]]');
949 $new_words[] = array (22 => '[[Raisecom%GPASS%RCMS2811-240EFE | http://www.raisecom-international.com/p/RCMS2811-240EFE.htm]]');
950 $new_words[] = array (22 => '[[Raisecom%GPASS%RCMS2104-120 | http://www.raisecom-international.com/p/RCMS2000120.htm]]');
951 $new_words[] = array (22 => '[[Raisecom%GPASS%RCMS2304-120 | http://www.raisecom-international.com/p/RCMS2000120.htm]]');
952 $new_words[] = array (22 => '[[Raisecom%GPASS%RCMS2504-120 | http://www.raisecom-international.com/p/RCMS2000120.htm]]');
953 $new_words[] = array (22 => '[[Raisecom%GPASS%RCMS2104-240 | http://www.raisecom-international.com/p/RCMS2000120.htm]]');
954 $new_words[] = array (22 => '[[Raisecom%GPASS%RCMS2304-240 | http://www.raisecom-international.com/p/RCMS2000120.htm]]');
955 $new_words[] = array (22 => '[[Raisecom%GPASS%RCMS2504-240 | http://www.raisecom-international.com/p/RCMS2000120.htm]]');
956 $new_words[] = array (22 => '[[Raisecom%GPASS%RC801-120B | http://www.raisecom-international.com/p/RC800120.htm]]');
957 $new_words[] = array (22 => '[[Raisecom%GPASS%RC801-240B | http://www.raisecom-international.com/p/RC800120.htm]]');
958 $new_words[] = array (22 => '[[Raisecom%GPASS%RC801-480B | http://www.raisecom-international.com/p/RC800120.htm]]');
959 $new_words[] = array (22 => '[[Raisecom%GPASS%RC803-120B | http://www.raisecom-international.com/p/RC800120.htm]]');
960 $new_words[] = array (22 => '[[Raisecom%GPASS%RC803-240B | http://www.raisecom-international.com/p/RC800120.htm]]');
961 $new_words[] = array (22 => '[[Raisecom%GPASS%RC803-480B | http://www.raisecom-international.com/p/RC800120.htm]]');
962 $new_words[] = array (22 => '[[Raisecom%GPASS%RC805-120B | http://www.raisecom-international.com/p/RC800120.htm]]');
963 $new_words[] = array (22 => '[[Raisecom%GPASS%RC805-240B | http://www.raisecom-international.com/p/RC800120.htm]]');
964 $new_words[] = array (22 => '[[Raisecom%GPASS%RC805-480B | http://www.raisecom-international.com/p/RC800120.htm]]');
965 $new_words[] = array (2 => 'async serial (DB-9)'); // 681
966 $new_words[] = array (2 => 'async serial (DB-25)'); // 682
967 $new_words[] = array (12 => '[[Force10%GPASS%S2410P | http://www.force10networks.com/products/s2410.asp]]');
968 $new_words[] = array (12 => '[[Extreme Networks%GPASS%Summit X150-24t | http://www.extremenetworks.com/products/summit-x150.aspx]]');
969 $new_words[] = array (12 => '[[Extreme Networks%GPASS%Summit X150-48t | http://www.extremenetworks.com/products/summit-x150.aspx]]');
970 $new_words[] = array (12 => '[[Extreme Networks%GPASS%Summit X150-24p | http://www.extremenetworks.com/products/summit-x150.aspx]]');
971 $new_words[] = array (12 => '[[Extreme Networks%GPASS%Summit X250e-24t | http://www.extremenetworks.com/products/summit-x250e.aspx]]');
972 $new_words[] = array (12 => '[[Extreme Networks%GPASS%Summit X250e-48t | http://www.extremenetworks.com/products/summit-x250e.aspx]]');
973 $new_words[] = array (12 => '[[Extreme Networks%GPASS%Summit X250e-24p | http://www.extremenetworks.com/products/summit-x250e.aspx]]');
974 $new_words[] = array (12 => '[[Extreme Networks%GPASS%Summit X250e-48p | http://www.extremenetworks.com/products/summit-x250e.aspx]]');
975 $new_words[] = array (12 => '[[Extreme Networks%GPASS%Summit X250e-24x | http://www.extremenetworks.com/products/summit-x250e.aspx]]');
976 $new_words[] = array (12 => '[[Extreme Networks%GPASS%Summit X450-24t | http://www.extremenetworks.com/products/summit-x450.aspx]]');
977 $new_words[] = array (12 => '[[Extreme Networks%GPASS%Summit X450-24x | http://www.extremenetworks.com/products/summit-x450.aspx]]');
978 $new_words[] = array (12 => '[[Extreme Networks%GPASS%Summit X450a-24t | http://www.extremenetworks.com/products/summit-x450a.aspx]]');
979 $new_words[] = array (12 => '[[Extreme Networks%GPASS%Summit X450a-48t | http://www.extremenetworks.com/products/summit-x450a.aspx]]');
980 $new_words[] = array (12 => '[[Extreme Networks%GPASS%Summit X450a-24x | http://www.extremenetworks.com/products/summit-x450a.aspx]]');
981 $new_words[] = array (12 => '[[Extreme Networks%GPASS%Summit X450e-24p | http://www.extremenetworks.com/products/summit-x450e.aspx]]');
982 $new_words[] = array (12 => '[[Extreme Networks%GPASS%Summit X450e-48p | http://www.extremenetworks.com/products/summit-x450e.aspx]]');
983 $new_words[] = array (12 => '[[Extreme Networks%GPASS%Summit 200-24fx | http://www.extremenetworks.com/products/summit-200.aspx]]');
984 $new_words[] = array (12 => '[[Extreme Networks%GPASS%Summit 200-24 | http://www.extremenetworks.com/products/summit-200.aspx]]');
985 $new_words[] = array (12 => '[[Extreme Networks%GPASS%Summit 200-48 | http://www.extremenetworks.com/products/summit-200.aspx]]');
986 $new_words[] = array (12 => '[[Extreme Networks%GPASS%Summit 300-24 | http://www.extremenetworks.com/products/summit-300.aspx]]');
987 $new_words[] = array (12 => '[[Extreme Networks%GPASS%Summit 300-48 | http://www.extremenetworks.com/products/summit-300.aspx]]');
988 $new_words[] = array (12 => '[[Extreme Networks%GPASS%Summit 400-24p | http://www.extremenetworks.com/products/summit-400-24p.aspx]]');
989 $new_words[] = array (12 => '[[Extreme Networks%GPASS%Summit 400-24t | http://www.extremenetworks.com/products/summit-400-24t.aspx]]');
990 $new_words[] = array (12 => '[[Extreme Networks%GPASS%Summit 400-48t | http://www.extremenetworks.com/products/summit-400-48t.aspx]]');
991 $new_words[] = array (12 => '[[Extreme Networks%GPASS%Summit48si | http://www.extremenetworks.com/products/summit-48si.aspx]]');
992 $new_words[] = array (12 => '[[Extreme Networks%GPASS%Alpine 3804 | http://www.extremenetworks.com/products/Alpine-3800.aspx]]');
993 $new_words[] = array (12 => '[[Extreme Networks%GPASS%Alpine 3808 | http://www.extremenetworks.com/products/Alpine-3800.aspx]]');
994 $new_words[] = array (12 => '[[Extreme Networks%GPASS%BlackDiamond 6808 | http://www.extremenetworks.com/products/blackdiamond-6800.aspx]]');
995 $new_words[] = array (12 => '[[Extreme Networks%GPASS%BlackDiamond 8806 | http://www.extremenetworks.com/products/blackdiamond-8800.aspx]]');
996 $new_words[] = array (12 => '[[Extreme Networks%GPASS%BlackDiamond 8810 | http://www.extremenetworks.com/products/blackdiamond-8800.aspx]]');
997 $new_words[] = array (12 => '[[Extreme Networks%GPASS%BlackDiamond 10808 | http://www.extremenetworks.com/products/blackdiamond-10808.aspx]]');
998 $new_words[] = array (12 => '[[Extreme Networks%GPASS%BlackDiamond 12802R | http://www.extremenetworks.com/products/blackdiamond-12800r.aspx]]');
999 $new_words[] = array (12 => '[[Extreme Networks%GPASS%BlackDiamond 12804R | http://www.extremenetworks.com/products/blackdiamond-12800r.aspx]]');
1000 $new_words[] = array (12 => '[[Extreme Networks%GPASS%BlackDiamond 12804C | http://www.extremenetworks.com/products/blackdiamond-12804c.aspx]]');
1001 $new_words[] = array (17 => '[[Cisco%GPASS%ASR 1002 | http://cisco.com/en/US/products/ps9436/index.html]]');
1002 $new_words[] = array (17 => '[[Cisco%GPASS%ASR 1004 | http://cisco.com/en/US/products/ps9437/index.html]]');
1003 $new_words[] = array (17 => '[[Cisco%GPASS%ASR 1006 | http://cisco.com/en/US/products/ps9438/index.html]]');
1004 $new_words[] = array (13 => '[[BSD%GSKIP%OpenBSD 3.3 | http://openbsd.org/33.html]]');
1005 $new_words[] = array (13 => '[[BSD%GSKIP%OpenBSD 3.4 | http://openbsd.org/34.html]]');
1006 $new_words[] = array (13 => '[[BSD%GSKIP%OpenBSD 3.5 | http://openbsd.org/35.html]]');
1007 $new_words[] = array (13 => '[[BSD%GSKIP%OpenBSD 3.6 | http://openbsd.org/36.html]]');
1008 $new_words[] = array (13 => '[[BSD%GSKIP%OpenBSD 3.7 | http://openbsd.org/37.html]]');
1009 $new_words[] = array (13 => '[[BSD%GSKIP%OpenBSD 3.8 | http://openbsd.org/38.html]]');
1010 $new_words[] = array (13 => '[[BSD%GSKIP%OpenBSD 3.9 | http://openbsd.org/39.html]]');
1011 $new_words[] = array (13 => '[[BSD%GSKIP%OpenBSD 4.0 | http://openbsd.org/40.html]]');
1012 $new_words[] = array (13 => '[[BSD%GSKIP%OpenBSD 4.1 | http://openbsd.org/41.html]]');
1013 $new_words[] = array (13 => '[[BSD%GSKIP%OpenBSD 4.2 | http://openbsd.org/42.html]]');
1014 $new_words[] = array (13 => '[[BSD%GSKIP%OpenBSD 4.3 | http://openbsd.org/43.html]]');
1015 $new_words[] = array (12 => '[[Cisco Catalyst 4900M | http://www.cisco.com/en/US/products/ps9310/index.html]]');
1016 $new_words[] = array (13 => '[[BSD%GSKIP%FreeBSD 7.x | http://www.freebsd.org/releases/7.0R/announce.html]]');
1017 $new_words[] = array (13 => '[[BSD%GSKIP%NetBSD 2.0 | http://netbsd.org/releases/formal-2.0/]]');
1018 $new_words[] = array (13 => '[[BSD%GSKIP%NetBSD 2.1 | http://netbsd.org/releases/formal-2.0/NetBSD-2.1.html]]');
1019 $new_words[] = array (13 => '[[BSD%GSKIP%NetBSD 3.0 | http://netbsd.org/releases/formal-3/]]');
1020 $new_words[] = array (13 => '[[BSD%GSKIP%NetBSD 3.1 | http://netbsd.org/releases/formal-3/NetBSD-3.1.html]]');
1021 $new_words[] = array (13 => '[[BSD%GSKIP%NetBSD 4.0 | http://netbsd.org/releases/formal-4/NetBSD-4.0.html]]');
1022 $new_words[] = array (12 => '[[3Com%GPASS%Baseline 2016 | http://www.3com.com/products/en_US/detail.jsp?tab=features&pathtype=purchase&sku=3C16470B]]');
1023 $new_words[] = array (12 => '[[3Com%GPASS%Baseline 2024 | http://www.3com.com/products/en_US/detail.jsp?tab=features&pathtype=purchase&sku=3C16471B]]');
1024 $new_words[] = array (12 => '[[3Com%GPASS%Baseline 2126-G | http://www.3com.com/products/en_US/detail.jsp?tab=features&pathtype=purchase&sku=3C16472]]');
1025 $new_words[] = array (12 => '[[3Com%GPASS%Baseline 2816 | http://www.3com.com/products/en_US/detail.jsp?tab=features&pathtype=purchase&sku=3C16478]]');
1026 $new_words[] = array (12 => '[[3Com%GPASS%Baseline 2824 | http://www.3com.com/products/en_US/detail.jsp?tab=features&pathtype=purchase&sku=3C16479]]');
1027 $new_words[] = array (12 => '[[3Com%GPASS%Baseline 2226 Plus | http://www.3com.com/products/en_US/detail.jsp?tab=features&pathtype=purchase&sku=3C16475CS]]');
1028 $new_words[] = array (12 => '[[3Com%GPASS%Baseline 2426-PWR Plus | http://www.3com.com/products/en_US/detail.jsp?tab=features&pathtype=purchase&sku=3C16491]]');
1029 $new_words[] = array (12 => '[[3Com%GPASS%Baseline 2250 Plus | http://www.3com.com/products/en_US/detail.jsp?tab=features&pathtype=purchase&sku=3C16476CS]]');
1030 $new_words[] = array (12 => '[[3Com%GPASS%Baseline 2916-SFP Plus | http://www.3com.com/products/en_US/detail.jsp?tab=features&pathtype=purchase&sku=3CBLSG16]]');
1031 $new_words[] = array (12 => '[[3Com%GPASS%Baseline 2924-SFP Plus | http://www.3com.com/products/en_US/detail.jsp?tab=features&pathtype=purchase&sku=3CBLSG24]]');
1032 $new_words[] = array (12 => '[[3Com%GPASS%Baseline 2924-PWR Plus | http://www.3com.com/products/en_US/detail.jsp?tab=features&pathtype=purchase&sku=3CBLSG24PWR]]');
1033 $new_words[] = array (12 => '[[3Com%GPASS%Baseline 2948-SFP Plus | http://www.3com.com/products/en_US/detail.jsp?tab=features&pathtype=purchase&sku=3CBLSG48]]');
1034 $new_words[] = array (12 => '[[3Com%GPASS%3870 24-port | http://www.3com.com/products/en_US/detail.jsp?tab=features&pathtype=purchase&sku=3CR17450-91]]');
1035 $new_words[] = array (12 => '[[3Com%GPASS%3870 48-port | http://www.3com.com/products/en_US/detail.jsp?tab=features&pathtype=purchase&sku=3CR17451-91]]');
1036 $new_words[] = array (12 => '[[3Com%GPASS%4200 26-port | http://www.3com.com/products/en_US/detail.jsp?tab=features&sku=3C17300A&pathtype=purchase]]');
1037 $new_words[] = array (12 => '[[3Com%GPASS%4200 28-port | http://www.3com.com/products/en_US/detail.jsp?tab=features&sku=3C17304A&pathtype=purchase]]');
1038 $new_words[] = array (12 => '[[3Com%GPASS%4200 50-port | http://www.3com.com/products/en_US/detail.jsp?tab=features&sku=3C17302A&pathtype=purchase]]');
1039 $new_words[] = array (12 => '[[3Com%GPASS%4200G 12-port | http://www.3com.com/products/en_US/detail.jsp?tab=features&sku=3CR17660-91&pathtype=purchase]]');
1040 $new_words[] = array (12 => '[[3Com%GPASS%4200G 24-port | http://www.3com.com/products/en_US/detail.jsp?tab=features&sku=3CR17661-91&pathtype=purchase]]');
1041 $new_words[] = array (12 => '[[3Com%GPASS%4200G PWR 24-port | http://www.3com.com/products/en_US/detail.jsp?tab=features&sku=3CR17671-91&pathtype=purchase]]');
1042 $new_words[] = array (12 => '[[3Com%GPASS%4200G 48-port | http://www.3com.com/products/en_US/detail.jsp?tab=features&sku=3CR17662-91&pathtype=purchase]]');
1043 $new_words[] = array (12 => '[[3Com%GPASS%4210 26-port | http://www.3com.com/products/en_US/detail.jsp?tab=features&pathtype=purchase&sku=3CR17333-91]]');
1044 $new_words[] = array (12 => '[[3Com%GPASS%4210 52-port | http://www.3com.com/products/en_US/detail.jsp?tab=features&pathtype=purchase&sku=3CR17334-91]]');
1045 $new_words[] = array (12 => '[[3Com%GPASS%4210 26-port PWR | http://www.3com.com/products/en_US/detail.jsp?tab=features&pathtype=purchase&sku=3CR17343-91]]');
1046 $new_words[] = array (12 => '[[3Com%GPASS%SS3 4400 48-port | http://www.3com.com/products/en_US/detail.jsp?tab=features&pathtype=purchase&sku=3C17204-US]]');
1047 $new_words[] = array (12 => '[[3Com%GPASS%SS3 4400 24-port | http://www.3com.com/products/en_US/detail.jsp?tab=features&pathtype=purchase&sku=3C17203-US]]');
1048 $new_words[] = array (12 => '[[3Com%GPASS%SS3 4400 PWR | http://www.3com.com/products/en_US/detail.jsp?tab=features&pathtype=purchase&sku=3C17205-US]]');
1049 $new_words[] = array (12 => '[[3Com%GPASS%SS3 4400 SE 24-port | http://www.3com.com/products/en_US/detail.jsp?tab=features&pathtype=purchase&sku=3C17206-US]]');
1050 $new_words[] = array (12 => '[[3Com%GPASS%4500 26-port | http://www.3com.com/products/en_US/detail.jsp?tab=features&pathtype=purchase&sku=3CR17561-91]]');
1051 $new_words[] = array (12 => '[[3Com%GPASS%4500 50-port | http://www.3com.com/products/en_US/detail.jsp?tab=features&pathtype=purchase&sku=3CR17562-91]]');
1052 $new_words[] = array (12 => '[[3Com%GPASS%4500 PWR 26-port | http://www.3com.com/products/en_US/detail.jsp?tab=features&pathtype=purchase&sku=3CR17571-91]]');
1053 $new_words[] = array (12 => '[[3Com%GPASS%4500 PWR 50-port | http://www.3com.com/products/en_US/detail.jsp?tab=features&pathtype=purchase&sku=3CR17572-91]]');
1054 $new_words[] = array (12 => '[[3Com%GPASS%4500G 24-port | http://www.3com.com/products/en_US/detail.jsp?tab=features&pathtype=purchase&sku=3CR17761-91]]');
1055 $new_words[] = array (12 => '[[3Com%GPASS%4500G 48-port | http://www.3com.com/products/en_US/detail.jsp?tab=features&pathtype=purchase&sku=3CR17762-91]]');
1056 $new_words[] = array (12 => '[[3Com%GPASS%4500G PWR 24-port | http://www.3com.com/products/en_US/detail.jsp?tab=features&pathtype=purchase&sku=3CR17771-91]]');
1057 $new_words[] = array (12 => '[[3Com%GPASS%4500G PWR 48-port | http://www.3com.com/products/en_US/detail.jsp?tab=features&pathtype=purchase&sku=3CR17772-91]]');
1058 $new_words[] = array (12 => '[[3Com%GPASS%5500-EI 28-port | http://www.3com.com/products/en_US/detail.jsp?tab=features&pathtype=purchase&sku=3CR17161-91]]');
1059 $new_words[] = array (12 => '[[3Com%GPASS%5500-EI 52-port | http://www.3com.com/products/en_US/detail.jsp?tab=features&pathtype=purchase&sku=3CR17162-91]]');
1060 $new_words[] = array (12 => '[[3Com%GPASS%5500-EI 28-port PWR | http://www.3com.com/products/en_US/detail.jsp?tab=features&pathtype=purchase&sku=3CR17171-91]]');
1061 $new_words[] = array (12 => '[[3Com%GPASS%5500-EI 52-port PWR | http://www.3com.com/products/en_US/detail.jsp?tab=features&pathtype=purchase&sku=3CR17172-91]]');
1062 $new_words[] = array (12 => '[[3Com%GPASS%5500-EI 28-port FX | http://www.3com.com/products/en_US/detail.jsp?tab=features&pathtype=purchase&sku=3CR17181-91]]');
1063 $new_words[] = array (12 => '[[3Com%GPASS%5500G-EI 24-port | http://www.3com.com/products/en_US/detail.jsp?tab=features&pathtype=purchase&sku=3CR17250-91]]');
1064 $new_words[] = array (12 => '[[3Com%GPASS%5500G-EI 48-port | http://www.3com.com/products/en_US/detail.jsp?tab=features&pathtype=purchase&sku=3CR17251-91]]');
1065 $new_words[] = array (12 => '[[3Com%GPASS%5500G-EI PWR 24-port | http://www.3com.com/products/en_US/detail.jsp?tab=features&pathtype=purchase&sku=3CR17252-91]]');
1066 $new_words[] = array (12 => '[[3Com%GPASS%5500G-EI 48-port PWR | http://www.3com.com/products/en_US/detail.jsp?tab=features&pathtype=purchase&sku=3CR17253-91]]');
1067 $new_words[] = array (12 => '[[3Com%GPASS%5500G-EI 24-port SFP | http://www.3com.com/products/en_US/detail.jsp?tab=features&pathtype=purchase&sku=3CR17258-91]]');
1068 $new_words[] = array (12 => '[[3Com%GPASS%7754 | http://www.3com.com/products/en_US/detail.jsp?tab=features&pathtype=purchase&sku=3C16894]]');
1069 $new_words[] = array (12 => '[[3Com%GPASS%7757 | http://www.3com.com/products/en_US/detail.jsp?tab=features&pathtype=purchase&sku=3C16895]]');
1070 $new_words[] = array (12 => '[[3Com%GPASS%7758 | http://www.3com.com/products/en_US/detail.jsp?tab=features&pathtype=purchase&sku=3C16896]]');
1071 $new_words[] = array (12 => '[[3Com%GPASS%8807 | http://www.3com.com/products/en_US/detail.jsp?tab=features&sku=3C17502A&pathtype=purchase]]');
1072 $new_words[] = array (12 => '[[3Com%GPASS%8810 | http://www.3com.com/products/en_US/detail.jsp?tab=features&sku=3C17501A&pathtype=purchase]]');
1073 $new_words[] = array (12 => '[[3Com%GPASS%8814 | http://www.3com.com/products/en_US/detail.jsp?tab=features&sku=3C17500A&pathtype=purchase]]');
1074 $new_words[] = array (13 => 'Linux%GSKIP%RHF9');
1075 $query[] = "insert into PortCompat (type1, type2) values (29, 681)";
1076 $query[] = "insert into PortCompat (type1, type2) values (29, 682)";
1077 $query[] = "insert into PortCompat (type1, type2) values (681, 29)";
1078 $query[] = "insert into PortCompat (type1, type2) values (681, 681)";
1079 $query[] = "insert into PortCompat (type1, type2) values (681, 682)";
1080 $query[] = "insert into PortCompat (type1, type2) values (682, 29)";
1081 $query[] = "insert into PortCompat (type1, type2) values (682, 681)";
1082 $query[] = "insert into PortCompat (type1, type2) values (682, 682)";
1083 $query[] =
1084 "
1085 CREATE TABLE `TagStorage` (
1086 `target_realm` enum('object','ipv4net','rack','ipv4vs','ipv4rspool') NOT NULL default 'object',
1087 `target_id` int(10) unsigned NOT NULL,
1088 `tag_id` int(10) unsigned default NULL,
1089 UNIQUE KEY `entity_tag` (`target_realm`,`target_id`,`tag_id`),
1090 KEY `target_id` (`target_id`)
1091 ) TYPE=MyISAM;
1092 ";
1093 $query[] =
1094 "
1095 CREATE TABLE `TagTree` (
1096 `id` int(10) unsigned NOT NULL auto_increment,
1097 `parent_id` int(10) unsigned default NULL,
1098 `tag` char(255) default NULL,
1099 PRIMARY KEY (`id`),
1100 UNIQUE KEY `tag` (`tag`)
1101 ) TYPE=MyISAM;
1102 ";
1103 $old_words[29] = 'async serial (RJ-45)';
1104
1105 $old_words[43] = 'IBM xSeries%GPASS%305';
1106 $old_words[44] = 'IBM xSeries%GPASS%306';
1107 $old_words[45] = 'IBM xSeries%GPASS%306m';
1108 $old_words[46] = 'IBM xSeries%GPASS%326m';
1109 $old_words[47] = 'IBM xSeries%GPASS%330';
1110 $old_words[48] = 'IBM xSeries%GPASS%335';
1111 $old_words[54] = 'IBM xSeries%GPASS%346';
1112 $old_words[59] = 'IBM xSeries%GPASS%326';
1113 $old_words[68] = 'IBM xSeries%GPASS%3250';
1114 $old_words[69] = 'IBM xSeries%GPASS%3455';
1115 $old_words[70] = 'IBM xSeries%GPASS%3550';
1116 $old_words[71] = 'IBM xSeries%GPASS%3650';
1117 $old_words[72] = 'IBM xSeries%GPASS%3655';
1118 $old_words[73] = 'IBM xSeries%GPASS%3650 T';
1119 $old_words[74] = 'IBM xSeries%GPASS%3755';
1120 $old_words[75] = 'IBM xSeries%GPASS%3850';
1121
1122 $old_words[92] = 'IBM pSeries%GPASS%185';
1123 $old_words[93] = 'IBM pSeries%GPASS%505';
1124 $old_words[94] = 'IBM pSeries%GPASS%505Q';
1125 $old_words[95] = 'IBM pSeries%GPASS%510';
1126 $old_words[96] = 'IBM pSeries%GPASS%510Q';
1127 $old_words[97] = 'IBM pSeries%GPASS%520';
1128 $old_words[98] = 'IBM pSeries%GPASS%520Q';
1129 $old_words[99] = 'IBM pSeries%GPASS%550';
1130 $old_words[100] = 'IBM pSeries%GPASS%550Q';
1131
1132 $old_words[212] = 'Linux%GSKIP%RHFC1';
1133 $old_words[213] = 'Linux%GSKIP%RHFC2';
1134 $old_words[214] = 'Linux%GSKIP%RHFC3';
1135 $old_words[215] = 'Linux%GSKIP%RHFC4';
1136 $old_words[216] = 'Linux%GSKIP%RHFC5';
1137 $old_words[217] = 'Linux%GSKIP%RHFC6';
1138 $old_words[232] = 'Linux%GSKIP%RHF7';
1139 $old_words[242] = 'Linux%GSKIP%RHF8';
1140 $old_words[225] = 'Linux%GSKIP%RHEL1';
1141 $old_words[226] = 'Linux%GSKIP%RHEL2';
1142 $old_words[227] = 'Linux%GSKIP%RHEL3';
1143 $old_words[228] = 'Linux%GSKIP%RHEL4';
1144 $old_words[436] = 'Linux%GSKIP%RHEL5';
1145
1146 $old_words[229] = 'Linux%GSKIP%ALTLinux Master 2.0';
1147 $old_words[230] = 'Linux%GSKIP%ALTLinux Master 2.2';
1148 $old_words[231] = 'Linux%GSKIP%ALTLinux Master 2.4';
1149 $old_words[243] = 'Linux%GSKIP%ALTLinux Master 4.0';
1150 $old_words[231] = 'Linux%GSKIP%ALTLinux Master 2.4';
1151 $old_words[422] = 'Linux%GSKIP%ALTLinux Server 4.0';
1152 $old_words[423] = 'Linux%GSKIP%ALTLinux Sisyphus';
1153
1154 $old_words[233] = 'Linux%GSKIP%SLES10';
1155 $old_words[424] = 'Linux%GSKIP%openSUSE 10.0';
1156 $old_words[425] = 'Linux%GSKIP%openSUSE 10.1';
1157 $old_words[426] = 'Linux%GSKIP%openSUSE 10.2';
1158 $old_words[427] = 'Linux%GSKIP%openSUSE 10.3';
1159
1160 $old_words[428] = 'Linux%GSKIP%Ubuntu 4.10';
1161 $old_words[429] = 'Linux%GSKIP%Ubuntu 5.04';
1162 $old_words[430] = 'Linux%GSKIP%Ubuntu 5.10';
1163 $old_words[431] = 'Linux%GSKIP%Ubuntu 6.06 LTS';
1164 $old_words[432] = 'Linux%GSKIP%Ubuntu 6.10';
1165 $old_words[433] = 'Linux%GSKIP%Ubuntu 7.04';
1166 $old_words[434] = 'Linux%GSKIP%Ubuntu 7.10';
1167 $old_words[435] = 'Linux%GSKIP%Ubuntu 8.04 LTS';
1168
1169 $old_words[418] = 'Linux%GSKIP%Debian 2.0 (hamm)';
1170 $old_words[419] = 'Linux%GSKIP%Debian 2.1 (slink)';
1171 $old_words[420] = 'Linux%GSKIP%Debian 2.2 (potato)';
1172 $old_words[234] = 'Linux%GSKIP%Debian 3.0 (woody)';
1173 $old_words[235] = 'Linux%GSKIP%Debian 3.1 (sarge)';
1174 $old_words[421] = 'Linux%GSKIP%Debian 4.0 (etch)';
1175
1176 $old_words[236] = 'BSD%GSKIP%FreeBSD 1.x';
1177 $old_words[237] = 'BSD%GSKIP%FreeBSD 2.x';
1178 $old_words[238] = 'BSD%GSKIP%FreeBSD 3.x';
1179 $old_words[239] = 'BSD%GSKIP%FreeBSD 4.x';
1180 $old_words[240] = 'BSD%GSKIP%FreeBSD 5.x';
1181 $old_words[241] = 'BSD%GSKIP%FreeBSD 6.x';
1182 $old_words[732] = '[[BSD%GSKIP%FreeBSD 7.0 | http://www.freebsd.org/releases/7.0R/announce.html]]';
1183
1184 $old_words[441] = 'Linux%GSKIP%CentOS-2';
1185 $old_words[442] = 'Linux%GSKIP%CentOS-3';
1186 $old_words[443] = 'Linux%GSKIP%CentOS-4';
1187 $old_words[444] = 'Linux%GSKIP%CentOS-5';
1188
1189 $old_words[218] = 'BSD%GSKIP%Solaris 8';
1190 $old_words[219] = 'BSD%GSKIP%Solaris 9';
1191 $old_words[220] = 'BSD%GSKIP%Solaris 10';
1192
1193 $old_words[49] = 'Sun%GPASS%Ultra 10';
1194 $old_words[50] = 'Sun%GPASS%Enterprise 420R';
1195 $old_words[51] = '[[Sun%GPASS%Fire X2100 | http://www.sun.com/servers/entry/x2100/]]';
1196 $old_words[52] = '[[Sun%GPASS%Fire E4900 | http://www.sun.com/servers/midrange/sunfire_e4900/index.xml]]';
1197 $old_words[53] = 'Sun%GPASS%Netra X1';
1198 $old_words[57] = 'Sun%GPASS%Fire V210';
1199 $old_words[58] = 'Sun%GPASS%Fire V240';
1200 $old_words[60] = 'Sun%GPASS%Netra t1 105';
1201 $old_words[61] = 'Sun%GPASS%Enterprise 4500';
1202 $old_words[64] = 'Sun%GPASS%Ultra 5';
1203 $old_words[76] = '[[Sun%GPASS%Fire X4600 | http://www.sun.com/servers/x64/x4600/]]';
1204 $old_words[77] = '[[Sun%GPASS%Fire X4500 | http://www.sun.com/servers/x64/x4500/]]';
1205 $old_words[78] = '[[Sun%GPASS%Fire X4200 | http://www.sun.com/servers/entry/x4200/]]';
1206 $old_words[79] = '[[Sun%GPASS%Fire X4100 | http://www.sun.com/servers/entry/x4100/]]';
1207 $old_words[80] = '[[Sun%GPASS%Fire X2100 M2 | http://www.sun.com/servers/entry/x2100/]]';
1208 $old_words[81] = '[[Sun%GPASS%Fire X2200 M2 | http://www.sun.com/servers/x64/x2200/]]';
1209 $old_words[82] = 'Sun%GPASS%Fire V40z';
1210 $old_words[83] = 'Sun%GPASS%Fire V125';
1211 $old_words[84] = '[[Sun%GPASS%Fire V215 | http://www.sun.com/servers/entry/v215/]]';
1212 $old_words[85] = '[[Sun%GPASS%Fire V245 | http://www.sun.com/servers/entry/v245/]]';
1213 $old_words[86] = '[[Sun%GPASS%Fire V445 | http://www.sun.com/servers/entry/v445/]]';
1214 $old_words[87] = 'Sun%GPASS%Fire V440';
1215 $old_words[88] = '[[Sun%GPASS%Fire V490 | http://www.sun.com/servers/midrange/v490/]]';
1216 $old_words[89] = '[[Sun%GPASS%Fire V890 | http://www.sun.com/servers/midrange/v890/]]';
1217 $old_words[90] = '[[Sun%GPASS%Fire E2900 | http://www.sun.com/servers/midrange/sunfire_e2900/index.xml]]';
1218 $old_words[91] = 'Sun%GPASS%Fire V1280';
1219
1220 $old_words[55] = 'Dell PowerEdge%GPASS%1650';
1221 $old_words[56] = 'Dell PowerEdge%GPASS%2850';
1222 $old_words[62] = 'Dell PowerEdge%GPASS%1950';
1223 $old_words[63] = 'Dell PowerEdge%GPASS%1550';
1224 $old_words[65] = 'Dell PowerEdge%GPASS%2950';
1225 $old_words[66] = 'Dell PowerEdge%GPASS%650';
1226 $old_words[67] = 'Dell PowerEdge%GPASS%4600';
1227 $old_words[355] = 'Dell PowerEdge%GPASS%6850';
1228 $old_words[356] = 'Dell PowerEdge%GPASS%6950';
1229 $old_words[357] = 'Dell PowerEdge%GPASS%R900';
1230 $old_words[358] = 'Dell PowerEdge%GPASS%4400';
1231 $old_words[359] = 'Dell PowerEdge%GPASS%2650';
1232 $old_words[360] = 'Dell PowerEdge%GPASS%2550';
1233 $old_words[361] = 'Dell PowerEdge%GPASS%750';
1234 $old_words[362] = 'Dell PowerEdge%GPASS%2450';
1235 $old_words[363] = 'Dell PowerEdge%GPASS%850';
1236 $old_words[364] = 'Dell PowerEdge%GPASS%1850';
1237 $old_words[365] = 'Dell PowerEdge%GPASS%860';
1238 $old_words[366] = 'Dell PowerEdge%GPASS%2900';
1239 $old_words[367] = 'Dell PowerEdge%GPASS%2970';
1240 $old_words[368] = 'Dell PowerEdge%GPASS%SC1435';
1241
1242 $old_words[101] = '[[HP ProLiant%GPASS%DL140 | http://h10010.www1.hp.com/wwpc/us/en/en/WF05a/15351-15351-3328412-241644-3328421-1842838.html]]';
1243 $old_words[102] = '[[HP ProLiant%GPASS%DL145 | http://h10010.www1.hp.com/wwpc/us/en/en/WF05a/15351-15351-3328412-241644-3328421-3219755.html]]';
1244 $old_words[103] = '[[HP ProLiant%GPASS%DL320 | http://h10010.www1.hp.com/wwpc/us/en/en/WF05a/15351-15351-3328412-241644-241475-3201178.html]]';
1245 $old_words[104] = '[[HP ProLiant%GPASS%DL360 | http://h10010.www1.hp.com/wwpc/us/en/en/WF05a/15351-15351-3328412-241644-241475-1121486.html]]';
1246 $old_words[105] = '[[HP ProLiant%GPASS%DL380 | http://h10010.www1.hp.com/wwpc/us/en/en/WF05a/15351-15351-3328412-241644-241475-1121516.html]]';
1247 $old_words[106] = '[[HP ProLiant%GPASS%DL385 | http://h10010.www1.hp.com/wwpc/us/en/en/WF05a/15351-15351-3328412-241644-241475-3219233.html]]';
1248 $old_words[107] = '[[HP ProLiant%GPASS%DL580 | http://h10010.www1.hp.com/wwpc/us/en/en/WF05a/15351-15351-3328412-241644-3328422-3454575.html]]';
1249 $old_words[108] = '[[HP ProLiant%GPASS%DL585 | http://h10010.www1.hp.com/wwpc/us/en/en/WF05a/15351-15351-3328412-241644-3328422-3219717.html]]';
1250 $old_words[109] = '[[HP ProLiant%GPASS%ML110 | http://h10010.www1.hp.com/wwpc/us/en/en/WF05a/15351-15351-241434-241646-3328424-3577708.html]]';
1251 $old_words[110] = '[[HP ProLiant%GPASS%ML150 | http://h10010.www1.hp.com/wwpc/us/en/en/WF05a/15351-15351-241434-241646-3328424-3580609.html]]';
1252 $old_words[111] = '[[HP ProLiant%GPASS%ML310 | http://h10010.www1.hp.com/wwpc/us/en/en/WF05a/15351-15351-241434-241646-241477-3580655.html]]';
1253 $old_words[112] = '[[HP ProLiant%GPASS%ML350 | http://h10010.www1.hp.com/wwpc/us/en/en/WF05a/15351-15351-241434-241646-241477-1121586.html]]';
1254 $old_words[113] = '[[HP ProLiant%GPASS%ML370 | http://h10010.www1.hp.com/wwpc/us/en/en/WF05a/15351-15351-241434-241646-241477-1121474.html]]';
1255 $old_words[114] = '[[HP ProLiant%GPASS%ML570 | http://h10010.www1.hp.com/wwpc/us/en/en/WF05a/15351-15351-241434-241646-3328425-1842779.html]]';
1256 $old_words[534] = '[[HP ProLiant%GPASS%DL160 | http://h10010.www1.hp.com/wwpc/us/en/en/WF05a/15351-15351-3328412-241644-3328421-3580694.html]]';
1257 $old_words[535] = '[[HP ProLiant%GPASS%DL180 | http://h10010.www1.hp.com/wwpc/us/en/en/WF05a/15351-15351-3328412-241644-3328421-3580698.html]]';
1258 $old_words[536] = '[[HP ProLiant%GPASS%DL185 | http://h10010.www1.hp.com/wwpc/us/en/en/WF05a/15351-15351-3328412-241644-3328421-3579900.html]]';
1259 $old_words[537] = '[[HP ProLiant%GPASS%DL365 | http://h10010.www1.hp.com/wwpc/us/en/en/WF05a/15351-15351-3328412-241644-241475-3186080.html]]';
1260 $old_words[538] = '[[HP ProLiant%GPASS%DL320s | http://h10010.www1.hp.com/wwpc/us/en/en/WF05a/15351-15351-3328412-241644-241475-3232017.html]]';
1261 $old_words[539] = '[[HP ProLiant%GPASS%DL320p | http://h10010.www1.hp.com/wwpc/us/en/en/WF05a/15351-15351-3328412-241644-241475-3579703.html]]';
1262 $old_words[540] = '[[HP ProLiant%GPASS%ML115 | http://h10010.www1.hp.com/wwpc/us/en/en/WF05a/15351-15351-241434-241646-3328424-3330535.html]]';
1263
1264 foreach ($new_words as $dict_key => $tmp)
1265 foreach ($tmp as $chapter_no => $dict_value)
1266 $query[] = 'INSERT INTO `Dictionary` (`chapter_no`, `dict_key`, `dict_value`) ' .
1267 "VALUES (${chapter_no}, ${dict_key}, '${dict_value}')";
1268 foreach ($old_words as $dict_key => $dict_value)
1269 $query[] = "update Dictionary set dict_value = '${dict_value}' where dict_key = ${dict_key} limit 1";
1270 $query[] = "alter table Rack add unique name_in_row (row_id, name)";
1271 $query[] = "delete from UserPermission where page = 'help'";
1272 $query[] = "alter table Config change column varvalue varvalue char(255) NOT NULL";
1273 $query[] = "INSERT INTO `Config` (varname, varvalue, vartype, emptyok, is_hidden, description) VALUES ('SHOW_EXPLICIT_TAGS','yes','string','no','no','Show explicit tags')";
1274 $query[] = "INSERT INTO `Config` (varname, varvalue, vartype, emptyok, is_hidden, description) VALUES ('SHOW_IMPLICIT_TAGS','yes','string','no','no','Show implicit tags')";
1275 $query[] = "INSERT INTO `Config` (varname, varvalue, vartype, emptyok, is_hidden, description) VALUES ('SHOW_AUTOMATIC_TAGS','no','string','no','no','Show automatic tags')";
1276 // Decommission the Protocols dictionary chapter.
1277 $query[] = "alter table PortForwarding add column proto_new enum('TCP','UDP') not null default 'TCP' after proto";
1278 $query[] = "update PortForwarding set proto_new = 'TCP' where proto = 336";
1279 $query[] = "update PortForwarding set proto_new = 'UDP' where proto = 337";
1280 $query[] = "alter table PortForwarding drop primary key";
1281 $query[] = "alter table PortForwarding drop column proto";
1282 $query[] = "alter table PortForwarding change column proto_new proto enum('TCP','UDP') not null default 'TCP'";
1283 $query[] = "alter table PortForwarding add primary key (`object_id`,`proto`,`localip`,`localport`,`remoteip`,`remoteport`)";
1284 $query[] = "delete from Dictionary where chapter_no = 20";
1285 $query[] = "delete from Chapter where chapter_no = 20";
1286 $query[] = "update Config set varvalue = '0.15.0' where varname = 'DB_VERSION'";
1287 break; // --------------------------------------------
1288 case '0.15.1':
1289 $query[] = "INSERT INTO `Config` VALUES ('IPV4_AUTO_RELEASE','1','uint','no','no','Auto-release IPv4 addresses on allocation')";
1290 $query[] = "update Config set varvalue = '0.15.1' where varname = 'DB_VERSION'";
1291 break;
1292 case '0.16.0':
1293 if (!defined ('MB_CASE_LOWER'))
1294 {
1295 die ('<b>Cannot upgrade due to multibyte extension not present. See the README for details.</b>');
1296 }
1297 $query[] = 'alter table TagStorage modify column tag_id int(10) unsigned not null;';
1298 $query[] = "alter table TagStorage modify column target_realm enum('object','ipv4net','rack','ipv4vs','ipv4rspool','user');";
1299 $query[] = "create table Script (script_name char(64) not null primary key, script_text text)";
1300 // Do the same getUserPermissions() does, but without the function.
1301 // We need to generate more specific rules first, otherwise they will
1302 // never work.
1303 $tq =
1304 "select UserPermission.user_id, user_name, page, tab, access from " .
1305 "UserPermission natural left join UserAccount where (user_name is not null) or " .
1306 "(user_name is null and UserPermission.user_id = 0) order by user_id desc, page desc, tab desc";
1307 $tr = $dbxlink->query ($tq);
1308 $code = "allow {\$userid_1}\ndeny true\n";
1309 // copied and pasted from fixContext()
1310 $pmap = array
1311 (
1312 'accounts' => 'userlist',
1313 'rspools' => 'ipv4rsplist',
1314 'rspool' => 'ipv4rsp',
1315 'vservices' => 'ipv4vslist',
1316 'vservice' => 'ipv4vs',
1317 );
1318 $tmap = array();
1319 $tmap['objects']['newmulti'] = 'addmore';
1320 $tmap['objects']['newobj'] = 'addmore';
1321 $tmap['object']['switchvlans'] = 'livevlans';
1322 $tmap['object']['slb'] = 'editrspvs';
1323 $tmap['object']['portfwrd'] = 'nat4';
1324 $tmap['object']['network'] = 'ipv4';
1325 while ($row = $tr->fetch (PDO::FETCH_ASSOC))
1326 {
1327 // map, if appropriate
1328 $row['page'] = isset ($pmap[$row['page']]) ? $pmap[$row['page']] : $row['page'];
1329 $row['tab'] = isset ($tmap[$row['page']][$row['tab']]) ? $tmap[$row['page']][$row['tab']] : $row['tab'];
1330 // build a rule
1331 $conjunction = '';
1332 $rule = $row['access'] == 'yes' ? 'allow' : 'deny';
1333 if ($row['user_id'] != 0)
1334 {
1335 $rule .= " {\$username_${row['user_name']}}";
1336 $conjunction = 'and ';
1337 }
1338 if ($row['page'] != '%')
1339 {
1340 $rule .= " ${conjunction}{\$page_${row['page']}}";
1341 $conjunction = 'and ';
1342 }
1343 if ($row['tab'] != '%')
1344 $rule .= " ${conjunction}{\$tab_${row['tab']}}";
1345 if ($rule == 'allow' or $rule == 'deny')
1346 continue;
1347 $code .= "${rule}\n";
1348 }
1349 $query[] = "insert into Script (script_name, script_text) values ('RackCode', '${code}')";
1350 $query[] = 'drop table UserPermission';
1351 $new_words[791] = array (13 => '[[Linux%GSKIP%openSUSE 11.0 | http://en.opensuse.org/OpenSUSE_11.0]]');
1352 $new_words[] = array (11 => '[[SGI%GPASS%Altix XE250 | http://www.sgi.com/products/servers/altix/xe/configs.html]]');
1353 $new_words[] = array (11 => '[[SGI%GPASS%Altix XE310 | http://www.sgi.com/products/servers/altix/xe/configs.html]]');
1354 $new_words[] = array (11 => '[[SGI%GPASS%Altix XE320 | http://www.sgi.com/products/servers/altix/xe/configs.html]]');
1355 foreach ($new_words as $dict_key => $tmp)
1356 foreach ($tmp as $chapter_no => $dict_value)
1357 $query[] = 'INSERT INTO `Dictionary` (`chapter_no`, `dict_key`, `dict_value`) ' .
1358 "VALUES (${chapter_no}, ${dict_key}, '${dict_value}')";
1359 $query[] = "update Config set varvalue = '0.16.0' where varname = 'DB_VERSION'";
1360 break;
1361 case '0.16.1':
1362 $query[] = 'alter table Script modify column script_text longtext';
1363 $query[] = "update Config set varvalue = '0.16.1' where varname = 'DB_VERSION'";
1364 $query[] = 'alter table IPVirtualService ADD UNIQUE endpoint (vip, vport, proto)';
1365 break;
1366 default:
1367 showError ("executeUpgradeBatch () failed, because batch '${batchid}' isn't defined");
1368 die;
1369 break;
1370 }
1371 $failures = array();
1372 $ndots = 0;
1373 echo "<pre>Executing database upgrade batch '${batchid}':\n";
1374 foreach ($query as $q)
1375 {
1376 $result = $dbxlink->query ($q);
1377 if ($result != NULL)
1378 echo '.';
1379 else
1380 {
1381 echo '!';
1382 $errorInfo = $dbxlink->errorInfo();
1383 $failures[] = array ($q, $errorInfo[2]);
1384 }
1385 if (++$ndots == 50)
1386 {
1387 echo "\n";
1388 flush();
1389 $ndots = 0;
1390 }
1391 }
1392 echo '<br>';
1393 if (!count ($failures))
1394 echo "No errors!\n";
1395 else
1396 {
1397 echo "The following queries failed:\n<font color=red>";
1398 foreach ($failures as $f)
1399 {
1400 list ($q, $i) = $f;
1401 echo "${q} // ${i}\n";
1402 }
1403 }
1404 echo '</font></pre>';
1405 }
1406
1407 // ******************************************************************
1408 //
1409 // Execution starts here
1410 //
1411 // ******************************************************************
1412
1413 $root = (empty($_SERVER['HTTPS'])?'http':'https').
1414 '://'.
1415 (isset($_SERVER['HTTP_HOST'])?$_SERVER['HTTP_HOST']:($_SERVER['SERVER_NAME'].($_SERVER['SERVER_PORT']=='80'?'':$_SERVER['SERVER_PORT']))).
1416 dirname($_SERVER['PHP_SELF']);
1417 if (substr ($root, -1) != '/')
1418 $root .= '/';
1419
1420 // The below will be necessary as long as we rely on showError()
1421 require_once 'inc/interface.php';
1422
1423 require_once 'inc/config.php';
1424 require_once 'inc/database.php';
1425 if (file_exists ('inc/secret.php'))
1426 require_once 'inc/secret.php';
1427 else
1428 die ("Database connection parameters are read from inc/secret.php file, " .
1429 "which cannot be found.\nCopy provided inc/secret-sample.php to " .
1430 "inc/secret.php and modify to your setup.\n\nThen reload the page.");
1431
1432 try
1433 {
1434 $dbxlink = new PDO ($pdo_dsn, $db_username, $db_password);
1435 }
1436 catch (PDOException $e)
1437 {
1438 die ("Database connection failed:\n\n" . $e->getMessage());
1439 }
1440
1441 // Now we need to be sure that the current user is the administrator.
1442 // The rest doesn't matter within this context.
1443 // We still continue to use the current authenticator though, but this will
1444 // last only till the UserAccounts remains the same. After that this file
1445 // will have to dig into the DB for the user accounts.
1446 require_once 'inc/auth.php';
1447
1448 // 1. This didn't fail sanely, because getUserAccounts() depended on showError()
1449 // 2. getUserAccounts() doesn't work for old DBs since 0.16.0. Let's have own
1450 // copy until it breaks too.
1451
1452 function getUserAccounts_local ()
1453 {
1454 global $dbxlink;
1455 $query = 'select user_id, user_name, user_password_hash from UserAccount order by user_name';
1456 if (($result = $dbxlink->query ($query)) == NULL)
1457 die ('SQL query failed in ' . __FUNCTION__);
1458 $ret = array();
1459 while ($row = $result->fetch (PDO::FETCH_ASSOC))
1460 foreach (array ('user_id', 'user_name', 'user_password_hash') as $cname)
1461 $ret[$row['user_name']][$cname] = $row[$cname];
1462 return $ret;
1463 }
1464
1465 $accounts = getUserAccounts_local();
1466
1467 // Only administrator is always authenticated locally, so reject others
1468 // for authenticate() to succeed.
1469
1470 if
1471 (
1472 !isset ($_SERVER['PHP_AUTH_USER']) or
1473 !isset ($_SERVER['PHP_AUTH_PW']) or
1474 $accounts[$_SERVER['PHP_AUTH_USER']]['user_id'] != 1 or
1475 !authenticated_via_database (escapeString ($_SERVER['PHP_AUTH_USER']), escapeString ($_SERVER['PHP_AUTH_PW']))
1476 )
1477 {
1478 header ('WWW-Authenticate: Basic realm="RackTables upgrade"');
1479 header ('HTTP/1.0 401 Unauthorized');
1480 showError ('You must be authenticated as an administrator to complete the upgrade.');
1481 die;
1482 }
1483
1484 $dbver = getDatabaseVersion();
1485 echo 'Code version: ' . CODE_VERSION . '<br>';
1486 echo 'Database version: ' . $dbver . '<br>';
1487 if ($dbver == CODE_VERSION)
1488 {
1489 die ("<p align=justify>No action is necessary. " .
1490 "Proceed to the <a href='${root}'>main page</a>, " .
1491 "check your data and have a nice day.</p>");
1492 }
1493
1494 foreach (getDBUpgradePath ($dbver, CODE_VERSION) as $batchid)
1495 {
1496 executeUpgradeBatch ($batchid);
1497 printReleaseNotes ($batchid);
1498 }
1499
1500 echo '<br>Database version == ' . getDatabaseVersion();
1501 echo "<p align=justify>Your database seems to be up-to-date. " .
1502 "Now the best thing to do would be to follow to the <a href='${root}'>main page</a> " .
1503 "and explore your data. Have a nice day.</p>";
1504
1505 ?>