Fixes for various bugs (e.g.: 'secret file could not be read', SQL error and more)
authorRoland Häder <roland@mxchange.org>
Wed, 29 May 2013 19:26:47 +0000 (19:26 +0000)
committerRoland Häder <roland@mxchange.org>
Wed, 29 May 2013 19:26:47 +0000 (19:26 +0000)
12 files changed:
inc/config-functions.php
inc/extensions/bonus/mode-update.php
inc/filters.php
inc/install/install_page_3.php
inc/libs/bonus_functions.php
inc/libs/maintenance_functions.php
inc/libs/surfbar_functions.php
inc/libs/task_functions.php
inc/modules/admin/admin-inc.php
inc/wrapper-functions.php
install/tables.sql
templates/de/html/install/install_page5.tpl

index 7b398bc93e6d7c57b43d6f324ac13edf97e8f019..03ad13e7acb138763561b1b752ed33c0716a5499 100644 (file)
@@ -305,7 +305,7 @@ function updateConfiguration ($entries, $values, $updateMode = '', $config = '0'
                        // Update mode set?
                        if (!empty($updateMode)) {
                                // Update entry
-                               $SQL .= sprintf("`%s`=`%s`%s%s,", $entry, $entry, $updateMode, (float) $values[$idx]);
+                               $SQL .= sprintf("`%s`=`%s`%s%01.5f,", $entry, $entry, $updateMode, (float) $values[$idx]);
                        } else {
                                // Check if string or number but no array
                                if (is_array($values[$idx])) {
@@ -313,6 +313,7 @@ function updateConfiguration ($entries, $values, $updateMode = '', $config = '0'
                                        reportBug(__FUNCTION__, __LINE__, 'values[' . $idx . '] should not be an array! Content=<pre>'.print_r($values[$idx], TRUE).'</pre>');
                                } elseif ($values[$idx] == 'UNIX_TIMESTAMP()') {
                                        // Function UNIX_TIMESTAMP() detected
+                                       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Function UNIX_TIMESAMP() detected: entry=' . $entry);
                                        $SQL .= sprintf('`%s`=UNIX_TIMESTAMP(),', $entry);
 
                                        // Set timestamp in array as well
@@ -326,15 +327,17 @@ function updateConfiguration ($entries, $values, $updateMode = '', $config = '0'
 
                                        // Update mode set
                                        // @TODO Call setConfigEntry() somehow
-                                       $SQL .= $entries = sprintf('`%s`=`%s`%s%s', $entry, $entry, $updateMode, (float) $values[$idx]);
+                                       $SQL .= $entries = sprintf('`%s`=`%s`%s%01.5f', $entry, $entry, $updateMode, (float) $values[$idx]);
                                } elseif (($values[$idx] + 0) === $values[$idx]) {
                                        // Number detected
-                                       $SQL .= sprintf('`%s`=%s,', $entry, (float) $values[$idx]);
+                                       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Number detected: entry=' . $entry . ',values[' . $idx . '/' . gettype($values[$idx]) . ']=' . $values[$idx]);
+                                       $SQL .= sprintf('`%s`=%01.5f,', $entry, (float) $values[$idx]);
 
                                        // Set it in config as well
                                        setConfigEntry($entry, $values[$idx]);
                                } else {
                                        // String detected
+                                       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Regular value detected: entry=' . $entry . ',values[' . $idx . '/' . gettype($values[$idx]) . ']=' . $values[$idx]);
                                        $SQL .= sprintf("`%s`='%s',", $entry, sqlEscapeString($values[$idx]));
 
                                        // Set it in config as well
@@ -354,21 +357,24 @@ function updateConfiguration ($entries, $values, $updateMode = '', $config = '0'
 
                // Update mode set
                // @TODO Call setConfigEntry() somehow
-               $SQL = sprintf('`%s`=`%s`%s%s', $entries, $entries, $updateMode, (float) $values);
-       } elseif (($values + 0) === $values) {
-               // Number detected
-               $SQL = sprintf('`%s`=%s', $entries, (float) $values);
-
-               // Set it in config first
-               setConfigEntry($entries, (float) $values);
+               $SQL = sprintf('`%s`=`%s`%s%01.5f', $entries, $entries, $updateMode, (float) $values);
        } elseif ($values == 'UNIX_TIMESTAMP()') {
                // Function UNIX_TIMESTAMP() detected
+               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Function UNIX_TIMESAMP() detected: entries=' . $entries);
                $SQL = sprintf('`%s`=UNIX_TIMESTAMP()', $entries);
 
                // Set timestamp in array as well
                setConfigEntry($entries, time());
+       } elseif (($values + 0) === $values) {
+               // Number detected
+               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Number detected: entries=' . $entries . ',values[' . gettype($values) . ']=' . $values);
+               $SQL = sprintf('`%s`=%01.5f', $entries, (float) $values);
+
+               // Set it in config first
+               setConfigEntry($entries, (float) $values);
        } else {
                // Regular entry to update
+               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Regular value detected: entries=' . $entries . ',values[' . gettype($values) . ']=' . $values);
                $SQL = sprintf("`%s`='%s'", $entries, sqlEscapeString($values));
 
                // Set it in config as well
@@ -377,7 +383,7 @@ function updateConfiguration ($entries, $values, $updateMode = '', $config = '0'
 
        // Run database update
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'SQL=' . $SQL);
-       sqlQueryEscaped("UPDATE `{?_MYSQL_PREFIX?}_config` SET " . $SQL . " WHERE `config`=%s LIMIT 1",
+       sqlQueryEscaped('UPDATE `{?_MYSQL_PREFIX?}_config` SET ' . $SQL . ' WHERE `config`=%s LIMIT 1',
                        array(bigintval($config)), __FUNCTION__, __LINE__);
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'SQL=' . $SQL . ',affectedRows=' . sqlAffectedRows());
 
@@ -407,7 +413,7 @@ function FILTER_LOAD_CONFIGURATION ($no = '0') {
                incrementStatsEntry('cache_hits');
        } elseif ((!isExtensionActive('cache')) || (!isset($GLOBALS['cache_array']['config'][$no]))) {
                // Load config from DB
-               $result_config = sqlQueryEscaped("SELECT * FROM `{?_MYSQL_PREFIX?}_config` WHERE `config`='%s' LIMIT 1",
+               $result_config = sqlQueryEscaped('SELECT * FROM `{?_MYSQL_PREFIX?}_config` WHERE `config`=%s LIMIT 1',
                        array(bigintval($no)), __FUNCTION__, __LINE__);
 
                // Is the config there?
index 81a836c17a73fb402ff0ea964ae95216c3d74780..28985fb10679815057c1c23de0c9b47850179914 100644 (file)
@@ -372,11 +372,11 @@ ORDER BY
                                break;
 
                        case '0.6.9': // SQL queries for v0.6.9
-                               addConfigAddSql('bonus_order_yn', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
-                               addConfigAddSql('bonus_ref_yn', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
-                               addConfigAddSql('bonus_stats_yn', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
-                               addConfigAddSql('bonus_login_yn', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
-                               addConfigAddSql('bonus_click_yn', "ENUM('Y','N') NOT NULL DEFAULT 'Y'");
+                               addConfigAddSql('include_bonus_order', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
+                               addConfigAddSql('include_bonus_ref', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
+                               addConfigAddSql('include_bonus_stats', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
+                               addConfigAddSql('include_bonus_login', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
+                               addConfigAddSql('include_bonus_click', "ENUM('Y','N') NOT NULL DEFAULT 'Y'");
 
                                // Update notes (these will be set as task text!)
                                setExtensionUpdateNotes("Es k&ouml;nnen nun auch die folgenden Verg&uuml;tungen bei der Auswertung der monatlichen Aktiv-Rallye mit ber&uuml;cksichtigt werden: Mailbest&auml;tigung (war vorher schon), Login-, Mailbuchung, Referral und Statistik-Bonus (100% Klickrate erreicht).");
index e20d71821634e5103137441b894e0df7916b74cd..ceaf0e0ac9c47e6332df05342cf8a914989f7848 100644 (file)
@@ -1302,27 +1302,34 @@ function FILTER_ADD_HISTORY_ENTRY ($filterData) {
 
 // Filter for initializing ext-sql_patches
 function FILTER_GENERATE_FILE_SECRET_HASH ($filterData) {
-       // Transfer POINTS word
-       if (isExtensionInstalledAndNewer('sql_patches', '0.0.3')) {
-               // Okay, recent enough, so transfer the word for POINTS
-               setConfigEntry('POINTS', getPointsWord());
+       // Is ext-sql_patches installed and transfer POINTS word?
+       if ((!isExtensionInstalled('sql_patches')) || (!isExtensionInstalledAndNewer('sql_patches', '0.9.0'))) {
+               // Extension ext-sql_patches is missing, so better abort here
+               return;
        } // END - if
 
+       // Okay, recent enough, so transfer the word for POINTS
+       setConfigEntry('POINTS', getPointsWord());
+
        // Init key
        setConfigEntry('secret_key', '');
 
-       // File hash fas generated so we can also file the secret file... hopefully.
+       // File hash was generated so we can also file the secret file... hopefully.
        $hashFile = sprintf('%s%s.%s.cache', getPath(), getCachePath(), getFileHash());
 
        // Read key from secret file
        if ((getFileHash() == '') || (getMasterSalt() == '') || (getPassScramble() == '') || (!isFileReadable($hashFile))) {
                // Maybe need setup of secret key!
                loadIncludeOnce('inc/gen_sql_patches.php');
+
+               // Generate file name again
+               $hashFile = sprintf('%s%s.%s.cache', getPath(), getCachePath(), getFileHash());
        } // END - if
 
        // Test again
        if ((getFileHash() != '') && (getMasterSalt() != '') && (getPassScramble() != '')) {
                // Is the secret key file readable?
+               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'hashFile=' . $hashFile);
                if (isFileReadable($hashFile)) {
                        // Read file
                        setConfigEntry('secret_key', readFromFile($hashFile));
@@ -1365,7 +1372,7 @@ function FILTER_HANDLE_REFERRER_BANNER_CLICK ($filterData) {
        // Check required parameters
        if ((isGetRequestElementSet('user')) && (isGetRequestElementSet('banner'))) {
                // Update clicks counter...
-               sqlQueryEscaped("UPDATE `{?_MYSQL_PREFIX?}_refbanner` SET `clicks`=`clicks`+1 WHERE `id`=%s LIMIT 1",
+               sqlQueryEscaped('UPDATE `{?_MYSQL_PREFIX?}_refbanner` SET `clicks`=`clicks`+1 WHERE `id`=%s LIMIT 1',
                        array(bigintval(getRequestElement('banner'))), __FUNCTION__, __LINE__);
 
                // A line has been updated?
@@ -1384,7 +1391,7 @@ function FILTER_HANDLE_REFERRER_BANNER_VIEW ($filterData) {
        // Are all required parameters set
        if ((isGetRequestElementSet('user')) && (isGetRequestElementSet('banner'))) {
                // For later things... ;-)
-               $result = sqlQueryEscaped("SELECT `url` FROM `{?_MYSQL_PREFIX?}_refbanner` WHERE `id`=%s LIMIT 1",
+               $result = sqlQueryEscaped('SELECT `url` FROM `{?_MYSQL_PREFIX?}_refbanner` WHERE `id`=%s LIMIT 1',
                        array(bigintval(getRequestElement('banner'))), __FUNCTION__, __LINE__);
 
                // Is there the banner?
@@ -1393,7 +1400,7 @@ function FILTER_HANDLE_REFERRER_BANNER_VIEW ($filterData) {
                        $data = sqlFetchArray($result);
 
                        // Update counter
-                       sqlQueryEscaped("UPDATE `{?_MYSQL_PREFIX?}_refbanner` SET `counter`=`counter`+1 WHERE `id`=%s LIMIT 1",
+                       sqlQueryEscaped('UPDATE `{?_MYSQL_PREFIX?}_refbanner` SET `counter`=`counter`+1 WHERE `id`=%s LIMIT 1',
                                array(bigintval(getRequestElement('banner'))), __FUNCTION__, __LINE__);
 
                        // Set header and ...
index 57256a328dc7e19c71a9c04bece253a912d247b8..7a985dab6195e8bbbac99da0f4d093cd1b2c39df 100644 (file)
@@ -56,9 +56,9 @@ $smtpPass2 = '{?SMTP_PASSWORD?}';
 // Overwrite it with the data from sent (failed) form
 if (isPostRequestElementSet('smtp_host')) $smtpHost = postRequestElement('smtp_host');
 if (isPostRequestElementSet('smtp_user')) $smtpUser = postRequestElement('smtp_user');
-if (isPostRequestElementSet('smtp_pass')) {
-       $smtpPass1 = postRequestElement('smtp_pass');
-       $smtpPass2 = postRequestElement('smtp_pass');
+if (isPostRequestElementSet('smtp_password')) {
+       $smtpPass1 = postRequestElement('smtp_password');
+       $smtpPass2 = postRequestElement('smtp_password');
 } // END - if
 
 // Database login data
index f18d919011e194f616dc511ccceb1084e3135d9f..5a5f7f1e8a1156a5f5c714b558f0759e150d2af8 100644 (file)
@@ -289,25 +289,25 @@ function purgeExpiredTurboBonus () {
 // Determines whether the "bonus rallye" is active
 function isBonusRallyeActive () {
        // Is there cache?
-       if (!isset($GLOBALS['bonus_rallye_active'])) {
+       if (!isset($GLOBALS[__FUNCTION__])) {
                // Just determine it
-               $GLOBALS['bonus_rallye_active'] = (getBonusActive() == 'Y');
+               $GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('bonus', '0.4.4')) && (isConfigEntrySet('bonus_active')) && (getBonusActive() == 'Y'));
        } // END - if
 
        // Return cache
-       return $GLOBALS['bonus_rallye_active'];
+       return $GLOBALS[__FUNCTION__];
 }
 
 // Determines whether the "bonus new_member_notify" is active
 function isBonusNewMemberNotifyEnabled () {
        // Is there cache?
-       if (!isset($GLOBALS['bonus_new_member_notify_active'])) {
+       if (!isset($GLOBALS[__FUNCTION__])) {
                // Just determine it
-               $GLOBALS['bonus_new_member_notify_active'] = (getBonusNewMemberNotify() == 'Y');
+               $GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('bonus', '0.7.7')) && (isConfigEntrySet('bonus_new_member_notify')) && (getBonusNewMemberNotify() == 'Y'));
        } // END - if
 
        // Return cache
-       return $GLOBALS['bonus_new_member_notify_active'];
+       return $GLOBALS[__FUNCTION__];
 }
 
 // Getter for bonus_timeout
@@ -555,7 +555,7 @@ function isIncludeBonusClickEnabled () {
        // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
-               $GLOBALS[__FUNCTION__] = (getIncludeBonusClick() == 'Y');
+               $GLOBALS[__FUNCTION__] = ((isConfigEntrySet('include_bonus_click')) && (getIncludeBonusClick() == 'Y'));
        } // END - if
 
        // Return cache
@@ -567,7 +567,7 @@ function getIncludeBonusLogin () {
        // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
-               $GLOBALS[__FUNCTION__] = getConfig('include_bonus_login');
+               $GLOBALS[__FUNCTION__] = ((isConfigEntrySet('include_bonus_login')) && getConfig('include_bonus_login'));
        } // END - if
 
        // Return cache
@@ -579,7 +579,7 @@ function isIncludeBonusLoginEnabled () {
        // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
-               $GLOBALS[__FUNCTION__] = (getIncludeBonusLogin() == 'Y');
+               $GLOBALS[__FUNCTION__] = ((isConfigEntrySet('include_bonus_login')) && (getIncludeBonusLogin() == 'Y'));
        } // END - if
 
        // Return cache
@@ -603,7 +603,7 @@ function isIncludeBonusOrderEnabled () {
        // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
-               $GLOBALS[__FUNCTION__] = (getIncludeBonusOrder() == 'Y');
+               $GLOBALS[__FUNCTION__] = ((isConfigEntrySet('include_bonus_order')) && (getIncludeBonusOrder() == 'Y'));
        } // END - if
 
        // Return cache
@@ -627,7 +627,7 @@ function isIncludeBonusRefEnabled () {
        // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
-               $GLOBALS[__FUNCTION__] = (getIncludeBonusRef() == 'Y');
+               $GLOBALS[__FUNCTION__] = ((isConfigEntrySet('include_bonus_ref')) && (getIncludeBonusRef() == 'Y'));
        } // END - if
 
        // Return cache
@@ -651,7 +651,7 @@ function isIncludeBonusStatsEnabled () {
        // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
-               $GLOBALS[__FUNCTION__] = (getIncludeBonusStats() == 'Y');
+               $GLOBALS[__FUNCTION__] = ((isConfigEntrySet('include_bonus_stats')) && (getIncludeBonusStats() == 'Y'));
        } // END - if
 
        // Return cache
index 2d427c38d2291158ad58bf084388a1bb358d88ec..e9110d9abba7673dacc9e3087e63a795b4b12fa0 100644 (file)
@@ -61,7 +61,7 @@ function isMaintenanceEnabled () {
        // Is the cache entry set
        if (!isset($GLOBALS[__FUNCTION__])) {
                // No, so determine it
-               $GLOBALS[__FUNCTION__] = (getMaintenance() == 'Y');
+               $GLOBALS[__FUNCTION__] = ((isConfigEntrySet('maintenance')) && (getMaintenance() == 'Y'));
        } // END - if
 
        // Return cache
index 0f6bf029a8664c4a1ecdb68025ebac117d01be75..3acbc7c4d978aa2b610d114a83af3e2f97c8d7f8 100644 (file)
@@ -2001,7 +2001,7 @@ function isSurfbarAutoStartEnabled () {
        // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
-               $GLOBALS[__FUNCTION__] = (getSurfbarAutoStart() == 'Y');
+               $GLOBALS[__FUNCTION__] = ((isConfigEntry('surfbar_auto_start')) && (getSurfbarAutoStart() == 'Y'));
        } // END - if
 
        // Return cache
index d2ff048c90cdc0ca01f928d87745f89fde52f9d7..d7eda6440235981fb367b95428ecb5015445b814 100644 (file)
@@ -331,7 +331,7 @@ ORDER BY
        // Both extensions must be there
        if ((isExtensionInstalledAndNewer('bonus', '0.2.3')) && (isExtensionActive('user'))) {
                // Get more columns
-               $add = runFilterChain('add_bonus_points_user_columns', '');
+               $add = trim(runFilterChain('add_bonus_points_user_columns', ''));
 
                // Active rallye, so add more point columns, if not empty
                $pointsColumns = '';
@@ -348,7 +348,10 @@ ORDER BY
                        $lastOnline   = ' AND (UNIX_TIMESTAMP() - `last_online`) < {?ap_inactive_since?}';
                } // END - if
 
-               addSql("SELECT
+               // Is it empty?
+               if (!empty($ointsColumns)) {
+                       // No, then add it
+                       addSql("SELECT
        " . $pointsColumns . " AS `points`
 FROM
        `{?_MYSQL_PREFIX?}_user_data`
@@ -359,10 +362,11 @@ WHERE
 ORDER BY
        `points` DESC,
        `userid` ASC");
-               $WHATs[]  = 'list_bonus';
-               $DESCRs[] = '{--ADMIN_TASK_LIST_BONUS--}';
-               $TITLEs[] = '{--ADMIN_TASK_LIST_BONUS_TITLE--}';
-       }
+                       $WHATs[]  = 'list_bonus';
+                       $DESCRs[] = '{--ADMIN_TASK_LIST_BONUS--}';
+                       $TITLEs[] = '{--ADMIN_TASK_LIST_BONUS_TITLE--}';
+               } // END - if
+       } // END - if
 
        // Again both extensions must be there
        if ((isExtensionInstalledAndNewer('beg', '0.1.2')) && (isExtensionActive('user'))) {
index 9360b73c8ae581708cb69e5f1327a36f3c1fa0d0..078108d8f464f1e64958f21398e4fb67653857ee 100644 (file)
@@ -635,9 +635,9 @@ function adminSaveSettings (&$postData, $tableName = '_config', $whereStatement
        $result = FALSE;
        if ($alwaysAdd === FALSE) {
                if (!empty($whereStatement)) {
-                       $result = sqlQuery("SELECT * FROM `{?_MYSQL_PREFIX?}" . $tableName . "` WHERE " . $whereStatement . " LIMIT 1", __FUNCTION__, __LINE__);
+                       $result = sqlQuery('SELECT * FROM `{?_MYSQL_PREFIX?}' . $tableName . '` WHERE ' . $whereStatement . ' LIMIT 1', __FUNCTION__, __LINE__);
                } else {
-                       $result = sqlQuery("SELECT * FROM `{?_MYSQL_PREFIX?}" . $tableName . "` LIMIT 1", __FUNCTION__, __LINE__);
+                       $result = sqlQuery('SELECT * FROM `{?_MYSQL_PREFIX?}' . $tableName . '` LIMIT 1', __FUNCTION__, __LINE__);
                }
        } // END - if
 
@@ -646,7 +646,7 @@ function adminSaveSettings (&$postData, $tableName = '_config', $whereStatement
                $updatedData = implode(', ', $tableData);
 
                // Generate SQL string
-               $sql = sprintf("UPDATE `{?_MYSQL_PREFIX?}%s` SET %s WHERE %s LIMIT 1",
+               $sql = sprintf('UPDATE `{?_MYSQL_PREFIX?}%s` SET %s WHERE %s LIMIT 1',
                        $tableName,
                        $updatedData,
                        $whereStatement
@@ -666,7 +666,7 @@ function adminSaveSettings (&$postData, $tableName = '_config', $whereStatement
                $values = implode(', '  , $values);
 
                // Generate SQL string
-               $sql = sprintf("INSERT INTO `{?_MYSQL_PREFIX?}%s` (%s) VALUES (%s)",
+               $sql = sprintf('INSERT INTO `{?_MYSQL_PREFIX?}%s` (%s) VALUES (%s)',
                        $tableName,
                        $keys,
                        $values
@@ -698,7 +698,7 @@ function adminSaveSettings (&$postData, $tableName = '_config', $whereStatement
 // Generate a selection box
 function adminAddMenuSelectionBox ($menu, $type, $name, $default = '') {
        // Open the requested menu directory
-       $menuArray = getArrayFromDirectory(sprintf("inc/modules/%s/", $menu), $type . '-', FALSE, FALSE);
+       $menuArray = getArrayFromDirectory(sprintf('inc/modules/%s/', $menu), $type . '-', FALSE, FALSE);
 
        // Init the selection box
        $OUT = '<select name="' . $name . '" class="form_select" size="1"><option value="">{--ADMIN_IS_TOP_MENU--}</option>';
@@ -708,7 +708,7 @@ function adminAddMenuSelectionBox ($menu, $type, $name, $default = '') {
                // Is this a PHP script?
                if ((!isDirectory($file)) && (isInString('' . $type . '-', $file)) && (isInString('.php', $file))) {
                        // Then test if the file is readable
-                       $test = sprintf("inc/modules/%s/%s", $menu, $file);
+                       $test = sprintf('inc/modules/%s/%s', $menu, $file);
 
                        // Is the file there?
                        if (isIncludeReadable($test)) {
@@ -802,7 +802,7 @@ function adminGetMenuMode () {
                incrementStatsEntry('cache_hits');
        } elseif (isExtensionInstalledAndNewer('admins', '0.6.7')) {
                // Load from database when version of 'admins' is enough
-               $result = sqlQueryEscaped("SELECT `la_mode` FROM `{?_MYSQL_PREFIX?}_admins` WHERE `id`=%s LIMIT 1",
+               $result = sqlQueryEscaped('SELECT `la_mode` FROM `{?_MYSQL_PREFIX?}_admins` WHERE `id`=%s LIMIT 1',
                        array($adminId), __FUNCTION__, __LINE__);
 
                // Is there an entry?
@@ -836,7 +836,7 @@ function adminChangeActivationStatus ($IDs, $table, $row, $idRow = 'id') {
                        // Should always be set... ;-)
                        if (!empty($selected)) {
                                // Determine new status
-                               $result = sqlQueryEscaped("SELECT %s FROM `{?_MYSQL_PREFIX?}_%s` WHERE %s=%s LIMIT 1",
+                               $result = sqlQueryEscaped('SELECT %s FROM `{?_MYSQL_PREFIX?}_%s` WHERE `%s`=%s LIMIT 1',
                                        array(
                                                $row,
                                                $table,
@@ -853,7 +853,7 @@ function adminChangeActivationStatus ($IDs, $table, $row, $idRow = 'id') {
                                        $newStatus = convertBooleanToYesNo(!($currStatus == 'Y'));
 
                                        // Change this status
-                                       sqlQueryEscaped("UPDATE `{?_MYSQL_PREFIX?}_%s` SET %s='%s' WHERE %s=%s LIMIT 1",
+                                       sqlQueryEscaped("UPDATE `{?_MYSQL_PREFIX?}_%s` SET `%s`='%s' WHERE `%s`=%s LIMIT 1",
                                                array(
                                                        $table,
                                                        $row,
@@ -903,10 +903,10 @@ function adminBuilderStatusHandler ($mode, $tableName, $columns, $filterFunction
        // "Walk" through all entries
        foreach (postRequestElement($idColumn[0]) as $id => $sel) {
                // Construct SQL query
-               $sql = sprintf("UPDATE `{?_MYSQL_PREFIX?}_%s` SET", sqlEscapeString($tableName[0]));
+               $sql = sprintf('UPDATE `{?_MYSQL_PREFIX?}_%s` SET', sqlEscapeString($tableName[0]));
 
                // Load data of entry
-               $result = sqlQueryEscaped("SELECT * FROM `{?_MYSQL_PREFIX?}_%s` WHERE `%s`=%s LIMIT 1",
+               $result = sqlQueryEscaped('SELECT * FROM `{?_MYSQL_PREFIX?}_%s` WHERE `%s`=%s LIMIT 1',
                        array(
                                $tableName[0],
                                $idColumn[0],
@@ -952,7 +952,7 @@ function adminBuilderStatusHandler ($mode, $tableName, $columns, $filterFunction
                                // Are there brackets () at the end?
                                if (substr($entries[$id], -2, 2) == '()') {
                                        // Direct SQL command found
-                                       $sql .= sprintf(" `%s`=%s,", sqlEscapeString($key), sqlEscapeString($entries[$id]));
+                                       $sql .= sprintf(' `%s`=%s,', sqlEscapeString($key), sqlEscapeString($entries[$id]));
                                } else {
                                        // Add regular entry
                                        $sql .= sprintf(" `%s`='%s',", sqlEscapeString($key), sqlEscapeString($entries[$id]));
index 20169be5dd324ab3e6199474f65343fd935370df..9eee082a5fb26ac7d776654bca2d5d5ffd5d958c 100644 (file)
@@ -829,7 +829,7 @@ function isBlockModeEnabled () {
        // Abort if not set
        if (!isset($GLOBALS['__block_mode'])) {
                // Needs to be fixed
-               reportBug(__FUNCTION__, __LINE__, 'Block_mode is not set.');
+               reportBug(__FUNCTION__, __LINE__, '__block_mode is not set.');
        } // END - if
 
        // Return it
@@ -1175,7 +1175,7 @@ function isDebugTemplateCacheEnabled () {
        // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
-               $GLOBALS[__FUNCTION__] = (getConfig('DEBUG_TEMPLATE_CACHE') == 'Y');
+               $GLOBALS[__FUNCTION__] = ((isConfigEntrySet('DEBUG_TEMPLATE_CACHE')) && (getConfig('DEBUG_TEMPLATE_CACHE') == 'Y'));
        } // END - if
 
        // Return cache
@@ -1594,7 +1594,7 @@ function isTitleDecorationEnabled () {
        // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Just check it
-               $GLOBALS[__FUNCTION__] = (getConfig('enable_title_deco') == 'Y');
+               $GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('sql_patches', '0.1.6')) && (isConfigEntrySet('enable_title_deco')) && (getConfig('enable_title_deco') == 'Y'));
        } // END - if
 
        // Return cache
@@ -1654,7 +1654,7 @@ function isDisplayDebugSqlEnabled () {
        // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
-               $GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('other', '0.2.2')) && (getDisplayDebugSqls() == 'Y'));
+               $GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('other', '0.2.2')) && (isConfigEntrySet('display_debug_sql')) && (getDisplayDebugSqls() == 'Y'));
        } // END - if
 
        // Return cache
@@ -1666,7 +1666,7 @@ function isModuleTitleEnabled () {
        // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
-               $GLOBALS[__FUNCTION__] = (getConfig('enable_mod_title') == 'Y');
+               $GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('sql_patches', '0.1.6')) && (isConfigEntrySet('enable_mod_title')) && (getConfig('enable_mod_title') == 'Y'));
        } // END - if
 
        // Return cache
@@ -1678,7 +1678,7 @@ function isWhatTitleEnabled () {
        // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
-               $GLOBALS[__FUNCTION__] = (getConfig('enable_what_title') == 'Y');
+               $GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('sql_patches', '0.1.6')) && (isConfigEntrySet('enable_what_title')) && (getConfig('enable_what_title') == 'Y'));
        } // END - if
 
        // Return cache
@@ -1714,7 +1714,7 @@ function isAdminNotificationEnabled () {
        // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
-               $GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('other', '0.3.0')) && (getAdminNotify() == 'Y'));
+               $GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('other', '0.3.0')) && (isConfigEntrySet('admin_notify')) && (getAdminNotify() == 'Y'));
        } // END - if
 
        // Return cache
@@ -1726,7 +1726,7 @@ function isRandomReferralIdEnabled () {
        // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
-               $GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('user', '0.3.4')) && (getSelectUserZeroRefid() == 'Y'));
+               $GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('user', '0.3.4')) && (isConfigEntrySet('select_user_zero_refid')) && (getSelectUserZeroRefid() == 'Y'));
        } // END - if
 
        // Return cache
@@ -2601,7 +2601,7 @@ function isDisplayHomeInIndexEnabled () {
        // Is the cache entry set?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // No, so determine it
-               $GLOBALS[__FUNCTION__] = (getDisplayHomeInIndex() == 'Y');
+               $GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('sql_patches', '0.8.3')) && (isConfigEntrySet('display_home_in_index')) && (getDisplayHomeInIndex() == 'Y'));
        } // END - if
 
        // Return cached entry
@@ -2625,7 +2625,7 @@ function isShowPointsUnconfirmedEnabled () {
        // Is the cache entry set?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // No, so determine it
-               $GLOBALS[__FUNCTION__] = (getShowPointsUnconfirmed() == 'Y');
+               $GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('sql_patches', '0.5.5')) && (isConfigEntrySet('show_points_unconfirmed')) && (getShowPointsUnconfirmed() == 'Y'));
        } // END - if
 
        // Return cached entry
@@ -2649,7 +2649,7 @@ function isYoureHereEnabled () {
        // Is the cache entry set?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // No, so determine it
-               $GLOBALS[__FUNCTION__] = (getYoureHere() == 'Y');
+               $GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('sql_patches', '0.2.3')) && (isConfigEntrySet('youre_here')) && (getYoureHere() == 'Y'));
        } // END - if
 
        // Return cached entry
@@ -2673,7 +2673,7 @@ function isShowTimingsEnabled () {
        // Is the cache entry set?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // No, so determine it
-               $GLOBALS[__FUNCTION__] = (getShowTimings() == 'Y');
+               $GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('sql_patches', '0.4.1')) && (isConfigEntrySet('show_timings')) && (getShowTimings() == 'Y'));
        } // END - if
 
        // Return cached entry
@@ -2910,7 +2910,7 @@ function isDirectPaymentEnabled () {
        // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
-               $GLOBALS[__FUNCTION__] = (getConfig('allow_direct_pay') == 'Y');
+               $GLOBALS[__FUNCTION__] = ((isConfigEntrySet('allow_direct_pay')) && (getConfig('allow_direct_pay') == 'Y'));
        } // END - if
 
        // Return cache
@@ -2922,7 +2922,7 @@ function isAdminMenuJavascriptEnabled () {
        // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
-               $GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('sql_patches', '0.8.7')) && (getAdminMenuJavaScript() == 'Y'));
+               $GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('sql_patches', '0.8.7')) && (isConfigEntrySet('admin_menu_javascript')) && (getAdminMenuJavaScript() == 'Y'));
        } // END - if
 
        // Return cache
index 2f8f6f6af5ed351734ca316ee4555d214422d984..9ceee334fcdd2bed080c5eb8541e957dcf181103 100644 (file)
@@ -31,7 +31,7 @@ CREATE TABLE `{?_MYSQL_PREFIX?}_cats` (
 DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_config`;
 CREATE TABLE `{?_MYSQL_PREFIX?}_config` (
   `config` TINYINT(1) NOT NULL DEFAULT 0,
-  `pass_len` TINYINT(3) UNSIGNED NOT NULL DEFAULT 5,
+  `min_password_length` TINYINT(3) UNSIGNED NOT NULL DEFAULT 5,
   `points_register` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
   `points_ref` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
   `url_tlock` BIGINT(20) UNSIGNED NOT NULL DEFAULT 86400,
index 83ecc7830affe419fa80574ac901d042a4a8def7..c5550fd3d388163accf6d779c605e819d534640b 100644 (file)
@@ -57,7 +57,7 @@
                <input type="hidden" name="email" value="$content[email]" />
                <input type="hidden" name="smtp_host" value="$content[smtp_host]" />
                <input type="hidden" name="smtp_user" value="$content[smtp_user]" />
-               <input type="hidden" name="smtp_pass" value="$content[smtp_pass]" />
+               <input type="hidden" name="smtp_password" value="$content[smtp_password]" />
                <input type="submit" class="form_submit" name="finalize" value="{--INSTALLER_NEXT_PAGE--}" />
        </td>
 </tr>