0
+ − 1
<?php
+ − 2
+ − 3
/*
+ − 4
* Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
165
+ − 5
* Version 1.1.1
0
+ − 6
* upgrade.php - upgrade script
+ − 7
* Copyright (C) 2006-2007 Dan Fuhry
+ − 8
*
+ − 9
* This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
+ − 10
* as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
+ − 11
*
+ − 12
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ − 13
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.
+ − 14
*/
+ − 15
232
2b60c89dc27f
Fixed a few major bugs with the upgrade script and the config file not getting loaded properly due to IN_ENANO_INSTALL
Dan
diff
changeset
+ − 16
define('IN_ENANO_INSTALL', 'true');
2b60c89dc27f
Fixed a few major bugs with the upgrade script and the config file not getting loaded properly due to IN_ENANO_INSTALL
Dan
diff
changeset
+ − 17
define('IN_ENANO_UPGRADE', 'true');
0
+ − 18
+ − 19
if(!defined('scriptPath')) {
+ − 20
$sp = dirname($_SERVER['REQUEST_URI']);
+ − 21
if($sp == '/' || $sp == '\\') $sp = '';
+ − 22
define('scriptPath', $sp);
+ − 23
}
+ − 24
+ − 25
if(!defined('contentPath')) {
+ − 26
$sp = dirname($_SERVER['REQUEST_URI']);
+ − 27
if($sp == '/' || $sp == '\\') $sp = '';
+ − 28
define('contentPath', $sp);
+ − 29
}
+ − 30
232
2b60c89dc27f
Fixed a few major bugs with the upgrade script and the config file not getting loaded properly due to IN_ENANO_INSTALL
Dan
diff
changeset
+ − 31
global $this_page, $sideinfo;
2b60c89dc27f
Fixed a few major bugs with the upgrade script and the config file not getting loaded properly due to IN_ENANO_INSTALL
Dan
diff
changeset
+ − 32
2b60c89dc27f
Fixed a few major bugs with the upgrade script and the config file not getting loaded properly due to IN_ENANO_INSTALL
Dan
diff
changeset
+ − 33
function microtime_float()
2b60c89dc27f
Fixed a few major bugs with the upgrade script and the config file not getting loaded properly due to IN_ENANO_INSTALL
Dan
diff
changeset
+ − 34
{
2b60c89dc27f
Fixed a few major bugs with the upgrade script and the config file not getting loaded properly due to IN_ENANO_INSTALL
Dan
diff
changeset
+ − 35
list($usec, $sec) = explode(" ", microtime());
2b60c89dc27f
Fixed a few major bugs with the upgrade script and the config file not getting loaded properly due to IN_ENANO_INSTALL
Dan
diff
changeset
+ − 36
return ((float)$usec + (float)$sec);
2b60c89dc27f
Fixed a few major bugs with the upgrade script and the config file not getting loaded properly due to IN_ENANO_INSTALL
Dan
diff
changeset
+ − 37
}
2b60c89dc27f
Fixed a few major bugs with the upgrade script and the config file not getting loaded properly due to IN_ENANO_INSTALL
Dan
diff
changeset
+ − 38
2b60c89dc27f
Fixed a few major bugs with the upgrade script and the config file not getting loaded properly due to IN_ENANO_INSTALL
Dan
diff
changeset
+ − 39
global $_starttime;
2b60c89dc27f
Fixed a few major bugs with the upgrade script and the config file not getting loaded properly due to IN_ENANO_INSTALL
Dan
diff
changeset
+ − 40
$_starttime = microtime_float();
0
+ − 41
21
663fcf528726
Updated all version numbers back to Banshee; a few preliminary steps towards full UTF-8 support in page URLs
Dan
diff
changeset
+ − 42
// Determine directory (special case for development servers)
663fcf528726
Updated all version numbers back to Banshee; a few preliminary steps towards full UTF-8 support in page URLs
Dan
diff
changeset
+ − 43
if ( strpos(__FILE__, '/repo/') && file_exists('.enanodev') )
663fcf528726
Updated all version numbers back to Banshee; a few preliminary steps towards full UTF-8 support in page URLs
Dan
diff
changeset
+ − 44
{
663fcf528726
Updated all version numbers back to Banshee; a few preliminary steps towards full UTF-8 support in page URLs
Dan
diff
changeset
+ − 45
$filename = str_replace('/repo/', '/', __FILE__);
663fcf528726
Updated all version numbers back to Banshee; a few preliminary steps towards full UTF-8 support in page URLs
Dan
diff
changeset
+ − 46
}
663fcf528726
Updated all version numbers back to Banshee; a few preliminary steps towards full UTF-8 support in page URLs
Dan
diff
changeset
+ − 47
else
663fcf528726
Updated all version numbers back to Banshee; a few preliminary steps towards full UTF-8 support in page URLs
Dan
diff
changeset
+ − 48
{
663fcf528726
Updated all version numbers back to Banshee; a few preliminary steps towards full UTF-8 support in page URLs
Dan
diff
changeset
+ − 49
$filename = __FILE__;
663fcf528726
Updated all version numbers back to Banshee; a few preliminary steps towards full UTF-8 support in page URLs
Dan
diff
changeset
+ − 50
}
663fcf528726
Updated all version numbers back to Banshee; a few preliminary steps towards full UTF-8 support in page URLs
Dan
diff
changeset
+ − 51
663fcf528726
Updated all version numbers back to Banshee; a few preliminary steps towards full UTF-8 support in page URLs
Dan
diff
changeset
+ − 52
define('ENANO_ROOT', dirname($filename));
663fcf528726
Updated all version numbers back to Banshee; a few preliminary steps towards full UTF-8 support in page URLs
Dan
diff
changeset
+ − 53
0
+ − 54
require(ENANO_ROOT.'/includes/constants.php');
+ − 55
+ − 56
if(defined('ENANO_DEBUG'))
+ − 57
{
+ − 58
require_once(ENANO_ROOT.'/includes/debugger/debugConsole.php');
+ − 59
}
+ − 60
else
+ − 61
{
+ − 62
function dc_here($m) { return false; }
+ − 63
function dc_dump($a, $g) { return false; }
+ − 64
function dc_watch($n) { return false; }
+ − 65
function dc_start_timer($u) { return false; }
+ − 66
function dc_stop_timer($m) { return false; }
+ − 67
}
+ − 68
+ − 69
// SCRIPT CONFIGURATION
+ − 70
// Everything related to versions goes here!
+ − 71
+ − 72
// Valid versions to upgrade from
148
+ − 73
$valid_versions = Array('1.0b1', '1.0b2', '1.0b3', '1.0b4', '1.0RC1', '1.0RC2', '1.0RC3', '1.0', '1.0.1', '1.0.1.1', '1.0.2b1');
0
+ − 74
+ − 75
// Basically a list of dependencies, which should be resolved automatically
21
663fcf528726
Updated all version numbers back to Banshee; a few preliminary steps towards full UTF-8 support in page URLs
Dan
diff
changeset
+ − 76
// If, for example, upgrading from 1.0b1 to 1.0RC1 requires one extra query that would not
0
+ − 77
// normally be required (for whatever reason) then you would add a custom version number to the array under key '1.0b1'.
+ − 78
$deps_list = Array(
+ − 79
'1.0b1' => Array('1.0b2'),
+ − 80
'1.0b2' => Array('1.0b3'),
+ − 81
'1.0b3' => Array('1.0b4'),
+ − 82
'1.0b4' => Array('1.0RC1'),
21
663fcf528726
Updated all version numbers back to Banshee; a few preliminary steps towards full UTF-8 support in page URLs
Dan
diff
changeset
+ − 83
'1.0RC1' => Array('1.0RC2'),
73
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
diff
changeset
+ − 84
'1.0RC2' => Array('1.0RC3'),
129
0b5244001799
Rebranded as 1.0.1.1; fixed category page drawing bug; updated link to GPL in the about page to the GPLv2
Dan
diff
changeset
+ − 85
'1.0RC3' => Array('1.0'),
142
ca9118d9c0f2
Rebrand as 1.0.2 (Coblynau); internal links are now parsed by RenderMan::parse_internal_links()
Dan
diff
changeset
+ − 86
'1.0' => Array('1.0.1'),
148
+ − 87
'1.0.1' => Array('1.0.1.1'),
+ − 88
'1.0.1.1' => Array('1.0.2b1')
0
+ − 89
);
142
ca9118d9c0f2
Rebrand as 1.0.2 (Coblynau); internal links are now parsed by RenderMan::parse_internal_links()
Dan
diff
changeset
+ − 90
$this_version = '1.0.2';
0
+ − 91
$func_list = Array(
112
+ − 92
'1.0' => Array('u_1_0_1_update_del_votes'),
31
+ − 93
'1.0b4' => Array('u_1_0_RC1_update_user_ids', 'u_1_0_RC1_add_admins_to_group', 'u_1_0_RC1_alter_files_table', 'u_1_0_RC1_destroy_session_cookie', 'u_1_0_RC1_set_contact_email', 'u_1_0_RC1_update_page_text'), // ,
16
+ − 94
// '1.0RC2' => Array('u_1_0_populate_userpage_comments')
233
1201c9412cb6
The template-cache incompatibility bug has finally been isolated, so a function to clear the template cache was added into the upgrade script for 1.0.2
Dan
diff
changeset
+ − 95
'1.0RC3' => Array('u_1_0_RC3_make_users_extra'),
1201c9412cb6
The template-cache incompatibility bug has finally been isolated, so a function to clear the template cache was added into the upgrade script for 1.0.2
Dan
diff
changeset
+ − 96
'1.0.2b1' => Array('u_1_0_2_nuke_template_cache')
0
+ − 97
);
+ − 98
+ − 99
if(!isset($_GET['mode']))
+ − 100
{
+ − 101
$_GET['mode'] = 'login';
+ − 102
}
+ − 103
+ − 104
function err($t)
+ − 105
{
+ − 106
global $template;
+ − 107
echo $t;
+ − 108
$template->footer();
+ − 109
exit;
+ − 110
}
+ − 111
+ − 112
require(ENANO_ROOT.'/includes/template.php');
+ − 113
+ − 114
// Initialize the session manager
+ − 115
require(ENANO_ROOT.'/includes/functions.php');
+ − 116
require(ENANO_ROOT.'/includes/dbal.php');
+ − 117
require(ENANO_ROOT.'/includes/paths.php');
+ − 118
require(ENANO_ROOT.'/includes/sessions.php');
+ − 119
require(ENANO_ROOT.'/includes/plugins.php');
+ − 120
require(ENANO_ROOT.'/includes/rijndael.php');
+ − 121
require(ENANO_ROOT.'/includes/render.php');
+ − 122
$db = new mysql();
+ − 123
$db->connect();
+ − 124
+ − 125
$plugins = new pluginLoader();
+ − 126
+ − 127
if(!defined('ENANO_CONFIG_FETCHED'))
+ − 128
{
+ − 129
// Select and fetch the site configuration
+ − 130
$e = $db->sql_query('SELECT config_name, config_value FROM '.table_prefix.'config;');
+ − 131
if ( !$e )
+ − 132
{
+ − 133
$db->_die('Some critical configuration information could not be selected.');
+ − 134
}
+ − 135
else
+ − 136
{
+ − 137
define('ENANO_CONFIG_FETCHED', ''); // Used in die_semicritical to figure out whether to call getConfig() or not
+ − 138
}
+ − 139
+ − 140
$enano_config = Array();
+ − 141
while($r = $db->fetchrow())
+ − 142
{
+ − 143
$enano_config[$r['config_name']] = $r['config_value'];
+ − 144
}
+ − 145
$db->free_result();
+ − 146
}
+ − 147
+ − 148
$v = enano_version();
+ − 149
if(in_array($v, Array(false, '', '1.0b3', '1.0b4')))
+ − 150
{
+ − 151
$ul_admin = 2;
+ − 152
$ul_mod = 1;
+ − 153
$ul_member = 0;
+ − 154
$ul_guest = -1;
+ − 155
}
+ − 156
else
+ − 157
{
+ − 158
$ul_admin = USER_LEVEL_ADMIN;
+ − 159
$ul_mod = USER_LEVEL_MOD;
+ − 160
$ul_member = USER_LEVEL_MEMBER;
+ − 161
$ul_guest = USER_LEVEL_GUEST;
+ − 162
}
+ − 163
+ − 164
$_GET['title'] = 'unset';
+ − 165
+ − 166
$session = new sessionManager();
+ − 167
$paths = new pathManager();
+ − 168
$session->start();
+ − 169
+ − 170
$template = new template_nodb();
+ − 171
$template->load_theme('oxygen', 'bleu', false);
+ − 172
+ − 173
$modestrings = Array(
+ − 174
'login' => 'Administrative login',
+ − 175
'welcome' => 'Welcome',
+ − 176
'setversion' => 'Select Enano version',
+ − 177
'confirm' => 'Confirm upgrade',
+ − 178
'upgrade' => 'Database installation',
+ − 179
'finish' => 'Upgrade complete'
+ − 180
);
+ − 181
+ − 182
$sideinfo = '';
+ − 183
$vars = $template->extract_vars('elements.tpl');
+ − 184
$p = $template->makeParserText($vars['sidebar_button']);
+ − 185
foreach ( $modestrings as $id => $str )
+ − 186
{
+ − 187
if ( $_GET['mode'] == $id )
+ − 188
{
+ − 189
$flags = 'style="font-weight: bold; text-decoration: underline;"';
+ − 190
$this_page = $str;
+ − 191
}
+ − 192
else
+ − 193
{
+ − 194
$flags = '';
+ − 195
}
+ − 196
$p->assign_vars(Array(
+ − 197
'HREF' => '#',
+ − 198
'FLAGS' => $flags . ' onclick="return false;"',
+ − 199
'TEXT' => $str
+ − 200
));
+ − 201
$sideinfo .= $p->run();
+ − 202
}
+ − 203
+ − 204
$template->init_vars();
+ − 205
+ − 206
function upg_assign_vars($schema)
+ − 207
{
+ − 208
$schema = str_replace('{{SITE_NAME}}', mysql_real_escape_string(getConfig('site_name')), $schema);
+ − 209
$schema = str_replace('{{SITE_DESC}}', mysql_real_escape_string(getConfig('site_desc')), $schema);
+ − 210
$schema = str_replace('{{COPYRIGHT}}', mysql_real_escape_string(getConfig('copyright_notice')), $schema);
+ − 211
$schema = str_replace('{{TABLE_PREFIX}}', table_prefix, $schema);
+ − 212
if(getConfig('wiki_mode')=='1') $schema = str_replace('{{WIKI_MODE}}', '1', $schema);
+ − 213
else $schema = str_replace('{{WIKI_MODE}}', '0', $schema);
+ − 214
return $schema;
+ − 215
}
+ − 216
+ − 217
/* Version-specific functions */
+ − 218
+ − 219
function u_1_0_RC1_update_user_ids()
+ − 220
{
+ − 221
global $db;
+ − 222
// First, make sure this hasn't already been done
+ − 223
$q = $db->sql_query('SELECT username FROM '.table_prefix.'users WHERE user_id=1;');
+ − 224
if ( !$q )
+ − 225
$db->_die();
+ − 226
$row = $db->fetchrow();
+ − 227
if ( $row['username'] == 'Anonymous' )
+ − 228
return true;
+ − 229
// Find the first unused user ID
+ − 230
$used = Array();
95
1dac77b46f07
Changed style of copyright in St. Patty; first attempt at fixing some upgrade issues from beta 3 or so
dan
diff
changeset
+ − 231
$q = $db->sql_query('SELECT user_id FROM '.table_prefix.'users;');
0
+ − 232
if ( !$q )
+ − 233
$db->_die();
95
1dac77b46f07
Changed style of copyright in St. Patty; first attempt at fixing some upgrade issues from beta 3 or so
dan
diff
changeset
+ − 234
$notfirst = false;
0
+ − 235
while ( $row = $db->fetchrow() )
+ − 236
{
+ − 237
$i = intval($row['user_id']);
+ − 238
$used[$i] = true;
95
1dac77b46f07
Changed style of copyright in St. Patty; first attempt at fixing some upgrade issues from beta 3 or so
dan
diff
changeset
+ − 239
if ( !isset($used[$i - 1]) && $notfirst )
0
+ − 240
{
+ − 241
$id = $i - 1;
+ − 242
break;
+ − 243
}
95
1dac77b46f07
Changed style of copyright in St. Patty; first attempt at fixing some upgrade issues from beta 3 or so
dan
diff
changeset
+ − 244
$notfirst = true;
0
+ − 245
}
+ − 246
if ( !isset($id) )
+ − 247
$id = $i + 1;
95
1dac77b46f07
Changed style of copyright in St. Patty; first attempt at fixing some upgrade issues from beta 3 or so
dan
diff
changeset
+ − 248
if ( $id == 0 )
1dac77b46f07
Changed style of copyright in St. Patty; first attempt at fixing some upgrade issues from beta 3 or so
dan
diff
changeset
+ − 249
$id = 2;
0
+ − 250
$db->free_result();
+ − 251
+ − 252
$q = $db->sql_query('UPDATE '.table_prefix.'users SET user_id=' . $id . ' WHERE user_id=1;');
+ − 253
if(!$q)
+ − 254
$db->_die();
+ − 255
$q = $db->sql_query('UPDATE '.table_prefix.'users SET user_id=1 WHERE user_id=-1 AND username=\'Anonymous\';');
+ − 256
if(!$q)
+ − 257
$db->_die();
+ − 258
+ − 259
}
+ − 260
+ − 261
function u_1_0_RC1_add_admins_to_group()
+ − 262
{
+ − 263
global $db;
+ − 264
$q = $db->sql_query('SELECT user_id FROM '.table_prefix.'users WHERE user_level=' . USER_LEVEL_ADMIN . ';');
+ − 265
if ( !$q )
+ − 266
$db->_die();
+ − 267
$base = 'INSERT INTO '.table_prefix.'group_members(group_id,user_id) VALUES';
+ − 268
$blocks = Array();
+ − 269
while ( $row = $db->fetchrow($q) )
+ − 270
{
+ − 271
$blocks[] = '(2,' . $row['user_id'] . ')';
+ − 272
}
+ − 273
$blocks = implode(',', $blocks);
+ − 274
$sql = $base . $blocks . ';';
+ − 275
if(!$db->sql_query($sql))
+ − 276
$db->_die();
+ − 277
}
+ − 278
+ − 279
function u_1_0_RC1_alter_files_table()
+ − 280
{
+ − 281
global $db;
+ − 282
if(!is_dir(ENANO_ROOT.'/files'))
+ − 283
@mkdir(ENANO_ROOT . '/files');
+ − 284
if(!is_dir(ENANO_ROOT.'/files'))
+ − 285
die('ERROR: Couldn\'t create files directory');
+ − 286
$q = $db->sql_unbuffered_query('SELECT * FROM '.table_prefix.'files;', $db->_conn);
+ − 287
if(!$q) $db->_die();
+ − 288
while ( $row = $db->fetchrow() )
+ − 289
{
+ − 290
$file_data = base64_decode($row['data']);
+ − 291
$path = ENANO_ROOT . '/files/' . md5( $row['filename'] . '_' . $file_data ) . '_' . $row['time_id'] . $row['file_extension'];
+ − 292
@unlink($path);
+ − 293
$handle = @fopen($path, 'w');
+ − 294
if(!$handle)
+ − 295
die('fopen failed');
+ − 296
fwrite($handle, $file_data);
+ − 297
fclose($handle);
+ − 298
+ − 299
}
+ − 300
+ − 301
$q = $db->sql_query('ALTER TABLE '.table_prefix.'files DROP PRIMARY KEY, ADD COLUMN file_id int(12) NOT NULL auto_increment FIRST, ADD PRIMARY KEY (file_id), ADD COLUMN file_key varchar(32) NOT NULL;');
+ − 302
if(!$q) $db->_die();
+ − 303
+ − 304
$list = Array();
+ − 305
$q = $db->sql_unbuffered_query('SELECT * FROM '.table_prefix.'files;', $db->_conn);
+ − 306
if(!$q) $db->_die();
+ − 307
while ( $row = $db->fetchrow($q) )
+ − 308
{
+ − 309
$file_data = base64_decode($row['data']);
+ − 310
$key = md5( $row['filename'] . '_' . $file_data );
+ − 311
$list[] = 'UPDATE '.table_prefix.'files SET file_key=\'' . $key . '\' WHERE file_id=' . $row['file_id'] . ';';
+ − 312
}
+ − 313
+ − 314
foreach ( $list as $sql )
+ − 315
{
+ − 316
if(!$db->sql_query($sql)) $db->_die();
+ − 317
}
+ − 318
+ − 319
if(!$db->sql_query('ALTER TABLE '.table_prefix.'files DROP data')) $db->_die();
+ − 320
+ − 321
}
+ − 322
+ − 323
function u_1_0_RC1_destroy_session_cookie()
+ − 324
{
+ − 325
unset($_COOKIE['sid']);
+ − 326
setcookie('sid', '', time()-3600*24, scriptPath);
+ − 327
setcookie('sid', '', time()-3600*24, scriptPath.'/');
+ − 328
}
+ − 329
+ − 330
function u_1_0_RC1_set_contact_email()
+ − 331
{
+ − 332
global $db;
+ − 333
$q = $db->sql_query('SELECT email FROM '.table_prefix.'users WHERE user_level='.USER_LEVEL_ADMIN.' ORDER BY user_level ASC LIMIT 1;');
+ − 334
if(!$q)
+ − 335
$db->_die();
+ − 336
$row = $db->fetchrow();
+ − 337
setConfig('contact_email', $row['email']);
+ − 338
}
+ − 339
+ − 340
function u_1_0_RC1_update_page_text()
+ − 341
{
+ − 342
global $db;
+ − 343
$q = $db->sql_unbuffered_query('SELECT page_id,namespace,page_text,char_tag FROM '.table_prefix.'page_text');
+ − 344
if (!$q)
+ − 345
$db->_die();
+ − 346
+ − 347
$qs = array();
+ − 348
+ − 349
while ( $row = $db->fetchrow($q) )
+ − 350
{
+ − 351
$row['page_text'] = str_replace(Array(
+ − 352
"{QUOT:{$row['char_tag']}}",
+ − 353
"{APOS:{$row['char_tag']}}",
+ − 354
"{SLASH:{$row['char_tag']}}"
+ − 355
), Array(
+ − 356
'"', "'", '\\'
+ − 357
), $row['page_text']);
+ − 358
$qs[] = 'UPDATE '.table_prefix.'page_text SET page_text=\'' . mysql_real_escape_string($row['page_text']) . '\'
+ − 359
WHERE page_id=\'' . mysql_real_escape_string($row['page_id']) . '\' AND
+ − 360
namespace=\'' . mysql_real_escape_string($row['namespace']) . '\';';
+ − 361
}
+ − 362
+ − 363
foreach($qs as $query)
+ − 364
{
+ − 365
if(!$db->sql_query($query))
+ − 366
$db->_die();
+ − 367
}
+ − 368
}
+ − 369
112
+ − 370
function u_1_0_1_update_del_votes()
0
+ − 371
{
+ − 372
global $db;
112
+ − 373
$q = $db->sql_query('SELECT urlname, namespace, delvote_ips FROM '.table_prefix.'pages;');
0
+ − 374
if ( !$q )
+ − 375
$db->_die();
+ − 376
112
+ − 377
while ( $row = $db->fetchrow($q) )
0
+ − 378
{
112
+ − 379
$ips = strval($row['delvote_ips']);
+ − 380
if ( is_array( @unserialize($ips) ) )
+ − 381
continue;
+ − 382
$ips = explode('|', $ips);
+ − 383
$new = array(
+ − 384
'ip' => array(),
+ − 385
'u' => array()
+ − 386
);
+ − 387
$i = 0;
+ − 388
$prev = '';
+ − 389
$prev_is_ip = false;
+ − 390
foreach ( $ips as $ip )
+ − 391
{
+ − 392
$i++;
+ − 393
$current_is_ip = is_valid_ip($ip);
+ − 394
if ( $current_is_ip && $prev_is_ip )
+ − 395
{
113
+ − 396
$i++;
112
+ − 397
$new['u'][] = $prev;
+ − 398
}
+ − 399
if ( $current_is_ip )
+ − 400
{
+ − 401
$new['ip'][] = $ip;
+ − 402
}
+ − 403
else
+ − 404
{
+ − 405
$new['u'][] = $ip;
+ − 406
}
+ − 407
$prev = $ip;
+ − 408
$prev_is_ip = $current_is_ip;
+ − 409
}
113
+ − 410
if ( $i % 2 == 1 && $prev_is_ip )
+ − 411
{
+ − 412
$new['u'][] = $ip;
+ − 413
}
112
+ − 414
$new = serialize($new);
+ − 415
$e = $db->sql_query('UPDATE '.table_prefix.'pages SET delvote_ips=\'' . $db->escape($new) . '\' WHERE urlname=\'' . $db->escape($row['urlname']) . '\' AND namespace=\'' . $db->escape($row['namespace']) . '\';');
+ − 416
if ( !$e )
+ − 417
$db->_die();
0
+ − 418
}
112
+ − 419
$db->free_result($q);
0
+ − 420
}
+ − 421
31
+ − 422
function u_1_0_RC3_make_users_extra()
+ − 423
{
+ − 424
global $db;
95
1dac77b46f07
Changed style of copyright in St. Patty; first attempt at fixing some upgrade issues from beta 3 or so
dan
diff
changeset
+ − 425
$q = $db->sql_query('SELECT user_id FROM '.table_prefix.'users WHERE user_id > 0;');
31
+ − 426
if ( !$q )
+ − 427
$db->_die();
+ − 428
+ − 429
$ids = array();
+ − 430
while ( $row = $db->fetchrow() )
+ − 431
{
+ − 432
$ids[] = intval($row['user_id']);
+ − 433
}
+ − 434
+ − 435
$ids = '(' . implode('),(', $ids) . ')';
95
1dac77b46f07
Changed style of copyright in St. Patty; first attempt at fixing some upgrade issues from beta 3 or so
dan
diff
changeset
+ − 436
if ( $ids == '' )
1dac77b46f07
Changed style of copyright in St. Patty; first attempt at fixing some upgrade issues from beta 3 or so
dan
diff
changeset
+ − 437
return false;
31
+ − 438
$sql = "INSERT INTO " . table_prefix . "users_extra(user_id) VALUES$ids;";
+ − 439
+ − 440
if ( !$db->sql_query($sql) )
+ − 441
$db->_die();
+ − 442
}
+ − 443
233
1201c9412cb6
The template-cache incompatibility bug has finally been isolated, so a function to clear the template cache was added into the upgrade script for 1.0.2
Dan
diff
changeset
+ − 444
function u_1_0_2_nuke_template_cache()
1201c9412cb6
The template-cache incompatibility bug has finally been isolated, so a function to clear the template cache was added into the upgrade script for 1.0.2
Dan
diff
changeset
+ − 445
{
1201c9412cb6
The template-cache incompatibility bug has finally been isolated, so a function to clear the template cache was added into the upgrade script for 1.0.2
Dan
diff
changeset
+ − 446
$dir = @opendir(ENANO_ROOT . '/cache');
1201c9412cb6
The template-cache incompatibility bug has finally been isolated, so a function to clear the template cache was added into the upgrade script for 1.0.2
Dan
diff
changeset
+ − 447
if ( !$dir )
1201c9412cb6
The template-cache incompatibility bug has finally been isolated, so a function to clear the template cache was added into the upgrade script for 1.0.2
Dan
diff
changeset
+ − 448
{
1201c9412cb6
The template-cache incompatibility bug has finally been isolated, so a function to clear the template cache was added into the upgrade script for 1.0.2
Dan
diff
changeset
+ − 449
return false;
1201c9412cb6
The template-cache incompatibility bug has finally been isolated, so a function to clear the template cache was added into the upgrade script for 1.0.2
Dan
diff
changeset
+ − 450
}
1201c9412cb6
The template-cache incompatibility bug has finally been isolated, so a function to clear the template cache was added into the upgrade script for 1.0.2
Dan
diff
changeset
+ − 451
while ( ($fname = @readdir($dir)) )
1201c9412cb6
The template-cache incompatibility bug has finally been isolated, so a function to clear the template cache was added into the upgrade script for 1.0.2
Dan
diff
changeset
+ − 452
{
1201c9412cb6
The template-cache incompatibility bug has finally been isolated, so a function to clear the template cache was added into the upgrade script for 1.0.2
Dan
diff
changeset
+ − 453
if ( preg_match('/\.tpl\.php$/', $fname) )
1201c9412cb6
The template-cache incompatibility bug has finally been isolated, so a function to clear the template cache was added into the upgrade script for 1.0.2
Dan
diff
changeset
+ − 454
{
1201c9412cb6
The template-cache incompatibility bug has finally been isolated, so a function to clear the template cache was added into the upgrade script for 1.0.2
Dan
diff
changeset
+ − 455
unlink( ENANO_ROOT . '/cache/' . $fname );
1201c9412cb6
The template-cache incompatibility bug has finally been isolated, so a function to clear the template cache was added into the upgrade script for 1.0.2
Dan
diff
changeset
+ − 456
}
1201c9412cb6
The template-cache incompatibility bug has finally been isolated, so a function to clear the template cache was added into the upgrade script for 1.0.2
Dan
diff
changeset
+ − 457
}
1201c9412cb6
The template-cache incompatibility bug has finally been isolated, so a function to clear the template cache was added into the upgrade script for 1.0.2
Dan
diff
changeset
+ − 458
}
1201c9412cb6
The template-cache incompatibility bug has finally been isolated, so a function to clear the template cache was added into the upgrade script for 1.0.2
Dan
diff
changeset
+ − 459
0
+ − 460
switch($_GET['mode'])
+ − 461
{
+ − 462
case "login":
110
+ − 463
if ( $session->user_logged_in && $session->user_level < $ul_admin )
+ − 464
{
+ − 465
$template->header();
+ − 466
echo '<p>Your user account does not have permission to perform an upgrade of Enano. Return to the <a href="index.php">index page</a>.</p>';
+ − 467
$template->footer();
+ − 468
exit;
+ − 469
}
0
+ − 470
if($session->user_logged_in && $session->user_level >= $ul_admin)
+ − 471
{
+ − 472
if(isset($_POST['login']))
+ − 473
{
+ − 474
$session->login_without_crypto($_POST['username'], $_POST['password'], false, $ul_admin);
+ − 475
if($session->sid_super)
+ − 476
{
+ − 477
header('Location: upgrade.php?mode=welcome&auth='.$session->sid_super);
+ − 478
exit;
+ − 479
}
+ − 480
}
+ − 481
$template->header();
+ − 482
?>
+ − 483
<form action="upgrade.php?mode=login" method="post">
+ − 484
<table border="0" style="margin-left: auto; margin-right: auto; margin-top: 5px;" cellspacing="1" cellpadding="4">
+ − 485
<tr>
+ − 486
<th colspan="2">You must re-authenticate to perform this upgrade.</th>
+ − 487
</tr>
+ − 488
<?php
+ − 489
if(isset($_POST['login']))
+ − 490
{
+ − 491
echo '<tr><td colspan="2"><p style="color: red;">Login failed. Bad password?</p></td></tr>';
+ − 492
}
+ − 493
?>
+ − 494
<tr>
+ − 495
<td>Username:</td><td><input type="text" name="username" size="30" /></td>
+ − 496
</tr>
+ − 497
<tr>
+ − 498
<td>Password:</td><td><input type="password" name="password" size="30" /></td>
+ − 499
</tr>
+ − 500
<tr>
+ − 501
<td colspan="2" style="text-align: center;"><input type="submit" name="login" value="Log in" />
+ − 502
</tr>
+ − 503
</table>
+ − 504
</form>
+ − 505
<?php
+ − 506
}
+ − 507
else
+ − 508
{
+ − 509
if(isset($_POST['login']))
+ − 510
{
+ − 511
$result = $session->login_without_crypto($_POST['username'], $_POST['password'], false, $ul_member);
+ − 512
if($result == 'success')
+ − 513
{
+ − 514
header('Location: upgrade.php');
+ − 515
exit;
+ − 516
}
+ − 517
}
+ − 518
$template->header();
+ − 519
?>
+ − 520
<form action="upgrade.php?mode=login" method="post">
+ − 521
<table border="0" style="margin-left: auto; margin-right: auto; margin-top: 5px;" cellspacing="1" cellpadding="4">
+ − 522
<tr>
+ − 523
<th colspan="2">Please log in to continue with this upgrade.</th>
+ − 524
</tr>
+ − 525
<?php
+ − 526
if(isset($_POST['login']))
+ − 527
{
+ − 528
echo '<tr><td colspan="2"><p style="color: red;">Login failed. Bad password?</p></td></tr>';
+ − 529
}
+ − 530
?>
+ − 531
<tr>
+ − 532
<td>Username:</td><td><input type="text" name="username" size="30" /></td>
+ − 533
</tr>
+ − 534
<tr>
+ − 535
<td>Password:</td><td><input type="password" name="password" size="30" /></td>
+ − 536
</tr>
+ − 537
<tr>
+ − 538
<td colspan="2" style="text-align: center;"><input type="submit" name="login" value="Log in" />
+ − 539
</tr>
+ − 540
</table>
+ − 541
</form>
+ − 542
<?php
+ − 543
}
+ − 544
break;
+ − 545
case "welcome":
+ − 546
if(!$session->sid_super) { $template->header(); echo '<p>No admin session found! Please <a href="upgrade.php">restart the upgrade</a>.</p>'; $template->footer(); exit; }
+ − 547
+ − 548
// Just show a simple welcome page to display version information
+ − 549
$template->header();
+ − 550
require('config.php');
+ − 551
+ − 552
?>
+ − 553
+ − 554
<div style="text-align: center; margin-top: 10px;">
+ − 555
<img alt="[ Enano CMS Project logo ]" src="images/enano-artwork/installer-greeting-blue.png" style="display: block; margin: 0 auto; padding-left: 134px;" />
+ − 556
<h2>Welcome to the Enano upgrade wizard</h2>
+ − 557
<?php
+ − 558
if ( file_exists('./_nightly.php') )
+ − 559
{
+ − 560
echo '<div class="warning-box" style="text-align: left; margin: 10px auto; display: table; width: 60%;"><b>You are about to upgrade to a NIGHTLY BUILD of Enano.</b><br />Nightly builds CANNOT be re-upgraded to the final release. They may also contain serious flaws, security problems, or extraneous debugging information. Continuing this process on a production site is NOT recommended.</div>';
+ − 561
}
+ − 562
?>
+ − 563
</div>
+ − 564
<div style="display: table; margin: 0 auto;">
+ − 565
<p>You are about to upgrade Enano to version <b><?php echo $this_version; ?></b>. Before you continue, please ensure that:</p>
+ − 566
<ul>
+ − 567
<li>You have completely backed up your database (<b><?php echo "$dbhost:$dbname"; ?></b>)</li>
+ − 568
<li>You have backed up the entire Enano directory (<b><?php echo ENANO_ROOT; ?></b>)</li>
+ − 569
<li>You have reviewed the release notes for this version, and you<br />are comfortable with any known bugs or issues</li>
91
+ − 570
<li>If you've configured Enano to work using a MySQL user with restricted<br />privileges, you need to enable ALTER, CREATE TABLE, and CREATE INDEX privileges<br />for this upgrade to work.</li>
0
+ − 571
</ul>
+ − 572
</div>
+ − 573
<div style="text-align: center; margin-top: 10px;">
+ − 574
<form action="upgrade.php?mode=setversion&auth=<?php echo $session->sid_super; ?>" method="post">
+ − 575
<input type="submit" value="Continue with upgrade" />
+ − 576
</form>
+ − 577
</div>
+ − 578
+ − 579
<?php
+ − 580
+ − 581
break;
+ − 582
case "setversion":
+ − 583
if(!$session->sid_super) { $template->header(); echo '<p>No admin session found! Please <a href="upgrade.php">restart the upgrade</a>.</p>'; $template->footer(); exit; }
+ − 584
$v = ( function_exists('enano_version') ) ? enano_version() : '';
+ − 585
if(!in_array($v, $valid_versions) && $v != '')
+ − 586
{
+ − 587
$template->header();
+ − 588
?>
+ − 589
<p>Your version of Enano (<?php echo $v; ?>) can't be upgraded to this version (<?php echo $this_version; ?>).</p>
+ − 590
<?php
+ − 591
break;
21
663fcf528726
Updated all version numbers back to Banshee; a few preliminary steps towards full UTF-8 support in page URLs
Dan
diff
changeset
+ − 592
}
663fcf528726
Updated all version numbers back to Banshee; a few preliminary steps towards full UTF-8 support in page URLs
Dan
diff
changeset
+ − 593
else if($v == '')
663fcf528726
Updated all version numbers back to Banshee; a few preliminary steps towards full UTF-8 support in page URLs
Dan
diff
changeset
+ − 594
{
0
+ − 595
// OK, we don't know which version he's running. So we'll cheat ;-)
+ − 596
$template->header();
+ − 597
echo "<form action='upgrade.php?mode=confirm&auth={$session->sid_super}' method='post'>";
+ − 598
?>
+ − 599
<p>Sorry, we couldn't detect which version of Enano you're running on your server. Please select which version of Enano you have below, and make absolutely sure that you're correct.</p>
+ − 600
<p><select name="version"><?php
+ − 601
foreach($valid_versions as $c)
+ − 602
{
+ − 603
echo "<option value='{$c}'>{$c}</option>";
+ − 604
}
+ − 605
?></select></p>
+ − 606
<p>
+ − 607
<input type="submit" value="Continue" />
+ − 608
</p>
+ − 609
<?php
+ − 610
echo `</form>`;
+ − 611
break;
21
663fcf528726
Updated all version numbers back to Banshee; a few preliminary steps towards full UTF-8 support in page URLs
Dan
diff
changeset
+ − 612
}
663fcf528726
Updated all version numbers back to Banshee; a few preliminary steps towards full UTF-8 support in page URLs
Dan
diff
changeset
+ − 613
else
663fcf528726
Updated all version numbers back to Banshee; a few preliminary steps towards full UTF-8 support in page URLs
Dan
diff
changeset
+ − 614
{
0
+ − 615
header('Location: upgrade.php?mode=confirm&auth='.$session->sid_super);
+ − 616
}
+ − 617
break;
+ − 618
case "confirm":
+ − 619
$enano_version = ( isset($_POST['version']) ) ? $_POST['version'] : enano_version();
+ − 620
+ − 621
$template->header();
+ − 622
if(!$session->sid_super) { echo '<p>No admin session found! Please <a href="upgrade.php">restart the upgrade</a>.</p>'; $template->footer(); exit; }
+ − 623
?>
+ − 624
<form action="upgrade.php?mode=upgrade&auth=<?php echo $session->sid_super; ?>" method="post">
+ − 625
<table border="0" style="margin-left: auto; margin-right: auto; margin-top: 5px;" cellspacing="1" cellpadding="4">
+ − 626
<tr>
+ − 627
<td colspan="2"><p><b>Are you sure you want to perform this upgrade?</b></p><p>You can still cancel the upgrade process now. If<br />the upgrade fails, you will need to roll back<br />any actions made using manual SQL queries.</p><p><b>Please clear your browser cache or<br />shift-reload after the upgrade.</b><br />If you fail to do so, some page elements may<br />be broken.</td>
+ − 628
</tr>
+ − 629
<tr>
+ − 630
<td colspan="2" style="text-align: center;">
+ − 631
<input type="hidden" name="enano_version" value="<?php echo $enano_version; ?>" />
+ − 632
<input type="submit" name="doit" value="Upgrade Enano!" />
+ − 633
</td>
+ − 634
</tr>
+ − 635
</table>
+ − 636
</form>
+ − 637
<?php
+ − 638
break;
+ − 639
case "upgrade":
+ − 640
$template->header();
+ − 641
if(!$session->sid_super) { echo '<p>No admin session found! Please <a href="upgrade.php">restart the upgrade</a>.</p>'; $template->footer(); exit; }
+ − 642
if(!isset($_POST['enano_version'])) { echo '<p>Can\'t find the version information on the POST query, are you trying to do this upgrade directly? Please <a href="upgrade.php">restart the upgrade</a>.</p>'; break; }
+ − 643
$enano_version = $_POST['enano_version'];
+ − 644
echo '<p>Preparing for schema execution...';
+ − 645
// Build an array of queries
+ − 646
$schema = file_get_contents('upgrade.sql');
+ − 647
+ − 648
// Strip out and process version blocks
148
+ − 649
preg_match_all('#---BEGIN ([0-9A-z\.\-]*?)---'."\n".'((.*?)'."\n)?".'---END \\1---#is', $schema, $matches);
0
+ − 650
+ − 651
$from_list =& $matches[1];
148
+ − 652
$query_list =& $matches[3];
0
+ − 653
+ − 654
foreach($matches[0] as $m)
+ − 655
{
+ − 656
$schema = str_replace($m, '', $schema);
+ − 657
}
+ − 658
$schema = explode("\n", $schema);
+ − 659
foreach($schema as $k => $q)
+ − 660
{
+ − 661
if(substr($q, 0, 2) == '--' || $q == '')
+ − 662
{
+ − 663
unset($schema[$k]);
+ − 664
//die('<pre>'.htmlspecialchars(print_r($schema, true)).'</pre>');
+ − 665
}
+ − 666
else
+ − 667
{
+ − 668
$schema[$k] = upg_assign_vars($schema[$k]);
+ − 669
}
+ − 670
}
+ − 671
+ − 672
foreach($query_list as $k => $q)
+ − 673
{
+ − 674
$query_list[$k] = explode("\n", $query_list[$k]);
+ − 675
foreach($query_list[$k] as $i => $s)
+ − 676
{
+ − 677
$tq =& $query_list[$k][$i];
+ − 678
if(substr($s, 0, 2) == '--' || $s == '')
+ − 679
{
+ − 680
unset($query_list[$k][$i]);
+ − 681
//die('<pre>'.htmlspecialchars(print_r($schema, true)).'</pre>');
+ − 682
}
+ − 683
else
+ − 684
{
+ − 685
$query_list[$k][$i] = upg_assign_vars($query_list[$k][$i]);
+ − 686
}
+ − 687
}
+ − 688
$query_list[$k] = array_values($query_list[$k]);
+ − 689
}
+ − 690
+ − 691
$assoc_list = Array();
+ − 692
+ − 693
foreach($from_list as $i => $v)
+ − 694
{
+ − 695
$assoc_list[$v] = $query_list[$i];
+ − 696
}
+ − 697
+ − 698
$schema = array_values($schema);
+ − 699
+ − 700
$deps_resolved = false;
+ − 701
$installing_versions = Array($enano_version);
+ − 702
+ − 703
while(true)
+ − 704
{
+ − 705
$v = array_keys($deps_list);
+ − 706
foreach($v as $i => $ver)
+ − 707
{
+ − 708
if(in_array($ver, $installing_versions))
+ − 709
{
+ − 710
// $ver is on the list of versions to be installed. Add its dependencies to the list of versions to install.
+ − 711
foreach($deps_list[$ver] as $dep)
+ − 712
{
+ − 713
if(!in_array($dep, $installing_versions))
+ − 714
{
+ − 715
$installing_versions[] = $dep;
+ − 716
}
+ − 717
}
+ − 718
}
+ − 719
if($i == count($deps_list) - 1)
+ − 720
{
+ − 721
break 2;
+ − 722
}
+ − 723
}
+ − 724
}
+ − 725
+ − 726
foreach($installing_versions as $this_ver)
+ − 727
{
+ − 728
$schema = array_merge($schema, $assoc_list[$this_ver]);
+ − 729
}
+ − 730
+ − 731
// Time for some proper SQL syntax!
+ − 732
// Also check queries for so-called injection attempts to make
+ − 733
// sure that it doesn't fail during the upgrade process and
+ − 734
// leave the user with a half-upgraded database
+ − 735
foreach($schema as $s => $q)
+ − 736
{
+ − 737
if(substr($q, strlen($q)-1, 1) != ';')
+ − 738
{
+ − 739
$schema[$s] .= ';';
+ − 740
}
+ − 741
if ( !$db->check_query($schema[$s]) )
+ − 742
{
+ − 743
// Uh-oh, the check failed, bail out
+ − 744
// The DBAL runs sanity checks on all queries for safety,
+ − 745
// so if the check fails in mid-upgrade we are in deep
+ − 746
// dodo doo-doo.
+ − 747
echo 'Query failed sanity check, this should never happen and is a bug.</p><p>Query was:</p><pre>'.$schema[$s].'</pre>';
+ − 748
break 2;
+ − 749
}
+ − 750
}
+ − 751
+ − 752
$schema = array_values($schema);
+ − 753
+ − 754
// Used extensively for debugging
+ − 755
// echo '<pre>'.htmlspecialchars(print_r($schema, true)).'</pre>';
+ − 756
// break;
+ − 757
+ − 758
echo 'done!<br />Executing upgrade schema...';
+ − 759
+ − 760
// OK, do the loop, baby!!!
+ − 761
foreach($schema as $q)
+ − 762
{
218
e0ec986c0af3
Searching sucks, and Enano's search algorithm was complete bullcrap. So I rewrote it. No, it does not use Google search technology. Like they have a patent for using the Arial font on search result pages anyway.
Dan
diff
changeset
+ − 763
if ( substr($q, 0, 1) == '@' )
0
+ − 764
{
218
e0ec986c0af3
Searching sucks, and Enano's search algorithm was complete bullcrap. So I rewrote it. No, it does not use Google search technology. Like they have a patent for using the Arial font on search result pages anyway.
Dan
diff
changeset
+ − 765
// if the first character is @, don't fail on error
e0ec986c0af3
Searching sucks, and Enano's search algorithm was complete bullcrap. So I rewrote it. No, it does not use Google search technology. Like they have a patent for using the Arial font on search result pages anyway.
Dan
diff
changeset
+ − 766
$db->sql_query(substr($q, 1));
e0ec986c0af3
Searching sucks, and Enano's search algorithm was complete bullcrap. So I rewrote it. No, it does not use Google search technology. Like they have a patent for using the Arial font on search result pages anyway.
Dan
diff
changeset
+ − 767
}
e0ec986c0af3
Searching sucks, and Enano's search algorithm was complete bullcrap. So I rewrote it. No, it does not use Google search technology. Like they have a patent for using the Arial font on search result pages anyway.
Dan
diff
changeset
+ − 768
else
e0ec986c0af3
Searching sucks, and Enano's search algorithm was complete bullcrap. So I rewrote it. No, it does not use Google search technology. Like they have a patent for using the Arial font on search result pages anyway.
Dan
diff
changeset
+ − 769
{
e0ec986c0af3
Searching sucks, and Enano's search algorithm was complete bullcrap. So I rewrote it. No, it does not use Google search technology. Like they have a patent for using the Arial font on search result pages anyway.
Dan
diff
changeset
+ − 770
if ( !$db->sql_query($q) )
e0ec986c0af3
Searching sucks, and Enano's search algorithm was complete bullcrap. So I rewrote it. No, it does not use Google search technology. Like they have a patent for using the Arial font on search result pages anyway.
Dan
diff
changeset
+ − 771
{
e0ec986c0af3
Searching sucks, and Enano's search algorithm was complete bullcrap. So I rewrote it. No, it does not use Google search technology. Like they have a patent for using the Arial font on search result pages anyway.
Dan
diff
changeset
+ − 772
echo $db->get_error();
e0ec986c0af3
Searching sucks, and Enano's search algorithm was complete bullcrap. So I rewrote it. No, it does not use Google search technology. Like they have a patent for using the Arial font on search result pages anyway.
Dan
diff
changeset
+ − 773
break 2;
e0ec986c0af3
Searching sucks, and Enano's search algorithm was complete bullcrap. So I rewrote it. No, it does not use Google search technology. Like they have a patent for using the Arial font on search result pages anyway.
Dan
diff
changeset
+ − 774
}
0
+ − 775
}
+ − 776
}
+ − 777
+ − 778
// Call any custom functions
+ − 779
foreach ( $installing_versions as $ver )
+ − 780
{
+ − 781
if ( isset($func_list[$ver]) )
+ − 782
{
+ − 783
foreach($func_list[$ver] as $function)
+ − 784
{
+ − 785
@call_user_func($function);
+ − 786
}
+ − 787
}
+ − 788
}
+ − 789
74
68469a95658d
Various bugfixes and cleanups, too much to remember... see the diffs for what got changed :-)
Dan
diff
changeset
+ − 790
// Log the upgrade
68469a95658d
Various bugfixes and cleanups, too much to remember... see the diffs for what got changed :-)
Dan
diff
changeset
+ − 791
$q = $db->sql_query('INSERT INTO '.table_prefix.'logs(log_type,action,time_id,date_string,author,page_text,edit_summary) VALUES(\'security\', \'upgrade_enano\', ' . time() . ', \'' . date('d M Y h:i a') . '\', \'' . mysql_real_escape_string($session->username) . '\', \'' . mysql_real_escape_string($this_version) . '\', \'' . mysql_real_escape_string($_SERVER['REMOTE_ADDR']) . '\');');
68469a95658d
Various bugfixes and cleanups, too much to remember... see the diffs for what got changed :-)
Dan
diff
changeset
+ − 792
0
+ − 793
echo 'done!</p>';
+ − 794
echo '<p>You will be redirected shortly. If you aren\'t redirected, <a href="index.php">click here</a>.</p>
+ − 795
<script type="text/javascript">setTimeout("window.location=\'index.php\'", 2000)</script>';
+ − 796
break;
+ − 797
}
+ − 798
$template->footer();
+ − 799
+ − 800
?>