Project

General

Profile

« Previous | Next » 

Revision 956

Added by doc over 15 years ago

Added disclaimer to upgrade script

View differences:

upgrade-script.php
93 93
<img src="<?php echo THEME_URL;?>/images/logo.png" alt="Website Baker Logo" />
94 94

  
95 95
<h1>Website Baker Upgrade</h1>
96
<p>This script upgrades an existing Website Baker <strong>Version 2.7</strong> installation to the <strong>Version 2.8</strong>. The upgrade script alters the existing WB database to reflect the changes introduced with WB 2.8.</p>
96 97

  
97 98
<?php
99
/**
100
 * Check if disclaimer was accepted
101
 */
102
if (!(isset($_POST['backup_confirmed']) && $_POST['backup_confirmed'] == 'confirmed')) { ?>
103
<h2>Step 1: Backup your files</h2>
104
<p>It is highly recommended to <strong>create a manual backup</strong> of the entire <strong>/pages folder</strong> and the <strong>MySQL database</strong> before proceeding.<br /><strong class="error">Note: </strong>The upgrade script alters some settings of your existing database!!! You need to confirm the disclaimer before proceeding.</p>
98 105

  
106
<form name="send" action="<?php echo $_SERVER['PHP_SELF'];?>" method="POST">
107
<textarea cols="80" rows="5">DISCLAIMER: The Website Baker upgrade script is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. One needs to confirm that a manual backup of the /pages folder (including all files and subfolders contained in it) and backup of the entire Website Baker MySQL database was created before you can proceed.</textarea>
108
<br /><br /><input name="backup_confirmed" type="checkbox" value="confirmed" />&nbsp;I confirm that a manual backup of the /pages folder and the MySQL database was created.
109
<br /><br /><input name="send" type="submit" value="Start upgrade script" />
110
</form>
111
<br />
112

  
113
<?php
114
	status_msg('<strong>Notice:</strong><br />You need to confirm that you have created a manual backup of the /pages directory and the MySQL database before you can proceed.', 'warning', 'div');
115
	echo '<br /><br />';
116
	exit;
117
}
118

  
119
echo '<h2>Step 2: Updating database entries</h2>';
120

  
99 121
require_once('config.php');
100 122
require_once(WB_PATH.'/framework/functions.php');
101 123

  
......
108 130
	$table = TABLE_PREFIX.'settings';
109 131
	$query = $database->query("SELECT value FROM $table WHERE name = '$key' LIMIT 1");
110 132
	if($query->numRows() > 0) {
111
		echo "$key: allready there. $OK.<br />";
133
		echo "$key: already exists. $OK.<br />";
112 134
		return true;
113 135
	} else {
114 136
		$database->query("INSERT INTO $table (name,value) VALUES ('$key', '$value')");
......
140 162
			echo "adding '$field' $FAIL!<br />";
141 163
		}
142 164
	} else {
143
		echo "'$field' allready there. $OK.<br />";
165
		echo "'$field' already exists. $OK.<br />";
144 166
	}
145 167
}
146 168

  

Also available in: Unified diff