* Needs to be in all Files and every File needs "svn propset *
* svn:keywords Date Revision" (autoprobset!) at least!!!!!! *
* -------------------------------------------------------------------- *
+ * @TODO Rewrite all constants in this include file *
+ * -------------------------------------------------------------------- *
* Copyright (c) 2003 - 2008 by Roland Haeder *
* For more information visit: http://www.mxchange.org *
* *
define('__BURL_ACTION', constant('URL'));
// Output page for entered value
- switch (REQUEST_GET('page'))
- {
+ switch (REQUEST_GET('page')) {
case 'welcome': // Welcome to the installation!
LOAD_TEMPLATE('install_welcome');
break;
case '1': // Server path, base URL
- // @Profi-Concept: Hab meine Meinung doch geaendert! :-)
// Load template
LOAD_TEMPLATE('install_page1');
break;
break;
case 'finalize': // Write captured data to files
- if ((REQUEST_ISSET_POST(('finalize'))) && (!isInstalled())) {
+ if ((REQUEST_ISSET_POST('finalize')) && (!isInstalled())) {
// You have submitted data then we have to reset the SQLs
INIT_SQLS();
// Seems to work, also right database?
if (SQL_SELECT_DB($mysql['dbase'], __FILE__, __LINE__) === true) {
// Automatically run install.sql
- if ((isFileReadable(REQUEST_POST('spath') . 'install/tables.sql')) && (isFileReadable(REQUEST_POST('spath') . 'install/menu-'.getLanguage().'.sql'))) {
+ if ((!isFileReadable(REQUEST_POST('spath') . 'install/tables.sql')) || (!isFileReadable(REQUEST_POST('spath') . 'install/menu-'.getLanguage().'.sql'))) {
+ // Installation area not found!
+ addFatalMessage(__FILE__, __LINE__, getMessage('INSTALL_MISSING_DUMPS'));
+ } // END - if
+
+ if (getTotalFatalErrors() == 0) {
// Both exists so import them
foreach (array('tables', 'menu-'.getLanguage()) as $dump) {
// Should be save here because file_exists() is there but we check it again. :)
// Script is now installed
changeDataInFile(REQUEST_POST('spath') . 'inc/cache/config-local.php', "INSTALLED", "setConfigEntry('MXCHANGE_INSTALLED', \"", "\");", 'Y', 0);
- } else {
- // Installation area not found!
- addFatalMessage(__FILE__, __LINE__, getMessage('INSTALL_MISSING_DUMPS'));
- }
+ } // END - if
} // END - if
} // END - if
if (getTotalFatalErrors() > 0) {
$OUT = '';
foreach (getFatalArray() as $value) {
- $OUT .= " <li>".$value."</li>\n";
+ $OUT .= " <li>" . $value . "</li>\n";
} // END foreach
define('__FATAL_ERROR_LI', $OUT);
$OUT = '';
foreach ($mysql as $key => $value) {
- $OUT .= " <input type=\"hidden\" name=\"mysql[".$key."]\" value=\"".$value."\" />\n";
+ $OUT .= " <input type=\"hidden\" name=\"mysql[" . $key . "]\" value=\"" . $value . "\" />\n";
} // END foreach
define('__MYSQL_DATA' , $OUT);
define('__SPATH_VALUE' , REQUEST_POST('spath'));
LOAD_TEMPLATE('install_fatal_errors');
} else {
// Installation is done!
- redirectToUrl('install.php?page=finalize');
+ redirectToUrl('install.php?page=finished');
}
- } elseif (isInstalled()) {
- // Redirection after writing data... :-)
- LOAD_TEMPLATE('install_finished');
} else {
// Something goes wrong during installation! :-(
addFatalMessage(__FILE__, __LINE__, getMessage('INSTALL_FINALIZER_FAILED'));
}
break;
+ case 'finished':
+ if (isInstalled()) {
+ // Load template that we are finished
+ LOAD_TEMPLATE('install_finished');
+ } else {
+ // Not finished
+ redirectToUrl('install.php');
+ }
+ break;
+
default:
DEBUG_LOG(__FILE__, __LINE__, sprintf("Wrong page %s detected", REQUEST_GET('page')));
OUTPUT_HTML(" <div class=\"install_error\">{--WRONG_PAGE--}</div>");