Fixes for installation phase, old lost call of FILTER_COMPILE_CONFIG() removed
authorRoland Häder <roland@mxchange.org>
Wed, 25 Nov 2009 17:08:42 +0000 (17:08 +0000)
committerRoland Häder <roland@mxchange.org>
Wed, 25 Nov 2009 17:08:42 +0000 (17:08 +0000)
inc/functions.php
inc/install-inc.php
inc/language/de.php
inc/libs/admins_functions.php
inc/load_config.php
inc/mysql-connect.php
inc/mysql-manager.php
inc/stats-functions.php
inc/wrapper-functions.php

index 41789fdc06a81327de61bfeda17cd4ff9d6afa9c..51e21667aac2164e7a38215c9a04b448d9569413 100644 (file)
@@ -229,7 +229,6 @@ function addFatalMessage ($F, $L, $message, $extra = '') {
        $GLOBALS['fatal_messages'][] = $message;
 
        // Log fatal messages away
-       debug_report_bug($message);
        logDebugMessage($F, $L, 'Fatal error message: ' . $message);
 }
 
@@ -427,12 +426,15 @@ function loadEmailTemplate ($template, $content = array(), $userid = '0') {
        // Is content an array?
        if (is_array($content)) {
                // Add expiration to array
-               if (getConfig('auto_purge') == '0') {
+               if ((isConfigEntrySet('auto_purge')) && (getConfig('auto_purge') == '0')) {
                        // Will never expire!
                        $content['expiration'] = getMessage('MAIL_WILL_NEVER_EXPIRE');
-               } else {
+               } elseif (isConfigEntrySet('auto_purge')) {
                        // Create nice date string
                        $content['expiration'] = createFancyTime(getConfig('auto_purge'));
+               } else {
+                       // Missing entry
+                       $content['expiration'] = getMessage('MAIL_NO_CONFIG_AUTO_PURGE');
                }
        } // END - if
 
@@ -2577,7 +2579,7 @@ function debug_report_bug ($message = '', $sendEmail = true) {
        $debug .= "Thank you for finding bugs.";
 
        // Send an email? (e.g. not wanted for evaluation errors)
-       if ($sendEmail === true) {
+       if (($sendEmail === true) && (!isInstallationPhase())) {
                // Prepare content
                $content = array(
                        'message'     => trim($message),
@@ -3163,7 +3165,8 @@ function shutdown () {
        // Call the filter chain 'shutdown'
        runFilterChain('shutdown', null);
 
-       if (SQL_IS_LINK_UP()) {
+       // Check if not in installation phase and the link is up
+       if ((!isInstallationPhase()) && (SQL_IS_LINK_UP())) {
                // Close link
                SQL_CLOSE(__FILE__, __LINE__);
        } elseif (!isInstallationPhase()) {
@@ -3823,7 +3826,7 @@ function encodeUrl ($url, $outputMode = '0') {
        if (strpos($url, session_name()) !== false) return $url;
 
        // Do we have a valid session?
-       if ((($GLOBALS['valid_session'] === false) || (!isset($_COOKIE[session_name()]))) && (isSpider() === false)) {
+       if (((!isset($GLOBALS['valid_session'])) || ($GLOBALS['valid_session'] === false) || (!isset($_COOKIE[session_name()]))) && (isSpider() === false)) {
                // Invalid session
                // Determine right seperator
                $seperator = '&amp;';
index 8dbe1a834b57ca38979d826e5f7dd91709b9b929..01c7ca8e0836c06f81f04376ed4cc987aad3aabe 100644 (file)
@@ -217,9 +217,6 @@ if ((!isInstalled()) || (!isAdminRegistered())) {
                                                                        // Read the file
                                                                        $fileContent = readFromFile($FQFN, true);
 
-                                                                       // Compile all config entries (we use a filter here, yes...)
-                                                                       $fileContent = FILTER_COMPILE_CONFIG($fileContent);
-
                                                                        // Split it up against ";\n" and merge it into existing SQLs
                                                                        mergeSqls(explode(";\n", $fileContent), 'install');
                                                                } else {
index c10b637c2516e389c973cb159e4d446baa173414..592db11ac376fd07780c89694570399bfe8848e3 100644 (file)
@@ -923,6 +923,7 @@ addMessages(array(
        'ADMIN_REMOVE_STATS_ENTRY' => "Hier klicken, um Mitgliederstatistik zu entfernen.",
        'ADMIN_USER_STATS_REMOVED' => "Mitgliederstatistiken entfernt.",
        'MAIL_WILL_NEVER_EXPIRE' => "Best&auml;tigungslink verfaellt nicht.",
+       'MAIL_NO_CONFIG_AUTO_PURGE' => "Konfigurationseintrag &#39;auto_purge&#39; fehlt.",
        'MEMBER_ENTER_MORE_RECEIVERS' => "Geben Sie mindestens ein Empf&auml;nger ein.",
        'MEMBER_NO_MORE_RECEIVERS_FOUND' => "Es konnten nicht ausreichend genug empfangsbereite Mitglieder gefunden werden.",
        'ADMIN_USER_PROFILE_TITLE' => "Mitgliedsprofil aufrufen",
index 6a1116e65e23958ab90059b480896ceacbeb6b47..4b3aa1bedfdd41bb87a2f8c4ffe84311d360758d 100644 (file)
@@ -181,7 +181,7 @@ function adminsChangeAdminAccount ($postData, $element = '') {
 
                        // Get admin's id
                        $adminId = getCurrentAdminId();
-                       $salt = substr(getAdminHash($adminId), 0, -40);
+                       $salt = substr(getAdminHash(getAdminLogin($adminId)), 0, -40);
 
                        // Rewrite cookie when it's own account
                        if ($adminId == $id) {
index 0f277b06e45109a8d524697d5aa935f447062f1b..b6fe037af48c0b17fbec4c1a6df679e952888a52 100644 (file)
@@ -80,13 +80,10 @@ if ((isIncludeReadable(getConfig('CACHE_PATH') . 'config-local.php')) && (isIncl
 
        // Set output mode here
        setConfigEntry('OUTPUT_MODE', 'render');
-} else {
-       // Redirect to install.php
-       redirectToUrl('install.php');
 }
 
 // Check if the user setups his MySQL stuff...
-if ((empty($GLOBALS['mysql']['login'])) && (!isInstalling()) && (!isGetRequestElementSet('installing')) && (isInstalled())) {
+if ((empty($GLOBALS['mysql']['login'])) && (!isInstalling()) && (!isInstallationPhase()) && (!isGetRequestElementSet('installing')) && (isInstalled())) {
        // No login entered and outside installation mode
        outputHtml('<strong>{--LANG_WARNING--}:</strong>');
        if (isInstalled()) {
@@ -96,7 +93,7 @@ if ((empty($GLOBALS['mysql']['login'])) && (!isInstalling()) && (!isGetRequestEl
                // Please run the installation script (maybe again)
                app_die(__FILE__, __LINE__, '{--DIE_RUN_INSTALL_MYSQL--}');
        }
-} elseif ((!isInstalling()) && (empty($GLOBALS['mysql']['password'])) && (getConfig('WARN_NO_PASS') == 'Y')) {
+} elseif ((!isInstalling()) && (!isInstallationPhase()) && (empty($GLOBALS['mysql']['password'])) && (getConfig('WARN_NO_PASS') == 'Y')) {
        // No database password entered!!!
        loadTemplate('admin_settings_saved', false, '<div>{--LANG_WARNING--}:</div> {--WARN_NULL_PASSWORD--}');
 }
index 45d1e87f67648beed2f9f92030aa12aafee867bc..8619a8510926b6439da01c74ad2093d1f9fd4cbf 100644 (file)
@@ -71,8 +71,8 @@ initFatalMessages();
 // Init message system
 initMessages();
 
-// Check if this file is writeable or read-only and warn the user
-if (!isInstalling()) {
+// Are we in installation phase?
+if ((!isInstalling()) && (!isInstallationPhase())) {
        // Load configuration file(s) here
        loadIncludeOnce('inc/load_config.php');
 
@@ -156,15 +156,15 @@ if (!isInstalling()) {
        // Load config
        loadIncludeOnce('inc/load_config.php');
 
+       // Init filter system here
+       initFilterSystem();
+
        // Are we installation routine?
        if ((!isInstalling()) && (getOutputMode() != 1) && (getOutputMode() != -1)) {
                // You have to install first!
                redirectToUrl('install.php');
        } // END - if
 
-       // Init filter system here
-       initFilterSystem();
-
        // Load cache
        loadIncludeOnce('inc/load_cache.php');
 
index 6d8b3c821ec58092dc016eb9376f0d9a6bc67819..b8f7fed89dcadc6667875e66a236c4b425cc6324 100644 (file)
@@ -1397,7 +1397,7 @@ function getAdminHash ($admin) {
                incrementStatsEntry('cache_hits');
        } elseif (!isExtensionActive('cache')) {
                // Load from database
-               $result = SQL_QUERY_ESC("SELECT `password` FROM `{?_MYSQL_PREFIX?}_admins` WHERE `id`=%s LIMIT 1",
+               $result = SQL_QUERY_ESC("SELECT `password` FROM `{?_MYSQL_PREFIX?}_admins` WHERE `login`='%s' LIMIT 1",
                        array($admin), __FUNCTION__, __LINE__);
 
                // Do we have an entry?
index e38e6114b7414ca749adc51428de4cfe25cea69c..931e40b22b27c6e0d6f4db05d26964c6751822aa 100644 (file)
@@ -173,7 +173,7 @@ function writeStatsTable () {
 // Filter for flushing statistics
 function FILTER_FLUSH_STATS () {
        // Now do we have stats?
-       if ((isset($GLOBALS['stats'])) && (getConfig('STATS_ENABLED') == 'Y')) {
+       if ((isset($GLOBALS['stats'])) && (!isInstallationPhase()) && (getConfig('STATS_ENABLED') == 'Y')) {
                // Write statistics to temporary table
                writeStatsTable();
        } // END - if
index 1e36678f6f863f53110d5a1863b03301c988b8fa..01accde60d52451f13fe0b5e0f8249e84eecfd1c 100644 (file)
@@ -400,6 +400,9 @@ function flushHeaders () {
        foreach ($GLOBALS['header'] as $header) {
                header($header);
        } // END - foreach
+
+       // Mark them as flushed
+       $GLOBALS['header'] = array();
 }
 
 // Wrapper function for chmod()