122 |
122 |
// End check to see if form was even submitted
|
123 |
123 |
|
124 |
124 |
// Begin path and timezone details code
|
125 |
|
// Check if user has entered the installation path
|
126 |
|
if(!isset($_POST['wb_path']) OR $_POST['wb_path'] == '') {
|
127 |
|
set_error('Please enter an absolute path');
|
128 |
|
} else {
|
129 |
|
$wb_path = $_POST['wb_path'];
|
130 |
|
}
|
|
125 |
|
131 |
126 |
// Check if user has entered the installation url
|
132 |
127 |
if(!isset($_POST['wb_url']) OR $_POST['wb_url'] == '') {
|
133 |
128 |
set_error('Please enter an absolute URL');
|
134 |
129 |
} else {
|
135 |
130 |
$wb_url = $_POST['wb_url'];
|
136 |
131 |
}
|
137 |
|
// Remove any slashes at the end of the URL and path
|
|
132 |
// Remove any slashes at the end of the URL
|
138 |
133 |
if(substr($wb_url, strlen($wb_url)-1, 1) == "/") {
|
139 |
134 |
$wb_url = substr($wb_url, 0, strlen($wb_url)-1);
|
140 |
135 |
}
|
141 |
|
if(substr($wb_path, strlen($wb_path)-1, 1) == "/") {
|
142 |
|
$wb_path = substr($wb_path, 0, strlen($wb_path)-1);
|
143 |
|
}
|
144 |
136 |
if(substr($wb_url, strlen($wb_url)-1, 1) == "\\") {
|
145 |
137 |
$wb_url = substr($wb_url, 0, strlen($wb_url)-1);
|
146 |
138 |
}
|
147 |
|
if(substr($wb_path, strlen($wb_path)-1, 1) == "\\") {
|
148 |
|
$wb_path = substr($wb_path, 0, strlen($wb_path)-1);
|
149 |
|
}
|
150 |
139 |
if(substr($wb_url, strlen($wb_url)-1, 1) == "/") {
|
151 |
140 |
$wb_url = substr($wb_url, 0, strlen($wb_url)-1);
|
152 |
141 |
}
|
153 |
|
if(substr($wb_path, strlen($wb_path)-1, 1) == "/") {
|
154 |
|
$wb_path = substr($wb_path, 0, strlen($wb_path)-1);
|
155 |
|
}
|
156 |
142 |
if(substr($wb_url, strlen($wb_url)-1, 1) == "\\") {
|
157 |
143 |
$wb_url = substr($wb_url, 0, strlen($wb_url)-1);
|
158 |
144 |
}
|
159 |
|
if(substr($wb_path, strlen($wb_path)-1, 1) == "\\") {
|
160 |
|
$wb_path = substr($wb_path, 0, strlen($wb_path)-1);
|
161 |
|
}
|
162 |
145 |
// Get the default time zone
|
163 |
146 |
if(!isset($_POST['default_timezone']) OR !is_numeric($_POST['default_timezone'])) {
|
164 |
147 |
set_error('Please select a valid default timezone');
|
... | ... | |
275 |
258 |
"define('DB_NAME', '$database_name');\n".
|
276 |
259 |
"define('TABLE_PREFIX', '$table_prefix');\n".
|
277 |
260 |
"\n".
|
278 |
|
"define('WB_PATH', '$wb_path');\n".
|
|
261 |
"define('WB_PATH', dirname(__FILE__));\n".
|
279 |
262 |
"define('WB_URL', '$wb_url');\n".
|
280 |
|
"define('ADMIN_PATH', '$wb_path/admin');\n".
|
|
263 |
"define('ADMIN_PATH', WB_PATH.'/admin');\n".
|
281 |
264 |
"define('ADMIN_URL', '$wb_url/admin');\n".
|
282 |
265 |
"\n".
|
283 |
266 |
"require_once(WB_PATH.'/framework/initialize.php');\n".
|
|
267 |
"\n".
|
284 |
268 |
"?>";
|
285 |
269 |
|
286 |
270 |
$config_filename = '../config.php';
|
... | ... | |
300 |
284 |
set_error("The configuration file $config_filename is not writable. Change its permissions so it is, then re-run step 4.");
|
301 |
285 |
}
|
302 |
286 |
|
303 |
|
// Include configuration file
|
|
287 |
// Define configuration vars
|
304 |
288 |
define('DB_TYPE', 'mysql');
|
305 |
289 |
define('DB_HOST', $database_host);
|
306 |
290 |
define('DB_USERNAME', $database_username);
|
307 |
291 |
define('DB_PASSWORD', $database_password);
|
308 |
292 |
define('DB_NAME', $database_name);
|
309 |
293 |
define('TABLE_PREFIX', $table_prefix);
|
310 |
|
define('WB_PATH', $wb_path);
|
|
294 |
define('WB_PATH', str_replace('/install','',dirname(__FILE__)));
|
311 |
295 |
define('WB_URL', $wb_url);
|
312 |
|
define('ADMIN_PATH', $wb_path.'/admin');
|
|
296 |
define('ADMIN_PATH', WB_PATH.'/admin');
|
313 |
297 |
define('ADMIN_URL', $wb_url.'/admin');
|
314 |
298 |
|
315 |
|
//require('../config.php');
|
316 |
|
|
317 |
299 |
// Check if the user has entered a correct path
|
318 |
300 |
if(!file_exists(WB_PATH.'/framework/class.admin.php')) {
|
319 |
301 |
set_error('It appears the Absolute path that you entered is incorrect');
|
... | ... | |
591 |
573 |
require_once(WB_PATH.'/framework/initialize.php');
|
592 |
574 |
$wb = new wb();
|
593 |
575 |
|
594 |
|
// Include the pre-installed module install scripts
|
|
576 |
// Install add-ons
|
|
577 |
if(!file_exists(WB_PATH.'/install/addons')) {
|
595 |
578 |
require(WB_PATH.'/modules/wysiwyg/install.php');
|
596 |
579 |
require(WB_PATH.'/modules/code/install.php');
|
597 |
580 |
require(WB_PATH.'/modules/news/install.php');
|
598 |
581 |
require(WB_PATH.'/modules/form/install.php');
|
599 |
582 |
require(WB_PATH.'/modules/wrapper/install.php');
|
|
583 |
} else {
|
|
584 |
|
|
585 |
}
|
600 |
586 |
|
601 |
587 |
// Check if there was a database error
|
602 |
588 |
if($database->is_error()) {
|
Removed relative path input