From ab82613b0100336c0966a742c986874ec1692672 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Tue, 27 Oct 2009 19:35:52 +0000 Subject: [PATCH 1/1] Further fixes for installation phase and endless loop --- inc/classes/cachesystem.class.php | 18 +++++++++---- inc/functions.php | 6 +++++ inc/install-inc.php | 22 +++++++--------- inc/language/cache_de.php | 5 ---- inc/language/de.php | 6 +++++ templates/de/html/install/install_page1.tpl | 21 ++++++++-------- templates/de/html/install/install_page2.tpl | 28 ++++++++++----------- templates/de/html/install/install_page3.tpl | 16 ++++++------ templates/de/html/install/install_page5.tpl | 16 ++++++------ theme/business/css/install.css | 5 ++++ theme/default/css/install.css | 5 ++++ theme/desert/css/install.css | 7 +++++- 12 files changed, 90 insertions(+), 65 deletions(-) diff --git a/inc/classes/cachesystem.class.php b/inc/classes/cachesystem.class.php index 61a6fe3145..6a1992dd9d 100644 --- a/inc/classes/cachesystem.class.php +++ b/inc/classes/cachesystem.class.php @@ -115,8 +115,7 @@ class CacheSystem { // This will destory an existing cache file! if ($this->ret == $this->statusDone) { // Mark it as no longer readable - unset($this->readable[$this->name]); - unset($GLOBALS['file_readable'][$this->fqfn]); + $this->markCacheAsUnreadable(); // Create file if ($this->isCacheReadable()) changeMode($this->fqfn, 0666); @@ -130,6 +129,12 @@ class CacheSystem { } } + // Mark the cache as unreadable + function markCacheAsUnreadable () { + unset($this->readable[$this->name]); + unset($GLOBALS['file_readable'][$this->fqfn]); + } + function addRow ($data) { // Is the pointe rvalid? if (is_resource($this->pointer)) { @@ -217,11 +222,17 @@ class CacheSystem { } else { // Cache file not found or not readable addFatalMessage(__METHOD__, __LINE__, "(".__LINE__."): ".sprintf(getMessage('CACHE_CANNOT_LOAD'), $this->fqfn)); + + // Try to remove it + $this->removeCacheFile(); } } // Destroy an existing cache file function removeCacheFile ($removeArray = false, $force = false) { + // Remove cached value of readable cache + $this->markCacheAsUnreadable(); + // Debug message /* DEBUG: */ logDebugMessage(__METHOD__, __LINE__, sprintf("%s should be removed.", $this->name)); @@ -251,9 +262,6 @@ class CacheSystem { // Remove cache file from system removeFile($this->fqfn); - // No longer readable! - unset($this->readable[$this->name]); - // Shall we remove the array from memory? if ($removeArray === true) { // Debug message if allowed diff --git a/inc/functions.php b/inc/functions.php index 27dc9ab349..fd2eab7f3d 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -3509,6 +3509,9 @@ function handleFatalErrors () { return false; } // END - if + // Set content type + setContentType('text/html'); + // Load config here loadIncludeOnce('inc/load_config.php'); @@ -3567,6 +3570,9 @@ function handleFatalErrors () { 'corr' => $CORR ); + // Load footer + loadIncludeOnce('inc/header.php'); + // Load main template loadTemplate('fatal_errors', false, $content); diff --git a/inc/install-inc.php b/inc/install-inc.php index d4afebe5df..e8304bb0c4 100644 --- a/inc/install-inc.php +++ b/inc/install-inc.php @@ -47,7 +47,10 @@ if (!defined('__SECURITY')) { // Init variables $mysql = array(); -if ((isPostRequestElementSet('mysql')) && (is_array(postRequestElement('mysql')))) $mysql = postRequestElement('mysql'); +if ((isPostRequestElementSet('mysql')) && (is_array(postRequestElement('mysql')))) { + // Transfer 'mysql' array + $mysql = postRequestElement('mysql'); +} // END - if // Check if both passwords from SMTP are matching if ((isGetRequestElementSet('page') && (getRequestElement('page') == 5))) { @@ -115,7 +118,7 @@ if ((!isInstalled()) || (!isAdminRegistered())) { $content['email'] = postRequestElement('email'); // Load template - addTemplateToInstallContent('install_page2', false, $content); + addTemplateToInstallContent('install_page2', $content); break; case '3': @@ -156,7 +159,7 @@ if ((!isInstalled()) || (!isAdminRegistered())) { $content['smtp_pass2'] = $smtpPass2; // Load template - addTemplateToInstallContent('install_page3', false, $content); + addTemplateToInstallContent('install_page3', $content); break; case '5': // Misc settings @@ -167,13 +170,6 @@ if ((!isInstalled()) || (!isAdminRegistered())) { $content['slogan'] = postRequestElement('slogan'); $content['email'] = postRequestElement('email'); - // MySQL settings - $content['mysql_host'] = $mysql['host']; - $content['mysql_dbase'] = $mysql['dbase']; - $content['mysql_prefix'] = $mysql['prefix']; - $content['mysql_login'] = $mysql['login']; - $content['table_type'] = $mysql['type']; - // SMTP settings $content['smtp_host'] = postRequestElement('smtp_host'); $content['smtp_user'] = postRequestElement('smtp_user'); @@ -183,11 +179,11 @@ if ((!isInstalled()) || (!isAdminRegistered())) { $OUT = ''; foreach ($mysql as $key => $value) { $OUT .= " \n"; - } + } // END - foreach $content['mysql_hidden'] = $OUT; // Load template - addTemplateToInstallContent('install_page5', false, $content); + addTemplateToInstallContent('install_page5', $content); break; case 'finalize': // Write captured data to files @@ -268,7 +264,7 @@ if ((!isInstalled()) || (!isAdminRegistered())) { $content['smtp_pass'] = postRequestElement('smtp_pass1'); // Load template - addTemplateToInstallContent('install_fatal_errors', false, $content); + addTemplateToInstallContent('install_fatal_errors', $content); } else { // Installation is done! redirectToUrl('install.php?page=finished'); diff --git a/inc/language/cache_de.php b/inc/language/cache_de.php index 63894b5008..728dc6550e 100644 --- a/inc/language/cache_de.php +++ b/inc/language/cache_de.php @@ -43,11 +43,6 @@ if (!defined('__SECURITY')) { // Language definitions addMessages(array( - 'CACHE_PROBLEMS_DETECTED' => "Probleme mit dem Cache-Subsystem erkannt!", - 'CACHE_CANNOT_LOAD' => "Kann nicht Cache-Datei %s laden!", - 'CACHE_CANNOT_INITIALIZE' => "Konnte das Caching-System nicht initialisieren. Bitte die Dokumentation DOCS/de/cache/README.txt lesen!", - 'CACHE_CANNOT_UNLINK' => "Kann nicht die Cache-Datei %s vom Server entfernen!", - // Administrative settings 'ADMIN_CACHE_STATS_TITLE' => "Statistiken des Caching-Systems", 'ADMIN_CACHE_DB_HITS' => "Zugriffe auf die Datenbank", diff --git a/inc/language/de.php b/inc/language/de.php index 59dc26ca2b..9f3a632061 100644 --- a/inc/language/de.php +++ b/inc/language/de.php @@ -1186,6 +1186,12 @@ addMessages(array( // Missing menu whats 'MENU_WHAT_404' => "Menü deaktiviert, da keine Scriptdatei auf dem Server gefunden wurde.", + +// Cache messages + 'CACHE_PROBLEMS_DETECTED' => "Probleme mit dem Cache-Subsystem erkannt!", + 'CACHE_CANNOT_LOAD' => "Kann nicht Cache-Datei %s laden!", + 'CACHE_CANNOT_INITIALIZE' => "Konnte das Caching-System nicht initialisieren. Bitte die Dokumentation DOCS/de/cache/README.txt lesen!", + 'CACHE_CANNOT_UNLINK' => "Kann nicht die Cache-Datei %s vom Server entfernen!", )); // Description of all months diff --git a/templates/de/html/install/install_page1.tpl b/templates/de/html/install/install_page1.tpl index 92fdb6525f..6686d9e871 100644 --- a/templates/de/html/install/install_page1.tpl +++ b/templates/de/html/install/install_page1.tpl @@ -17,37 +17,36 @@   - {--SERVER_PATH--} :  - + {--SERVER_PATH--}: +   - {--BASE_URL--} :  - ({--BASE_URL_NOTE--}) - + {--BASE_URL--} ({--BASE_URL_NOTE--}): +   - {--HP_TITLE--} :  - + {--HP_TITLE--}: +   - {--HP_SLOGAN--} :  - + {--HP_SLOGAN--}: +   - {--HP_EMAIL--} :  - + {--HP_EMAIL--}: +   diff --git a/templates/de/html/install/install_page2.tpl b/templates/de/html/install/install_page2.tpl index da49d791f5..4a2bdbb702 100644 --- a/templates/de/html/install/install_page2.tpl +++ b/templates/de/html/install/install_page2.tpl @@ -16,8 +16,8 @@   - {--MYSQL_HOST--} :  - + {--MYSQL_HOST--}: + @@ -25,8 +25,8 @@   - {--MYSQL_DBASE--} :  - + {--MYSQL_DBASE--}: + @@ -34,8 +34,8 @@   - {--MYSQL_PREFIX--} :  - + {--MYSQL_PREFIX--}: + @@ -43,8 +43,8 @@   - {--MYSQL_TABLE_TYPE--} :  - + {--MYSQL_TABLE_TYPE--}: + @@ -64,8 +64,8 @@   - {--MYSQL_PASS1--} :  - + {--MYSQL_PASS1--}: + @@ -73,8 +73,8 @@   - {--MYSQL_PASS2--} :  - + {--MYSQL_PASS2--}: + diff --git a/templates/de/html/install/install_page3.tpl b/templates/de/html/install/install_page3.tpl index 8bdd4a52bd..1f3026b914 100644 --- a/templates/de/html/install/install_page3.tpl +++ b/templates/de/html/install/install_page3.tpl @@ -16,8 +16,8 @@   - {--TEXT_SMTP_HOST--} :  - + {--TEXT_SMTP_HOST--}: + @@ -25,8 +25,8 @@   - {--TEXT_SMTP_USER--} :  - + {--TEXT_SMTP_USER--}: + @@ -34,8 +34,8 @@   - {--TEXT_SMTP_PASS1--} :  - + {--TEXT_SMTP_PASS1--}: + @@ -43,8 +43,8 @@   - {--TEXT_SMTP_PASS2--} :  - + {--TEXT_SMTP_PASS2--}: + diff --git a/templates/de/html/install/install_page5.tpl b/templates/de/html/install/install_page5.tpl index 9f80c920e7..98844c5f4c 100644 --- a/templates/de/html/install/install_page5.tpl +++ b/templates/de/html/install/install_page5.tpl @@ -13,8 +13,8 @@   - {--LANG_OUTPUT_MODE--}:   - + {--LANG_OUTPUT_MODE--}: + @@ -33,8 +33,8 @@   - {--LANG_WRITE_FOOTER--}:   - + {--LANG_WRITE_FOOTER--}: + diff --git a/theme/business/css/install.css b/theme/business/css/install.css index 866e5d46b9..f3c23b087e 100644 --- a/theme/business/css/install.css +++ b/theme/business/css/install.css @@ -74,3 +74,8 @@ padding-top: 5px; padding-bottom: 10px; } + +.install_right { + text-align: right; + padding-right: 5px; +} diff --git a/theme/default/css/install.css b/theme/default/css/install.css index a8d5167b0f..efe55dee63 100644 --- a/theme/default/css/install.css +++ b/theme/default/css/install.css @@ -82,3 +82,8 @@ .install_footer { padding-bottom: 10px; } + +.install_right { + text-align: right; + padding-right: 5px; +} diff --git a/theme/desert/css/install.css b/theme/desert/css/install.css index caf27417bd..9b0a3b8c78 100644 --- a/theme/desert/css/install.css +++ b/theme/desert/css/install.css @@ -77,4 +77,9 @@ .install_welcome { padding-top: 5px; padding-bottom: 10px; -} \ No newline at end of file +} + +.install_right { + text-align: right; + padding-right: 5px; +} -- 2.30.2