Further fixes for installation phase and endless loop
authorRoland Häder <roland@mxchange.org>
Tue, 27 Oct 2009 19:35:52 +0000 (19:35 +0000)
committerRoland Häder <roland@mxchange.org>
Tue, 27 Oct 2009 19:35:52 +0000 (19:35 +0000)
12 files changed:
inc/classes/cachesystem.class.php
inc/functions.php
inc/install-inc.php
inc/language/cache_de.php
inc/language/de.php
templates/de/html/install/install_page1.tpl
templates/de/html/install/install_page2.tpl
templates/de/html/install/install_page3.tpl
templates/de/html/install/install_page5.tpl
theme/business/css/install.css
theme/default/css/install.css
theme/desert/css/install.css

index 61a6fe3..6a1992d 100644 (file)
@@ -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__, "(<font color=\"#0000aa\">".__LINE__."</font>): ".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
index 27dc9ab..fd2eab7 100644 (file)
@@ -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);
 
index d4afebe..e8304bb 100644 (file)
@@ -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 .= "    <input type=\"hidden\" name=\"mysql[" . $key . "]\" value=\"" . $value . "\" />\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');
index 63894b5..728dc65 100644 (file)
@@ -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 <strong><u>%s</u></strong> laden!",
-       'CACHE_CANNOT_INITIALIZE' => "Konnte das Caching-System nicht initialisieren. Bitte die Dokumentation <strong>DOCS/de/cache/README.txt</strong> lesen!",
-       'CACHE_CANNOT_UNLINK' => "Kann nicht die Cache-Datei <strong><u>%s</u></strong> vom Server entfernen!",
-
 // Administrative settings
        'ADMIN_CACHE_STATS_TITLE' => "Statistiken des Caching-Systems",
        'ADMIN_CACHE_DB_HITS' => "Zugriffe auf die Datenbank",
index 59dc26c..9f3a632 100644 (file)
@@ -1186,6 +1186,12 @@ addMessages(array(
 
 // Missing menu whats
        'MENU_WHAT_404' => "Men&uuml; 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 <strong><u>%s</u></strong> laden!",
+       'CACHE_CANNOT_INITIALIZE' => "Konnte das Caching-System nicht initialisieren. Bitte die Dokumentation <strong>DOCS/de/cache/README.txt</strong> lesen!",
+       'CACHE_CANNOT_UNLINK' => "Kann nicht die Cache-Datei <strong><u>%s</u></strong> vom Server entfernen!",
 ));
 
 // Description of all months
index 92fdb65..6686d9e 100644 (file)
                <td colspan="2" height="21" class="seperator">&nbsp;</td>
        </tr>
        <tr>
-               <td align="right" class="install">{--SERVER_PATH--}&nbsp;:&nbsp;</td>
-               <td><input type="text" name="spath" size="20" value="{?PATH?}" class="install_normal" /></td>
+               <td align="right" class="install_right">{--SERVER_PATH--}:</td>
+               <td align="left"><input type="text" name="spath" size="20" value="{?PATH?}" class="install_normal" /></td>
        </tr>
        <tr>
                <td colspan="2" height="10" class="seperator">&nbsp;</td>
        </tr>
        <tr>
-               <td align="right" class="install">{--BASE_URL--}&nbsp;:&nbsp;
-               ({--BASE_URL_NOTE--})</td>
-               <td><input type="text" name="burl" size="20" value="{?URL?}" class="install_normal" /></td>
+               <td align="right" class="install_right">{--BASE_URL--}&nbsp;({--BASE_URL_NOTE--}):</td>
+               <td align="left"><input type="text" name="burl" size="20" value="{?URL?}" class="install_normal" /></td>
        </tr>
        <tr>
                <td colspan="2" height="10" class="seperator">&nbsp;</td>
        </tr>
        <tr>
-               <td align="right" class="install">{--HP_TITLE--}&nbsp;:&nbsp;</td>
-               <td><input type="text" name="title" size="20" maxlength="255" value="{?MAIN_TITLE?}" class="install_normal" /></td>
+               <td align="right" class="install_right">{--HP_TITLE--}:</td>
+               <td align="left"><input type="text" name="title" size="20" maxlength="255" value="{?MAIN_TITLE?}" class="install_normal" /></td>
        </tr>
        <tr>
                <td colspan="2" height="10" class="seperator">&nbsp;</td>
        </tr>
        <tr>
-               <td align="right" class="install">{--HP_SLOGAN--}&nbsp;:&nbsp;</td>
-               <td><input type="text" name="slogan" size="30" maxlength="255" value="{?SLOGAN?}" class="install_normal" /></td>
+               <td align="right" class="install_right">{--HP_SLOGAN--}:</td>
+               <td align="left"><input type="text" name="slogan" size="30" maxlength="255" value="{?SLOGAN?}" class="install_normal" /></td>
        </tr>
        <tr>
                <td colspan="2" height="10" class="seperator">&nbsp;</td>
        </tr>
        <tr>
-               <td align="right" class="install">{--HP_EMAIL--}&nbsp;:&nbsp;</td>
-               <td><input type="text" name="email" size="20" maxlength="255" value="{?WEBMASTER?}" class="install_normal" /></td>
+               <td align="right" class="install_right">{--HP_EMAIL--}:</td>
+               <td align="left"><input type="text" name="email" size="20" maxlength="255" value="{?WEBMASTER?}" class="install_normal" /></td>
        </tr>
        <tr>
                <td colspan="3" height="21" class="seperator">&nbsp;</td>
index da49d79..4a2bdbb 100644 (file)
@@ -16,8 +16,8 @@
                <td colspan="2" height="21" class="seperator">&nbsp;</td>
        </tr>
        <tr>
-               <td width="50%" align="right" class="install">{--MYSQL_HOST--}&nbsp;:&nbsp;</td>
-               <td width="50%">
+               <td width="50%" align="right" class="install_right">{--MYSQL_HOST--}:</td>
+               <td width="50%" align="left">
                        <input type="text" name="mysql[host]" size="25" value="$content[mysql_host]" class="install_normal" />
                </td>
        </tr>
@@ -25,8 +25,8 @@
                <td colspan="2" height="10" class="seperator">&nbsp;</td>
        </tr>
        <tr>
-               <td width="50%" align="right" class="install">{--MYSQL_DBASE--}&nbsp;:&nbsp;</td>
-               <td width="50%">
+               <td width="50%" align="right" class="install_right">{--MYSQL_DBASE--}:</td>
+               <td width="50%" align="left">
                        <input type="text" name="mysql[dbase]" size="25" value="$content[mysql_dbase]" class="install_normal" />
                </td>
        </tr>
@@ -34,8 +34,8 @@
                <td colspan="2" height="10" class="seperator">&nbsp;</td>
        </tr>
        <tr>
-               <td width="50%" align="right" class="install">{--MYSQL_PREFIX--}&nbsp;:&nbsp;</td>
-               <td width="50%">
+               <td width="50%" align="right" class="install_right">{--MYSQL_PREFIX--}:</td>
+               <td width="50%" align="left">
                        <input type="text" name="mysql[prefix]" size="25" value="$content[mysql_prefix]" class="install_normal" />
                </td>
        </tr>
@@ -43,8 +43,8 @@
                <td colspan="2" height="10" class="seperator">&nbsp;</td>
        </tr>
        <tr>
-               <td width="50%" align="right" class="install">{--MYSQL_TABLE_TYPE--}&nbsp;:&nbsp;</td>
-               <td width="50%">
+               <td width="50%" align="right" class="install_right">{--MYSQL_TABLE_TYPE--}:</td>
+               <td width="50%" align="left">
                        <select name="mysql[type]" size="1">
                                <option value="MyISAM">{--TABLE_TYPE_MYISAM--}</option>
                                <option value="InnoDB">{--TABLE_TYPE_INNODB--}</option>
@@ -55,8 +55,8 @@
                <td colspan="2" height="10" class="seperator">&nbsp;</td>
        </tr>
        <tr>
-               <td width="50%" align="right" class="install">{--MYSQL_LOGIN--}&nbsp;:&nbsp;</td>
-               <td width="50%">
+               <td width="50%" align="right" class="install_right">{--MYSQL_LOGIN--}:</td>
+               <td width="50%" align="left">
                        <input type="text" name="mysql[login]" size="25" value="$content[mysql_login]" class="install_normal" />
                </td>
        </tr>
@@ -64,8 +64,8 @@
                <td colspan="2" height="10" class="seperator">&nbsp;</td>
        </tr>
        <tr>
-               <td width="50%" align="right" class="install">{--MYSQL_PASS1--}&nbsp;:&nbsp;</td>
-               <td width="50%">
+               <td width="50%" align="right" class="install_right">{--MYSQL_PASS1--}:</td>
+               <td width="50%" align="left">
                        <input type="password" name="mysql[pass1]" size="25" class="install_normal" />
                </td>
        </tr>
@@ -73,8 +73,8 @@
                <td colspan="2" height="10" class="seperator">&nbsp;</td>
        </tr>
        <tr>
-               <td width="50%" align="right" class="install">{--MYSQL_PASS2--}&nbsp;:&nbsp;</td>
-               <td width="50%">
+               <td width="50%" align="right" class="install_right">{--MYSQL_PASS2--}:</td>
+               <td width="50%" align="left">
                        <input type="password" name="mysql[pass2]" size="25" class="install_normal" />
                </td>
        </tr>
index 8bdd4a5..1f3026b 100644 (file)
@@ -16,8 +16,8 @@
                <td colspan="2" height="21" class="seperator">&nbsp;</td>
        </tr>
        <tr>
-               <td width="50%" align="right" class="install">{--TEXT_SMTP_HOST--}&nbsp;:&nbsp;</td>
-               <td width="50%">
+               <td width="50%" align="right" class="install_right">{--TEXT_SMTP_HOST--}:</td>
+               <td width="50%" align="left">
                  <input type="text" name="smtp_host" size="25" value="$content[smtp_host]" class="install_normal" />
                </td>
        </tr>
@@ -25,8 +25,8 @@
                <td colspan="2" height="10" class="seperator">&nbsp;</td>
        </tr>
        <tr>
-               <td width="50%" align="right" class="install">{--TEXT_SMTP_USER--}&nbsp;:&nbsp;</td>
-               <td width="50%">
+               <td width="50%" align="right" class="install_right">{--TEXT_SMTP_USER--}:</td>
+               <td width="50%" align="left">
                  <input type="text" name="smtp_user" size="25" value="$content[smtp_user]" class="install_normal" />
                </td>
        </tr>
@@ -34,8 +34,8 @@
                <td colspan="2" height="10" class="seperator">&nbsp;</td>
        </tr>
        <tr>
-               <td width="50%" align="right" class="install">{--TEXT_SMTP_PASS1--}&nbsp;:&nbsp;</td>
-               <td width="50%">
+               <td width="50%" align="right" class="install_right">{--TEXT_SMTP_PASS1--}:</td>
+               <td width="50%" align="left">
                  <input type="password" name="smtp_pass1" size="25" value="$content[smtp_pass1]" class="install_normal" />
                </td>
        </tr>
@@ -43,8 +43,8 @@
                <td colspan="2" height="10" class="seperator">&nbsp;</td>
        </tr>
        <tr>
-               <td width="50%" align="right" class="install">{--TEXT_SMTP_PASS2--}&nbsp;:&nbsp;</td>
-               <td width="50%">
+               <td width="50%" align="right" class="install_right">{--TEXT_SMTP_PASS2--}:</td>
+               <td width="50%" align="left">
                  <input type="password" name="smtp_pass2" size="25" value="$content[smtp_pass2]" class="install_normal" />
                </td>
        </tr>
index 9f80c92..98844c5 100644 (file)
@@ -13,8 +13,8 @@
 </tr>
 <tr><td colspan="2" height="21" class="seperator">&nbsp;</td></tr>
 <tr>
-  <td class="install" align="right">{--LANG_OUTPUT_MODE--}:&nbsp;&nbsp;</td>
-  <td>
+  <td align="right" class="install_right">{--LANG_OUTPUT_MODE--}:</td>
+  <td align="left">
     <select name="omode" size="1" class="install_select">
       <option value="render">{--MODE_RENDER--}</option>
       <option value="direct">{--MODE_DIRECT--}</option>
@@ -23,8 +23,8 @@
 </tr>
 <tr><td colspan="2" height="10" class="seperator">&nbsp;</td></tr>
 <tr>
-  <td class="install" align="right">{--WARN_NO_PASSWORD--}:&nbsp;&nbsp;</td>
-  <td>
+  <td align="right" class="install_right">{--WARN_NO_PASSWORD--}:</td>
+  <td align="left">
     <select name="warn_no_pass" size="1" class="install_select">
       <option value="Y">{--YES--}</option>
       <option value="N">{--NO--}</option>
@@ -33,8 +33,8 @@
 </tr>
 <tr><td colspan="2" height="10" class="seperator">&nbsp;</td></tr>
 <tr>
-  <td class="install" align="right">{--LANG_WRITE_FOOTER--}:&nbsp;&nbsp;</td>
-  <td>
+  <td align="right" class="install_right">{--LANG_WRITE_FOOTER--}:</td>
+  <td align="left">
     <select name="wfooter" size="1" class="install_select">
       <option value="Y">{--YES--}</option>
       <option value="N">{--NO--}</option>
@@ -43,8 +43,8 @@
 </tr>
 <tr><td colspan="2" height="10" class="seperator">&nbsp;</td></tr>
 <tr>
-  <td class="install" align="right">{--INSTALL_ENABLE_BACKLINK--}:&nbsp;&nbsp;</td>
-  <td>
+  <td align="right" class="install_right">{--INSTALL_ENABLE_BACKLINK--}:</td>
+  <td align="left">
     <select name="blink" size="1" class="install_select">
       <option value="Y">{--YES--}</option>
       <option value="N">{--NO--}</option>
index 866e5d4..f3c23b0 100644 (file)
@@ -74,3 +74,8 @@
        padding-top: 5px;
        padding-bottom: 10px;
 }
+
+.install_right {
+       text-align: right;
+       padding-right: 5px;
+}
index a8d5167..efe55de 100644 (file)
@@ -82,3 +82,8 @@
 .install_footer {
        padding-bottom: 10px;
 }
+
+.install_right {
+       text-align: right;
+       padding-right: 5px;
+}
index caf2741..9b0a3b8 100644 (file)
@@ -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;
+}