]> git.mxchange.org Git - mailer.git/commitdiff
One more wrapper function introduced, fixed for installation phase
authorRoland Häder <roland@mxchange.org>
Mon, 5 Jul 2010 18:47:02 +0000 (18:47 +0000)
committerRoland Häder <roland@mxchange.org>
Mon, 5 Jul 2010 18:47:02 +0000 (18:47 +0000)
inc/extensions/ext-sql_patches.php
inc/gen_sql_patches.php
inc/modules/admin/overview-inc.php
inc/modules/admin/what-config_secure.php
inc/wrapper-functions.php

index 4d73669ae9011b348103960ee010074dba098603..64883e68b3df23c8d11cd3314ce926e95194d640 100644 (file)
@@ -756,17 +756,8 @@ INDEX (`ip`)
 
                // Read key from secret file
                if ((isExtensionInstalledAndNewer('sql_patches', '0.3.6')) && ((getFileHash() == '') || (getMasterSalt() == '') || (getPassScramble() == ''))) {
-                       // Cache instance
                        // Maybe need setup of secret key!
                        loadIncludeOnce('inc/gen_sql_patches.php');
-
-                       // @TODO Rewrite this to a filter
-                       if ((isExtensionInstalledAndNewer('cache', '0.1.2')) && (isCacheInstanceValid())) {
-                               // Destroy some cache files
-                               if ($GLOBALS['cache_instance']->loadCacheFile('config'))    $GLOBALS['cache_instance']->removeCacheFile();
-                               if ($GLOBALS['cache_instance']->loadCacheFile('extension')) $GLOBALS['cache_instance']->removeCacheFile();
-                               if ($GLOBALS['cache_instance']->loadCacheFile('modules'))   $GLOBALS['cache_instance']->removeCacheFile();
-                       } // END - if
                } // END - if
 
                // Test again
index 184eb28e307f8fb5527266d3e5733edf8b28227c..3d2a48dfe5da78d94ac1e8c234abd54ab7b73739 100644 (file)
@@ -85,6 +85,7 @@ if (getFileHash() == '') {
        if (isFileReadable($FQFN)) {
                // Also update configuration
                setConfigEntry('secret_key', $secretKey);
+               updateConfiguration('file_hash', $fileHash);
 
                // Remove variables
                unset($secretKey);
@@ -92,5 +93,13 @@ if (getFileHash() == '') {
        } // END - if
 } // END - if
 
+// @TODO Rewrite this to a filter
+if ((isExtensionInstalledAndNewer('cache', '0.1.2')) && (isCacheInstanceValid())) {
+       // Destroy some cache files
+       if ($GLOBALS['cache_instance']->loadCacheFile('config'))    $GLOBALS['cache_instance']->removeCacheFile();
+       if ($GLOBALS['cache_instance']->loadCacheFile('extension')) $GLOBALS['cache_instance']->removeCacheFile();
+       if ($GLOBALS['cache_instance']->loadCacheFile('modules'))   $GLOBALS['cache_instance']->removeCacheFile();
+} // END - if
+
 // [EOF]
 ?>
index 870c5b277eff6ef2760f305b5096b4dcf91014cc..73077463a7090f2e2a0b18a1478ec1e46e318cb5 100644 (file)
@@ -133,7 +133,7 @@ function outputSeletectedTasks ($postData, $result_tasks) {
        if ((isset($postData['assign'])) && (count($postData['sel']) > 0)) {
                // Assign / do tasks
                $OUT = '';
-               foreach ($postData['sel'] as $id => $sel) {
+               foreach ($postData['sel'] as $taskId => $sel) {
                        $result_task = SQL_QUERY_ESC("SELECT
        `id`, `userid`, `task_type`, `subject`, `text`, `task_created`, `status`, `assigned_admin`
 FROM
@@ -142,7 +142,7 @@ WHERE
        `id`=%s AND (`assigned_admin`=%s OR (`assigned_admin`=0 AND `status`='NEW'))
 LIMIT 1",
                                array(
-                                       bigintval($id),
+                                       bigintval($taskId),
                                        getCurrentAdminId()
                                ), __FILE__, __LINE__);
 
@@ -195,14 +195,14 @@ LIMIT 1",
                                $title = '{--TASK_NO_TITLE--}';
 
                                // Shall I list SQL commands assigned to an extension installation or update task?
-                               if (isVerboseSqlEnabled()) {
+                               if ((isVerboseSqlEnabled()) || (!isExtensionInstalled('sql_patches'))) {
                                        // Extract extension name from subject
                                        $ext_name = substr($taskData['subject'], 1, strpos($taskData['subject'], ':') - 1);
 
                                        // Update task or extension task?
                                        if (($taskData['task_type'] == 'EXTENSION') && (!isExtensionInstalled($ext_name))) {
                                                // Load SQL commands for registering in dry-run
-                                               registerExtension($ext_name, $id, true);
+                                               registerExtension($ext_name, $taskId, true);
 
                                                // Is this non-productive?
                                                if (isExtensionProductive() === false) {
@@ -285,7 +285,7 @@ LIMIT 1",
                                                if ($lines == '0') {
                                                        // New extension found
                                                        $OUT .= loadTemplate('admin_extension_reg_form', true, array(
-                                                               'id'       => bigintval($id),
+                                                               'id'       => bigintval($taskId),
                                                                'ext_name' => $ext_name
                                                        ));
                                                } else {
@@ -378,12 +378,12 @@ LIMIT 1",
                                                break;
 
                                        case 'MEMBER_ORDER': // Member mail orders
-                                               $OUT .= loadTemplate('admin_task_order', true, $id);
+                                               $OUT .= loadTemplate('admin_task_order', true, $taskId);
                                                break;
 
                                        default: // Unknown task type
                                                logDebugMessage(__FILE__, __LINE__, sprintf("Unknown task type %s detected.", $taskData['task_type']));
-                                               $OUT .= '<div class="admin_failed medium">' . sprintf(getMessage('ADMIN_UNKNOWN_TASK_TYPE'), $taskData['task_type'], $id) . '</div>';
+                                               $OUT .= '<div class="admin_failed medium">' . sprintf(getMessage('ADMIN_UNKNOWN_TASK_TYPE'), $taskData['task_type'], $taskId) . '</div>';
                                                break;
                                }
                                $OUT .= '
@@ -402,15 +402,15 @@ LIMIT 1",
                        // Only unassign / delete tasks when there are selected tasks posted
                        if (!empty($postData['unassign'])) {
                                // Unassign from tasks
-                               foreach ($postData['sel'] as $id => $sel) {
+                               foreach ($postData['sel'] as $taskId => $sel) {
                                        SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_task_system` SET `assigned_admin`=0 WHERE `id`=%s AND `assigned_admin`=%s LIMIT 1",
-                                               array(bigintval($id), getCurrentAdminId()), __FILE__, __LINE__);
+                                               array(bigintval($taskId), getCurrentAdminId()), __FILE__, __LINE__);
                                }
                        } elseif (isset($postData['del'])) {
                                // Delete tasks
-                               foreach ($postData['sel'] as $id => $sel) {
+                               foreach ($postData['sel'] as $taskId => $sel) {
                                        SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_task_system` WHERE `id`=%s AND `assigned_admin` IN (%s,0) LIMIT 1",
-                                               array(bigintval($id), getCurrentAdminId()), __FILE__, __LINE__);
+                                               array(bigintval($taskId), getCurrentAdminId()), __FILE__, __LINE__);
                                }
                        } else {
                                // Unknown action
index 3cd889890c443bd92d1a9451d60eeee6a940d73a..db890563e982d87b0fbd00d379c68539dab5d721 100644 (file)
@@ -52,7 +52,7 @@ if (isFormSent()) {
                loadInclude('inc/gen_sql_patches.php');
 
                // Forget the wrong number!
-               unsetPostRequestParameter(('salt_length'));
+               unsetPostRequestParameter('salt_length');
 
                // Redirect to logout link
                redirectToUrl('modules.php?module=admin&amp;logout=1');
index 58674e06497c8a84ff2f52a4aa55287735c46c3e..bc89dfc63f560e1c950c87ad75646ade19ef57ad 100644 (file)
@@ -1418,6 +1418,18 @@ function getMysqlPrefix () {
        return $GLOBALS['mysql_prefix'];
 }
 
+// "Getter" for table_type
+function getTableType () {
+       // Do we have cache?
+       if (!isset($GLOBALS['table_type'])) {
+               // Determine it
+               $GLOBALS['table_type'] = getConfig('_TABLE_TYPE');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS['table_type'];
+}
+
 // "Getter" for salt_length
 function getSaltLength () {
        // Do we have cache?