Rewrites/fixes in extension registration
authorRoland Häder <roland@mxchange.org>
Wed, 30 Jun 2010 22:28:22 +0000 (22:28 +0000)
committerRoland Häder <roland@mxchange.org>
Wed, 30 Jun 2010 22:28:22 +0000 (22:28 +0000)
26 files changed:
DOCS/TODOs.txt
inc/extensions-functions.php
inc/extensions/ext-active.php
inc/extensions/ext-admins.php
inc/extensions/ext-bonus.php
inc/extensions/ext-booking.php
inc/extensions/ext-cache.php
inc/extensions/ext-mediadata.php
inc/extensions/ext-online.php
inc/extensions/ext-other.php
inc/extensions/ext-politician-stop.php
inc/extensions/ext-rallye.php
inc/extensions/ext-register.php
inc/extensions/ext-removeip.php
inc/extensions/ext-sql_patches.php
inc/extensions/ext-theme.php
inc/extensions/ext-timezone.php
inc/extensions/ext-uberwach.php
inc/filter-functions.php
inc/filters.php
inc/gen_mediadata.php
inc/gen_refback.php
inc/libs/online_functions.php
inc/modules/admin/what-extensions.php
inc/template-functions.php
templates/de/html/admin/admin_next_link.tpl

index 8776ad3ec8edf1dc7b3e0cda1efd1f952da9107c..e5559cdabffb8b06e587cc30b9b7cefdbdbacb1b 100644 (file)
@@ -39,8 +39,8 @@
 ./inc/extensions/ext-yoomedia.php:123:         // @TODO Can this be moved into a database table?
 ./inc/extensions/ext-yoomedia.php:56:// @TODO Only deprecated when 'ext-network' is ready! setExtensionDeprecated('Y');
 ./inc/extensions-functions.php:143:    // @TODO Do we still need this? setExtensionUpdateNotes('');
-./inc/extensions-functions.php:425:// @TODO Change from ext_id to ext_name (not just even the variable! ;-) )
-./inc/extensions-functions.php:541:            // @TODO Extension is loaded, what next?
+./inc/extensions-functions.php:424:// @TODO Change from ext_id to ext_name (not just even the variable! ;-) )
+./inc/extensions-functions.php:540:            // @TODO Extension is loaded, what next?
 ./inc/functions.php:115:               // @TODO Extension 'msg' does not exist
 ./inc/functions.php:1482:                      // @TODO Move this SQL code into a function, let's say 'getTimestampFromPoolId($id) ?
 ./inc/functions.php:1505:                      // @TODO Rewrite this old lost code to a template
 ./inc/modules/admin/what-del_email.php:61:             // @TODO Unused: cat_id, payment_id
 ./inc/modules/admin/what-edit_user.php:20: * @TODO Add support for ext-country                                    *
 ./inc/modules/admin/what-email_stats.php:48:// @TODO Unused at the moment
-./inc/modules/admin/what-extensions.php:354:                                           // @TODO Rewrite this to a filter
+./inc/modules/admin/what-extensions.php:357:                                           // @TODO Rewrite this to a filter
 ./inc/modules/admin/what-guest_add.php:137:                            // @TODO This can be somehow rewritten to a function
 ./inc/modules/admin/what-guest_add.php:69:             // @TODO Cant this be rewritten?
 ./inc/modules/admin/what-guest_add.php:85:             // @TODO This can be somehow rewritten to a function
index f1df6010e5bdc4ea34f18cb27130c9107dd88183..109b30f1d282eb4704cc630e91db582d1a01091f 100644 (file)
@@ -116,7 +116,7 @@ function loadExtension ($ext_name, $ext_mode = 'init', $ext_ver = '', $dry_run =
        if (isExtensionFunctionFileReadable($ext_name)) {
                // Not yet loaded?
                if ((($GLOBALS['cache_array']['extension']['ext_func'][$ext_name] == 'Y') || (!isset($GLOBALS['cache_array']['extension']['ext_func'][$ext_name]))) && (!isset($GLOBALS['ext_loaded']['funcs'][$ext_name]))) {
-                       // Construct FQFN for functions file
+                       // Construct IFN for functions file
                        $funcsInclude = sprintf("inc/libs/%s_functions.php", $ext_name);
 
                        // Mark it as loaded
@@ -284,8 +284,7 @@ function registerExtension ($ext_name, $taskId, $dry_run = false, $logout = true
 
                                                // Reset extension name
                                                setCurrentExtensionName($ext_name);
-                                               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'currName=' . getCurrentExtensionName());
-                                               //* DEBUG: */ debugOutput(getCurrentExtensionName().':<pre>' . print_r($test, true) . '</pre>');
+                                               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'currName=' . getCurrentExtensionName() . ',test=' . intval($test));
                                        } // END - if
                                } elseif ($ext_ver != getCurrentExtensionVersion()) {
                                        // Ok, update this extension now
@@ -325,11 +324,9 @@ function registerExtension ($ext_name, $taskId, $dry_run = false, $logout = true
                setExtensionMode('register');
 
                // Remains true if extension registration reports no failures
-               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'currName=' . getCurrentExtensionName());
-               //* DEBUG: */ debugOutput(getCurrentExtensionName().':<pre>' . print_r($test, true) . '</pre>');
+               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'currName=' . getCurrentExtensionName() . ',test=' . intval($test));
                $test = (($test === true) && (getExtensionReportsFailure() === false));
-               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'currName=' . getCurrentExtensionName());
-               //* DEBUG: */ debugOutput(getCurrentExtensionName().':<pre>' . print_r($test, true) . '</pre>');
+               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'currName=' . getCurrentExtensionName() . ',test=' . intval($test));
 
                // Does everthing before wents ok?
                if ($test === true) {
@@ -366,6 +363,9 @@ function registerExtension ($ext_name, $taskId, $dry_run = false, $logout = true
                                                ), __FUNCTION__, __LINE__);
                                }
 
+                               // Use the insert id as extension id and cache it for early usage
+                               $GLOBALS['cache_array']['extension']['ext_id'][getCurrentExtensionName()] = SQL_INSERTID();
+
                                // Remove cache file(s) if extension is active
                                runFilterChain('post_extension_installed', array(
                                        'pool'     => 'extension',
@@ -375,7 +375,7 @@ function registerExtension ($ext_name, $taskId, $dry_run = false, $logout = true
 
                                // Re-init queries and notes
                                initExtensionSqls(true);
-                               initExtensionNotes();
+                               initExtensionNotes(true);
 
                                // Mark it as installed
                                $GLOBALS['ext_is_installed'][getCurrentExtensionName()] = true;
@@ -416,8 +416,7 @@ function registerExtension ($ext_name, $taskId, $dry_run = false, $logout = true
        } // END - if
 
        // Return status code
-       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'currName=' . getCurrentExtensionName() . ',ext_name=' . $ext_name . ' - EXIT!');
-       //* DEBUG: */ debugOutput(getCurrentExtensionName().':<pre>'.print_r($ret, true).'</pre>');
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'currName=' . getCurrentExtensionName() . ',ext_name=' . $ext_name . ',test=' . intval($test) . ' - EXIT!');
        return $ret;
 }
 
@@ -446,14 +445,14 @@ function doExtensionSqls ($ext_id, $load_mode) {
        $sqlRan = false;
 
        // Load extension in detected mode
-       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, ":ext_name[{$ext_id}]=".getCurrentExtensionName()."");
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name[' . $ext_id . ']=' . getCurrentExtensionName());
        loadExtension(getCurrentExtensionName(), $load_mode, '', false);
 
        // Init these SQLs
        initSqls();
        setSqlsArray(getExtensionSqls());
 
-       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, ":SQLs::count=".countSqls()."");
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'SQLs::count=' . countSqls());
        if (isSqlsValid()) {
                // Run SQL commands...
                runFilterChain('run_sqls');
@@ -469,10 +468,10 @@ function doExtensionSqls ($ext_id, $load_mode) {
        } // END - if
 
        // Is this the sql_patches?
-       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, ": id=".$ext_id.",currName=".getCurrentExtensionName().",loadMode=".$load_mode);
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'id=' . $ext_id . ',currName=' . getCurrentExtensionName() . ',loadMode=' . $load_mode);
        if ((getCurrentExtensionName() == 'sql_patches') && (($load_mode == 'register') || ($load_mode == 'remove'))) {
                // Then redirect to logout
-               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, ": LOAD!");
+               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, ': LOAD!');
                redirectToUrl('modules.php?module=admin&amp;logout=1&amp;' . $load_mode . '=sql_patches');
        } // END - if
 }
@@ -532,7 +531,7 @@ function isExtensionActive ($ext_name) {
        // Check cache
        if (isset($GLOBALS['cache_array']['extension']['ext_active'][$ext_name])) {
                // Load from cache
-               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "CACHE! ext_name={$ext_name}");
+               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'CACHE! ext_name=' . $ext_name);
                $data['ext_active'] = $GLOBALS['cache_array']['extension']['ext_active'][$ext_name];
 
                // Count cache hits
@@ -541,7 +540,7 @@ function isExtensionActive ($ext_name) {
                // @TODO Extension is loaded, what next?
                debug_report_bug(__FUNCTION__, __LINE__, 'LOADED:' . $ext_name);
        } elseif (($ext_name == 'cache') || (!isExtensionInstalled('cache'))) {
-               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "DB! ext_name={$ext_name}");
+               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'DB! ext_name=' . $ext_name);
                // Load from database
                $result = SQL_QUERY_ESC("SELECT `ext_active` FROM `{?_MYSQL_PREFIX?}_extensions` WHERE `ext_name`='%s' LIMIT 1",
                        array($ext_name), __FUNCTION__, __LINE__);
@@ -556,16 +555,16 @@ function isExtensionActive ($ext_name) {
                SQL_FREERESULT($result);
 
                // Write cache array
-               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "ext_name=".$ext_name."[DB]: ".$data['ext_active']."");
+               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name=' . $ext_name . '[DB]: ' . $data['ext_active']);
                $GLOBALS['cache_array']['extension']['ext_active'][$ext_name] = $data['ext_active'];
        } else {
                // Extension not active!
-               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "ext_name=".$ext_name.": Not active!");
+               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name=' . $ext_name . ': Not active!');
                $GLOBALS['cache_array']['extension']['ext_active'][$ext_name] = 'N';
        }
 
        // Debug message
-       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "ext_name=".$ext_name.",active=".$data['ext_active']."");
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name=' . $ext_name . ',active=' . $data['ext_active']);
 
        // Is this extension activated? (For admins we always have active extensions...)
        return ($data['ext_active'] == 'Y');
@@ -584,7 +583,7 @@ function getExtensionVersion ($ext_name, $force = false) {
 
        // Extensions are all inactive during installation
        if (isInstallationPhase()) return '';
-       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, ": ext_name=".$ext_name."");
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name=' . $ext_name);
 
        // Is the cache written?
        if (isset($GLOBALS['cache_array']['extension']['ext_version'][$ext_name])) {
@@ -623,7 +622,7 @@ function getExtensionVersion ($ext_name, $force = false) {
        } // END - if
 
        // Return result
-       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, ": ret={$data['ext_version']}");
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_version=' . $data['ext_version']);
        return $data['ext_version'];
 }
 
@@ -1231,7 +1230,7 @@ function addExtensionUpdateDependency ($updateDepends) {
        } // END - if
 
        // Is it not yet added?
-       /* DEBUG:
+       /* Only for debugging!
        if ((isset($updateDepends, $GLOBALS['ext_running_updates'][getCurrentExtensionName()])) && (in_array($updateDepends, getExtensionUpdatesRunning()))) {
                // Double-adding isn't fine, too
                debug_report_bug(__FUNCTION__, __LINE__, '() called twice: updateDepends=' . $updateDepends . ',currentExtension=' . getCurrentExtensionName());
@@ -1417,7 +1416,7 @@ function getExtensionVersionHistory () {
 // Setter for EXT_UPDATE_NOTES
 function setExtensionUpdateNotes ($updateNotes, $ext_ver = '') {
        // . '/' . getCurrentExtensionVersion()
-       //* DEBUG: */ debug_report_bug(__FUNCTION__.':' . getCurrentExtensionName() . '/' . getExtensionMode() . '/' . $ext_ver . '=' . $updateNotes);
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'getCurrentExtensionName()=' . getCurrentExtensionName() . ',getExtensionMode()=' . getExtensionMode() . ',ext_ver=' . $ext_ver . ',updateNotes()=' . strlen($updateNotes));
        if (empty($ext_ver)) {
                $GLOBALS['ext_update_notes'][getCurrentExtensionName()][getCurrentExtensionVersion()] = (string) $updateNotes;
        } else {
@@ -1436,9 +1435,9 @@ function isExtensionUpdateNoteSet ($ext_ver) {
 }
 
 // Init extension notice
-function initExtensionNotes () {
+function initExtensionNotes ($force = false) {
        // Is it already initialized?
-       if (isset($GLOBALS['ext_notes'][getCurrentExtensionName()])) {
+       if (($force === false) && (isset($GLOBALS['ext_notes'][getCurrentExtensionName()]))) {
                // This is mostly not wanted, so please report it
                debug_report_bug(__FUNCTION__, __LINE__, 'ext_notes already set for extension ' . getCurrentExtensionName());
        } // END - if
@@ -1477,7 +1476,7 @@ function getCurrentExtensionName () {
 // Init SQLs array for current extension
 function initExtensionSqls ($force = false) {
        // Auto-init the array or if forced
-       if ((!isset($GLOBALS['ext_sqls'][getCurrentExtensionName()])) || ($force === true)) {
+       if (($force === true) || (!isset($GLOBALS['ext_sqls'][getCurrentExtensionName()]))) {
                // Set the array
                $GLOBALS['ext_sqls'][getCurrentExtensionName()] = array();
 
@@ -1567,19 +1566,19 @@ function redirectOnUninstalledExtension ($ext_name) {
 // Filter for initialization of all extensions by loading them in 'init' mode
 function FILTER_INIT_EXTENSIONS () {
        // Do we have some entries?
-       //* DEBUG */ print __FUNCTION__.': ENTRY!<br />';
+       //* DEBUG */ logDebugMessage(__FUNCTION__, __LINE__, 'ENTRY!');
        if (isset($GLOBALS['cache_array']['extension']['ext_name'])) {
                // Load all found extensions if found
-               //* DEBUG */ print __FUNCTION__.': CACHE - START!<br />';
+               //* DEBUG */ logDebugMessage(__FUNCTION__, __LINE__, 'CACHE - START!');
                foreach ($GLOBALS['cache_array']['extension']['ext_name'] as $key => $ext_name) {
                        // Load it
-                       //* DEBUG */ print __FUNCTION__.': '.$ext_name.' - START<br />';
+                       //* DEBUG */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name='.$ext_name.' - START');
                        loadExtension($ext_name, 'init', getExtensionVersion($ext_name));
-                       //* DEBUG */ print __FUNCTION__.': '.$ext_name.' - END<br />';
+                       //* DEBUG */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name='.$ext_name.' - END');
                } // END - foreach
-               //* DEBUG */ print __FUNCTION__.': CACHE - END!<br />';
+               //* DEBUG */ logDebugMessage(__FUNCTION__, __LINE__, 'CACHE - END!');
        } // END - if
-       //* DEBUG */ print __FUNCTION__.': EXIT!<br />';
+       //* DEBUG */ logDebugMessage(__FUNCTION__, __LINE__, 'EXIT!');
 }
 
 // Setter for extension mode
@@ -1594,7 +1593,7 @@ function getExtensionMode () {
 
 // Setter for dry-run
 function enableExtensionDryRun ($dry_run = true) {
-       //* DEBUG: */ debugOutput(__FUNCTION__.': '.getCurrentExtensionName().'='.intval($dry_run));
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'getCurrentExtensionName()='.getCurrentExtensionName().',dry='.intval($dry_run));
        $GLOBALS['ext_dry_run'] = (bool) $dry_run;
 }
 
@@ -1736,24 +1735,30 @@ function isExtensionIncludeReadable ($ext_name = '') {
 
 // Checks if an extension's function file is readable
 function isExtensionFunctionFileReadable ($ext_name) {
+       // Is cache there?
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name=' . $ext_name);
        if (isset($GLOBALS['cache_array']['extension']['ext_func'][$ext_name])) {
                // Just count cache hits
+               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name=' . $ext_name . ',ext_func=' . $GLOBALS['cache_array']['extension']['ext_func'][$ext_name] .' - CACHE!');
                incrementStatsEntry('cache_hits');
        } else {
-               // Construct FQFN for functions file
+               // Construct IFN for functions file
                $funcsInclude = sprintf("inc/libs/%s_functions.php", $ext_name);
 
                // Is this include there?
                if ((isFileReadable($funcsInclude)) && (!isset($GLOBALS['ext_loaded']['funcs'][$ext_name])) && (getExtensionMode() == 'test')) {
                        // Cache it!
+                       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name=' . $ext_name . ',ext_func=Y - FOUND!');
                        $GLOBALS['cache_array']['extension']['ext_func'][$ext_name] = 'Y';
                } else {
                        // Cache it!
+                       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name=' . $ext_name . ',ext_func=N - NOT FOUND!');
                        $GLOBALS['cache_array']['extension']['ext_func'][$ext_name] = 'N';
                }
        }
 
        // Return result
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name=' . $ext_name . ',ext_func=' . $GLOBALS['cache_array']['extension']['ext_func'][$ext_name]);
        return ($GLOBALS['cache_array']['extension']['ext_func'][$ext_name] == 'Y');
 }
 
index 96638bc102f3a7fdde14e0dc62a81370e0b9472c..e35212c606ffe1a143b26f8b7cdc06adedca1e99 100644 (file)
@@ -60,7 +60,7 @@ switch (getExtensionMode()) {
                addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='config_active'");
 
                // Unregister filter
-               unregisterFilter('online_extra_links', 'ADD_LINK_ACTIVE_LIST', true, isExtensionDryRun());
+               unregisterFilter(__FUNCTION__, __LINE__, 'online_extra_links', 'ADD_LINK_ACTIVE_LIST', true, isExtensionDryRun());
                break;
 
        case 'activate': // Do stuff when admin activates this extension
index fbf54e3c9d6958a26aba3f69c387332569d6fae1..93f877642b856dfe99d98abbee001b64739673b6 100644 (file)
@@ -67,10 +67,10 @@ switch (getExtensionMode()) {
                addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_admins` DROP `default_acl`");
 
                // Remove filters
-               unregisterFilter('sql_admin_extra_data', 'ADD_EXTRA_SQL_DATA', true, isExtensionDryRun());
-               unregisterFilter('do_admin_login_done', 'RESET_ADMINS_LOGIN_FAILURES', true, isExtensionDryRun());
-               unregisterFilter('do_admin_login_pass', 'COUNT_ADMINS_LOGIN_FAILURE', true, isExtensionDryRun());
-               unregisterFilter('do_admin_login_done', 'REHASH_ADMINS_PASSWORD', true, isExtensionDryRun());
+               unregisterFilter(__FUNCTION__, __LINE__, 'sql_admin_extra_data', 'ADD_EXTRA_SQL_DATA', true, isExtensionDryRun());
+               unregisterFilter(__FUNCTION__, __LINE__, 'do_admin_login_done', 'RESET_ADMINS_LOGIN_FAILURES', true, isExtensionDryRun());
+               unregisterFilter(__FUNCTION__, __LINE__, 'do_admin_login_pass', 'COUNT_ADMINS_LOGIN_FAILURE', true, isExtensionDryRun());
+               unregisterFilter(__FUNCTION__, __LINE__, 'do_admin_login_done', 'REHASH_ADMINS_PASSWORD', true, isExtensionDryRun());
                break;
 
        case 'activate': // Do stuff when admin activates this extension
index f9d1b1241d2e7916807296c8f44c5a4acf513d10..b7d4bda9d01169e88b16e455e1fe3cad0a70ca97 100644 (file)
@@ -90,7 +90,7 @@ PRIMARY KEY  (`id`)
                addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bonus_turbo`');
 
                // Unregister filter
-               unregisterFilter('member_login_check', 'ADD_LOGIN_BONUS', true, isExtensionDryRun());
+               unregisterFilter(__FUNCTION__, __LINE__, 'member_login_check', 'ADD_LOGIN_BONUS', true, isExtensionDryRun());
                break;
 
        case 'activate': // Do stuff when admin activates this extension
index 510a4160330848844feae054dc8c52ecb7349391..a6a8995fd9146d74b5f1d57edf548d6481ec507d 100644 (file)
@@ -87,8 +87,8 @@ PRIMARY KEY (`id`)
                addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what`='booking'");
 
                // Remove the filters
-               unregisterFilter('add_points', 'ADD_BOOKING_RECORD', true, isExtensionDryRun());
-               unregisterFilter('sub_points', 'ADD_BOOKING_RECORD', true, isExtensionDryRun());
+               unregisterFilter(__FUNCTION__, __LINE__, 'add_points', 'ADD_BOOKING_RECORD', true, isExtensionDryRun());
+               unregisterFilter(__FUNCTION__, __LINE__, 'sub_points', 'ADD_BOOKING_RECORD', true, isExtensionDryRun());
                break;
 
        case 'activate': // Do stuff when admin activates this extension
index 1028d3e617c94c033084a82d46ccb8771aaed55e..4d0497e82d1ddf61f6a5a360070963c627773f07 100644 (file)
@@ -62,15 +62,15 @@ switch (getExtensionMode()) {
                addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what` IN('cache_stats','config_config')");
 
                // Unregister all filters
-               unregisterFilter('extension_update', 'CACHE_DESTROY_ON_EXT_CHANGE', true, isExtensionDryRun());
-               unregisterFilter('post_extension_installed', 'CACHE_DESTROY_ON_EXT_CHANGE', true, isExtensionDryRun());
-               unregisterFilter('post_extension_run_sql', 'CACHE_DESTROY_ON_EXT_CHANGE', true, isExtensionDryRun());
-               unregisterFilter('post_admin_added', 'CACHE_DESTROY_ON_ADMIN_CHANGE', true, isExtensionDryRun());
-               unregisterFilter('post_admin_edited', 'CACHE_DESTROY_ON_ADMIN_CHANGE', true, isExtensionDryRun());
-               unregisterFilter('post_admin_deleted', 'CACHE_DESTROY_ON_ADMIN_CHANGE', true, isExtensionDryRun());
-               unregisterFilter('post_admin_reset_pass', 'CACHE_DESTROY_ON_ADMIN_CHANGE', true, isExtensionDryRun());
-               unregisterFilter('extension_remove', 'CACHE_DESTROY_ALL', true, isExtensionDryRun());
-               unregisterFilter('shutdown', 'CACHE_DESTROY_FILTER', true, isExtensionDryRun());
+               unregisterFilter(__FUNCTION__, __LINE__, 'extension_update', 'CACHE_DESTROY_ON_EXT_CHANGE', true, isExtensionDryRun());
+               unregisterFilter(__FUNCTION__, __LINE__, 'post_extension_installed', 'CACHE_DESTROY_ON_EXT_CHANGE', true, isExtensionDryRun());
+               unregisterFilter(__FUNCTION__, __LINE__, 'post_extension_run_sql', 'CACHE_DESTROY_ON_EXT_CHANGE', true, isExtensionDryRun());
+               unregisterFilter(__FUNCTION__, __LINE__, 'post_admin_added', 'CACHE_DESTROY_ON_ADMIN_CHANGE', true, isExtensionDryRun());
+               unregisterFilter(__FUNCTION__, __LINE__, 'post_admin_edited', 'CACHE_DESTROY_ON_ADMIN_CHANGE', true, isExtensionDryRun());
+               unregisterFilter(__FUNCTION__, __LINE__, 'post_admin_deleted', 'CACHE_DESTROY_ON_ADMIN_CHANGE', true, isExtensionDryRun());
+               unregisterFilter(__FUNCTION__, __LINE__, 'post_admin_reset_pass', 'CACHE_DESTROY_ON_ADMIN_CHANGE', true, isExtensionDryRun());
+               unregisterFilter(__FUNCTION__, __LINE__, 'extension_remove', 'CACHE_DESTROY_ALL', true, isExtensionDryRun());
+               unregisterFilter(__FUNCTION__, __LINE__, 'shutdown', 'CACHE_DESTROY_FILTER', true, isExtensionDryRun());
                break;
 
        case 'activate': // Do stuff when admin activates this extension
index ee56ea3e7b81393dc7707c26a9a0f969cf3ab2f0..176ca4a0fd49d377fbfa3f59925b1e0b01a0e290 100644 (file)
@@ -68,8 +68,8 @@ switch (getExtensionMode()) {
                addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE `what`='mediadata'");
 
                // Remove the filters
-               unregisterFilter('add_points', 'UPDATE_MEDIADATA_ENTRY', true, isExtensionDryRun());
-               unregisterFilter('sub_points', 'UPDATE_MEDIADATA_ENTRY', true, isExtensionDryRun());
+               unregisterFilter(__FUNCTION__, __LINE__, 'add_points', 'UPDATE_MEDIADATA_ENTRY', true, isExtensionDryRun());
+               unregisterFilter(__FUNCTION__, __LINE__, 'sub_points', 'UPDATE_MEDIADATA_ENTRY', true, isExtensionDryRun());
                break;
 
        case 'activate': // Do stuff when admin activates this extension
index 08e7edc0c1afc41e0f148ec7935aba63fb07d67e..3b91b79f3db3cb3cdb229c4dba9f754bd63aad4a 100644 (file)
@@ -79,7 +79,7 @@ INDEX `admin_member` (`is_admin`, `is_member`)
                addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE `action`='online'");
 
                // Unregister filter
-               unregisterFilter('init', 'UPDATE_ONLINE_LIST', true, isExtensionDryRun());
+               unregisterFilter(__FUNCTION__, __LINE__, 'init', 'UPDATE_ONLINE_LIST', true, isExtensionDryRun());
                break;
 
        case 'activate': // Do stuff when admin activates this extension
index ac398cfc00a4fae18f42c780846669e8620dfbb8..71541b5723d3ae48292c17d57d3fd3b136cf5035 100644 (file)
@@ -62,7 +62,7 @@ switch (getExtensionMode()) {
                addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='config_other'");
 
                // Unregister filter
-               unregisterFilter('page_footer', 'DISPLAY_DEBUG_SQL', true, isExtensionDryRun());
+               unregisterFilter(__FUNCTION__, __LINE__, 'page_footer', 'DISPLAY_DEBUG_SQL', true, isExtensionDryRun());
                break;
 
        case 'activate': // Do stuff when admin activates this extension
index 1cad577a2db6d541837c5e50544684ff25c8108c..303fda1764a8e4bdc816e00dd4b4877118b8a696 100644 (file)
@@ -60,7 +60,7 @@ switch (getExtensionMode()) {
 
        case 'remove': // Do stuff when removing extension
                // Unregister filter
-               unregisterFilter('page_footer', 'DISPLAY_POLITICIAN_STOP_SNIPPET', true, isExtensionDryRun());
+               unregisterFilter(__FUNCTION__, __LINE__, 'page_footer', 'DISPLAY_POLITICIAN_STOP_SNIPPET', true, isExtensionDryRun());
                break;
 
        case 'activate': // Do stuff when admin activates this extension
index 82c7fe91fb5a2f5ad3414a07fc9d17a4f2ad60ee..a4997d35b3e3199f17c82989711d7136a729f69d 100644 (file)
@@ -114,7 +114,7 @@ PRIMARY KEY (id)
                addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what`='rallyes'");
 
                // Unregister filter
-               unregisterFilter('extra_autopurge', 'RALLYE_EXTRA_AUTOPURGE', true, isExtensionDryRun());
+               unregisterFilter(__FUNCTION__, __LINE__, 'extra_autopurge', 'RALLYE_EXTRA_AUTOPURGE', true, isExtensionDryRun());
                break;
 
        case 'activate': // Do stuff when admin activates this extension
index 55c190134aca6a802048dc9dee48f21f197f248c..44f4f99a5e41bfbe03794164fbee79bccf85707b 100644 (file)
@@ -60,7 +60,7 @@ switch (getExtensionMode()) {
                addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_must_register`');
 
                // Unregister a filter
-               unregisterFilter('register_must_fillout', 'REGISTER_MUST_FILLOUT', true, isExtensionDryRun());
+               unregisterFilter(__FUNCTION__, __LINE__, 'register_must_fillout', 'REGISTER_MUST_FILLOUT', true, isExtensionDryRun());
                break;
 
        case 'activate': // Do stuff when admin activates this extension
index e25a464d94da816955779df15821a729044a44fa..1f656ce00cb552ade4bed00c4c3a2ecbe47cff7b 100644 (file)
@@ -69,7 +69,7 @@ switch (getExtensionMode())
                addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='config_removeip' LIMIT 1");
 
                // Remove filters
-               unregisterFilter('post_youhere_line', 'ADD_ANONYMITY_NOTICE', true, isExtensionDryRun());
+               unregisterFilter(__FUNCTION__, __LINE__, 'post_youhere_line', 'ADD_ANONYMITY_NOTICE', true, isExtensionDryRun());
                break;
 
        case 'activate': // Do stuff when admin activates this extension
index 872b85df59e1cc51227b0da18a4b5c3efa568208..7db75716c0421d3a5e7f49947fedb1206b02ef88 100644 (file)
@@ -93,7 +93,7 @@ switch (getExtensionMode()) {
 `action`='account'");
 
                // Unregister filter
-               unregisterFilter('member_login_check', 'RESET_USER_LOGIN_FAILURE', true, isExtensionDryRun());
+               unregisterFilter(__FUNCTION__, __LINE__, 'member_login_check', 'RESET_USER_LOGIN_FAILURE', true, isExtensionDryRun());
                break;
 
        case 'activate': // Do stuff when admin activates this extension
index 08c1ee0bbb3b3e979ca3de25e34d642a49789065..88f3a1ce5cafc0d521941f5520b7383e8c13d26b 100644 (file)
@@ -67,8 +67,8 @@ switch (getExtensionMode()) {
                addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `action`='themes' OR `what`='themes'");
 
                // Unregister filters
-               unregisterFilter('init', 'HANDLE_THEME_CHANGE', true, isExtensionDryRun());
-               unregisterFilter('member_login_check', 'SET_USERS_THEME', true, isExtensionDryRun());
+               unregisterFilter(__FUNCTION__, __LINE__, 'init', 'HANDLE_THEME_CHANGE', true, isExtensionDryRun());
+               unregisterFilter(__FUNCTION__, __LINE__, 'member_login_check', 'SET_USERS_THEME', true, isExtensionDryRun());
                break;
 
        case 'activate': // Do stuff when admin activates this extension
index 46ec4d9367d56d4e38ccb80df39285063f509f2f..c0a0de50d7fb820e9f250e3c769b149211759a09 100644 (file)
@@ -65,7 +65,7 @@ switch (getExtensionMode()) {
                addExtensionSQL("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='config_timezone' LIMIT 1");
 
                // Unregister filter
-               unregisterFilter('init', 'INIT_TIMEZONE', true, isExtensionDryRun());
+               unregisterFilter(__FUNCTION__, __LINE__, 'init', 'INIT_TIMEZONE', true, isExtensionDryRun());
                break;
 
        case 'activate': // Do stuff when admin activates this extension
index 28e00094f0648d58eaeeb5295e2a0567065ec5fd..ba30a6bc55c053022775adb68abb13091ac16414 100644 (file)
@@ -58,7 +58,7 @@ switch (getExtensionMode()) {
                addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='config_uberwach' LIMIT 1");
 
                // Unregister filter
-               unregisterFilter('page_footer', 'DISPLAY_UBERWACH_SNIPPET', true, isExtensionDryRun());
+               unregisterFilter(__FUNCTION__, __LINE__, 'page_footer', 'DISPLAY_UBERWACH_SNIPPET', true, isExtensionDryRun());
                break;
 
        case 'activate': // Do stuff when admin activates this extension
index 9030f97ad393615785f358ff92760d512e6fe773..316bc6c93aa1951efa883d5f26754c25c7e410d8 100644 (file)
@@ -221,8 +221,8 @@ function registerFilter ($filterName, $filterFunction, $silentAbort = true, $for
 }
 
 // "Unregisters" a filter from the given chain
-function unregisterFilter ($filterName, $filterFunction, $force = false, $dry_run = false) {
-       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ENTRY: filterName=' . $filterName . ',filterFunction=' . $filterFunction . ',force=' . intval($force) . ',dry=' . intval($dry_run) . ' - ENTERED!');
+function unregisterFilter ($F, $L, $filterName, $filterFunction, $force = false, $dry_run = false) {
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ENTRY: F=' . $F . ',L=' . $L . ',filterName=' . $filterName . ',filterFunction=' . $filterFunction . ',force=' . intval($force) . ',dry=' . intval($dry_run) . ' - ENTERED!');
 
        // Extend the filter function name only if not loaded from database
        if (!isset($GLOBALS['cache_array']['filter']['loaded'][$filterName][$filterFunction])) {
@@ -239,11 +239,11 @@ function unregisterFilter ($filterName, $filterFunction, $force = false, $dry_ru
        // Shall we remove? (default, not while just showing an extension removal)
        if ($dry_run === false) {
                // Mark for filter removal
-               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'REMOVE: filterName=' . $filterName . ',filterFunction=' . $filterFunction);
+               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'REMOVE: F=' . $F . ',L=' . $L . ',filterName=' . $filterName . ',filterFunction=' . $filterFunction);
                $GLOBALS['cache_array']['filter']['chains'][$filterName][$filterFunction] = 'R';
        } // END - if
 
-       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ENTRY: filterName=' . $filterName . ',filterFunction=' . $filterFunction . ',force=' . intval($force) . ',dry=' . intval($dry_run) . ' - EXIT!');
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ENTRY: F=' . $F . ',L=' . $L . ',filterName=' . $filterName . ',filterFunction=' . $filterFunction . ',force=' . intval($force) . ',dry=' . intval($dry_run) . ' - EXIT!');
 }
 
 // "Runs" the given filters, data is optional and can be any type of data
@@ -275,7 +275,7 @@ function runFilterChain ($filterName, $data = null) {
                        // Is this filter there?
                        if (!function_exists($filterFunction)) {
                                // Unregister it
-                               unregisterFilter($filterName, $filterFunction);
+                               unregisterFilter(__FUNCTION__, __LINE__, $filterName, $filterFunction);
 
                                // Skip this entry
                                continue;
index 2a099fe8026f25f775003715dfd625cc9c175825..4551d1d80c1e95b7c7c32e6178ead81e26f58785 100644 (file)
@@ -151,7 +151,7 @@ function FILTER_CALL_HANDLER_LOGIN_FAILTURES ($data) {
 // Filter for redirecting to logout if sql_patches has been installed
 function FILTER_REDIRECT_TO_LOGOUT_SQL_PATCHES () {
        // Remove this filter
-       unregisterFilter('shutdown', __FUNCTION__);
+       unregisterFilter(__FUNCTION__, __LINE__, 'shutdown', __FUNCTION__);
 
        // Is the element set?
        if (isset($GLOBALS['ext_load_mode'])) {
index 0412c5863a821ecc0a8c196c3fa2286c44facdc6..7f4246a5083b89c8d576e23d0e4007ad6cb218c3 100644 (file)
@@ -40,7 +40,7 @@
 // Some security stuff...
 if (!defined('__SECURITY')) {
        die();
-}
+} // END - if
 
 // Init variables
 $bsent = '0'; $bclicks = '0'; $bcount = '0';
index 51f01e2622ea480ace3559d799defb991bc10e1d..47d20055ba1a7e6f52bce4893b4a00e6a0686501 100644 (file)
@@ -40,7 +40,7 @@
 // Some security stuff...
 if (!defined('__SECURITY')) {
        die();
-}
+} // END - if
 
 // Make sure our functions are there
 loadIncludeOnce('inc/libs/refback_functions.php');
index 562ff0123e6bed23cd2689ad413e10cf05a9dd63..479976c181162b71e906188e3a4b749abd11c015 100644 (file)
@@ -40,7 +40,7 @@
 // Some security stuff...
 if (!defined('__SECURITY')) {
        die();
-}
+} // END - if
 
 // Filter for updates/extends on the online list
 function FILTER_UPDATE_ONLINE_LIST () {
@@ -55,24 +55,21 @@ function FILTER_UPDATE_ONLINE_LIST () {
 
        // Initialize variables
        $userid = '0';
-       $MEM = 'N';
-       $ADMIN = 'N';
+       $isMember = 'N';
+       $isAdmin = 'N';
 
        // Valid userid?
        if ((isMemberIdSet()) && (getMemberId() > 0) && (isMember())) {
                // Is valid user
                $userid = getMemberId();
-               $MEM = 'Y';
+               $isMember = 'Y';
        } // END - if
 
        if (isAdmin()) {
                // Is administrator
-               $ADMIN = 'Y';
+               $isAdmin = 'Y';
        } // END - if
 
-       // Get refid
-       $rid = determineReferalId();
-
        // Now search for the user
        $result = SQL_QUERY_ESC("SELECT `timestamp` FROM `{?_MYSQL_PREFIX?}_online` WHERE `sid`='%s' LIMIT 1",
                array(session_id()), __FUNCTION__, __LINE__);
@@ -100,9 +97,9 @@ LIMIT 1",
                        getAction(),
                        getWhat(),
                        $userid,
-                       $rid,
-                       $MEM,
-                       $ADMIN,
+                       determineReferalId(),
+                       $isMember,
+                       $isAdmin,
                        detectRemoteAddr(),
                        session_id()
                ), __FUNCTION__, __LINE__);
@@ -114,9 +111,9 @@ LIMIT 1",
                                getAction(),
                                getWhat(),
                                $userid,
-                               $rid,
-                               $MEM,
-                               $ADMIN,
+                               determineReferalId(),
+                               $isMember,
+                               $isAdmin,
                                session_id(),
                                detectRemoteAddr()
                        ), __FUNCTION__, __LINE__);
index c25ef8fe423ef792f06722c74ab76bddff663ed6..aad057e0f9e8776e69fa1f703092b0f14d9795e1 100644 (file)
@@ -50,24 +50,24 @@ $do = 'overview';
 
 if (isGetRequestParameterSet('reg_ext')) {
        // We are about to register a new extension
-       $do = 'register'; $ext_id = bigintval(getRequestParameter('reg_ext'));
+       $do = 'register'; $taskId = bigintval(getRequestParameter('reg_ext'));
        // The id comes from task management and it is - of course - *not* the extension's name!
 } elseif ((isFormSent('change')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
        // De-/activate extensions
-       foreach (postRequestParameter('sel') as $ext_id => $active) {
+       foreach (postRequestParameter('sel') as $taskId => $active) {
                // Shall we keep the extension always active?
-               if ((isset($GLOBALS['cache_array']['always_active'][getExtensionName($ext_id)])) && ($GLOBALS['cache_array']['always_active'][getExtensionName($ext_id)] == 'Y') && ($active == 'Y')) {
+               if ((isset($GLOBALS['cache_array']['always_active'][getExtensionName($taskId)])) && ($GLOBALS['cache_array']['always_active'][getExtensionName($taskId)] == 'Y') && ($active == 'Y')) {
                        // Keep this extension active!
-                       loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_EXTENSION_ALWAYS_ACTIVE', getExtensionName($ext_id)));
+                       loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_EXTENSION_ALWAYS_ACTIVE', getExtensionName($taskId)));
                } else {
                        // De/activate extension
                        $ACT = 'N'; setExtensionMode('deactivate');
                        if ($active != 'Y') { $ACT = 'Y'; setExtensionMode('activate'); }
                        SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_extensions` SET `ext_active`='%s' WHERE `id`=%s AND `ext_active`='%s' LIMIT 1",
-                               array($ACT, bigintval($ext_id), $active), __FILE__, __LINE__);
+                               array($ACT, bigintval($taskId), $active), __FILE__, __LINE__);
 
                        // Run embeded SQL commands
-                       doExtensionSqls($ext_id, getExtensionMode());
+                       doExtensionSqls($taskId, getExtensionMode());
                }
        } // END - foreach
 
@@ -78,9 +78,9 @@ if (isGetRequestParameterSet('reg_ext')) {
        if (isPostRequestParameterSet('modify')) {
                // Change entries
                $cache_update = '0';
-               foreach (postRequestParameter('sel') as $ext_id => $sel) {
+               foreach (postRequestParameter('sel') as $taskId => $sel) {
                        // Secure id
-                       $ext_id = bigintval($ext_id);
+                       $taskId = bigintval($taskId);
 
                        // Change this extension?
                        if ($sel == 1) {
@@ -88,17 +88,17 @@ if (isGetRequestParameterSet('reg_ext')) {
                                setExtensionMode('modify');
 
                                // Get entry for 'active'
-                               $active = postRequestParameter('active', $ext_id);
+                               $active = postRequestParameter('active', $taskId);
 
                                // Update extension's record
                                if (isExtensionInstalledAndNewer('sql_patches', '0.0.6')) {
                                        // Update also CSS column when extensions sql_patches is newer or exact v0.0.6
                                        SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_extensions` SET `ext_has_css`='%s', `ext_active`='%s' WHERE `id`=%s LIMIT 1",
-                                               array(postRequestParameter('css', $ext_id), $active, $ext_id), __FILE__, __LINE__);
+                                               array(postRequestParameter('css', $taskId), $active, $taskId), __FILE__, __LINE__);
                                } else {
                                        // When extension is older than v0.0.6 there is no column for the CSS information
                                        SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_extensions` SET `ext_active`='%s' WHERE `id`=%s LIMIT 1",
-                                               array($active, $ext_id), __FILE__, __LINE__);
+                                               array($active, $taskId), __FILE__, __LINE__);
                                }
 
                                // Run SQLs on activation / deactivation
@@ -108,7 +108,7 @@ if (isGetRequestParameterSet('reg_ext')) {
                                } // END - if
 
                                // Run embeded SQL commands
-                               doExtensionSqls($ext_id, getExtensionMode());
+                               doExtensionSqls($taskId, getExtensionMode());
                        }
                }
 
@@ -117,7 +117,7 @@ if (isGetRequestParameterSet('reg_ext')) {
        } else {
                // Edit selected entries
                $OUT = '';
-               foreach (postRequestParameter('sel') as $ext_id => $sel) {
+               foreach (postRequestParameter('sel') as $taskId => $sel) {
                        // Edit this extension?
                        if (($sel == 'Y') || ($sel != 'Y')) {
                                // Default is no CSS for non-updated mailers
@@ -126,12 +126,12 @@ if (isGetRequestParameterSet('reg_ext')) {
                                // Load required data
                                if (isExtensionInstalledAndNewer('sql_patches', '0.0.6')) {
                                        $result = SQL_QUERY_ESC("SELECT ext_has_css, ext_active FROM `{?_MYSQL_PREFIX?}_extensions` WHERE `id`=%s LIMIT 1",
-                                               array(bigintval($ext_id)), __FILE__, __LINE__);
+                                               array(bigintval($taskId)), __FILE__, __LINE__);
                                        list($css, $active) = SQL_FETCHROW($result);
                                        SQL_FREERESULT($result);
                                } else {
                                        $result = SQL_QUERY_ESC("SELECT ext_active FROM `{?_MYSQL_PREFIX?}_extensions` WHERE `id`=%s LIMIT 1",
-                                               array(bigintval($ext_id)), __FILE__, __LINE__);
+                                               array(bigintval($taskId)), __FILE__, __LINE__);
                                        list($active) = SQL_FETCHROW($result);
                                        SQL_FREERESULT($result);
                                        $css = 'X';
@@ -140,14 +140,14 @@ if (isGetRequestParameterSet('reg_ext')) {
                                // Prepare CSS column
                                $cssSelection = '---';
                                if (isExtensionInstalledAndNewer('sql_patches', '0.0.6')) {
-                                       $cssSelection = addSelectionBox('yn', $css, 'css', $ext_id);
+                                       $cssSelection = addSelectionBox('yn', $css, 'css', $taskId);
                                } // END - if
 
                                // Prepare data for the row template
                                $content = array(
-                                       'id'     => $ext_id,
-                                       'name'   => getExtensionName($ext_id),
-                                       'active' => addSelectionBox('yn', $active, 'active', $ext_id),
+                                       'id'     => $taskId,
+                                       'name'   => getExtensionName($taskId),
+                                       'active' => addSelectionBox('yn', $active, 'active', $taskId),
                                        'css'    => $cssSelection,
                                );
 
@@ -163,18 +163,18 @@ if (isGetRequestParameterSet('reg_ext')) {
 } elseif ((isPostRequestParameterSet('delete')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
        // List extensions and when verbose is enabled SQL statements which will be executed
        $OUT = '';
-       foreach (postRequestParameter('sel') as $ext_id => $sel) {
+       foreach (postRequestParameter('sel') as $taskId => $sel) {
                // Init variables
                $VERBOSE_OUT = '';
                initSqls();
 
                // Secure id number
-               $ext_id = bigintval($ext_id);
+               $taskId = bigintval($taskId);
 
                // Is the id valid?
-               if (isExtensionIdValid($ext_id)) {
+               if (isExtensionIdValid($taskId)) {
                        // Get extension name
-                       $ext_name = getExtensionName($ext_id);
+                       $ext_name = getExtensionName($taskId);
 
                        if (getConfig('verbose_sql') == 'Y') {
                                // Load SQL commands in remove mode
@@ -186,7 +186,7 @@ if (isGetRequestParameterSet('reg_ext')) {
 
                        // Prepare data for the row template
                        $content = array(
-                               'id'       => $ext_id,
+                               'id'       => $taskId,
                                'ext_name' => $ext_name,
                                'ext_ver'  => getExtensionVersion($ext_name),
                                'verbose'  => $VERBOSE_OUT
@@ -197,7 +197,7 @@ if (isGetRequestParameterSet('reg_ext')) {
                } else {
                        // Prepare data for the row template
                        $content = array(
-                               'id'       => $ext_id
+                               'id'       => $taskId
                        );
 
                        // Not valid!
@@ -211,14 +211,14 @@ if (isGetRequestParameterSet('reg_ext')) {
 } elseif ((isFormSent('remove')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
        // Remove extensions from DB (you have to delete all files manually!)
        $cache_update = '0';
-       foreach (postRequestParameter('sel') as $ext_id => $active) {
+       foreach (postRequestParameter('sel') as $taskId => $active) {
                // Secure id number
-               $ext_id = bigintval($ext_id);
+               $taskId = bigintval($taskId);
 
                // Is this extension selected and id valid?
-               if (($active == 1) && (isExtensionIdValid($ext_id))) {
+               if (($active == 1) && (isExtensionIdValid($taskId))) {
                        // Run embeded SQL commands
-                       doExtensionSqls($ext_id, 'remove');
+                       doExtensionSqls($taskId, 'remove');
                } // END - if
        } // END - foreach
 
@@ -230,6 +230,22 @@ if (isGetRequestParameterSet('reg_ext')) {
 } elseif (isGetRequestParameterSet('do')) {
        // Demo mode active!
        $do = 'demo';
+} elseif (isGetRequestParameterSet('registered')) {
+       // Extensions changed
+       loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_EXTENSION_REGISTERED', getExtensionName(getRequestParameter('registered'))));
+
+       // Show next link
+       if (isExtensionActive('task')) {
+               loadTemplate('admin_next_link', false, array(
+                       'url'   => 'modules.php?module=admin&amp;what=list_task',
+                       'title' => '{--ADMIN_EXTENSION_REGISTER_NEXT_LINK--}'
+               ));
+       } else {
+               loadTemplate('admin_next_link', false, array(
+                       'url'   => 'modules.php?module=admin',
+                       'title' => '{--ADMIN_EXTENSION_REGISTER_NEXT_LINK--}'
+               ));
+       }
 } elseif (isGetRequestParameterSet('changed')) {
        // Extensions changed
        loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_EXTENSION_CHANGED', bigintval(getRequestParameter('changed'))));
@@ -306,10 +322,10 @@ ORDER BY
                SQL_FREERESULT($result);
 
                // Is the id number valid and the task was found?
-               if (($ext_id > 0) && ($task_found == 1)) {
+               if (($taskId > 0) && ($task_found == 1)) {
                        // id is valid so begin with registration, we first want to it's real name from task management (subject column)
                        $result = SQL_QUERY_ESC("SELECT `subject` FROM `{?_MYSQL_PREFIX?}_task_system` WHERE `id`=%s LIMIT 1",
-                               array(bigintval($ext_id)), __FILE__, __LINE__);
+                               array(bigintval($taskId)), __FILE__, __LINE__);
                        list($subject) = SQL_FETCHROW($result);
 
                        // Free result
@@ -327,24 +343,11 @@ ORDER BY
                                // Is the extension deprecated?
                                if (!isExtensionDeprecated()) {
                                        // ... so we can finally register and load it in registration mode
-                                       if (registerExtension($ext_name, $ext_id)) {
+                                       if (registerExtension($ext_name, $taskId)) {
                                                // Errors?
                                                if (!ifFatalErrorsDetected()) {
                                                        // Extension was found and successfully registered
-                                                       loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_EXTENSION_REGISTERED', $ext_name));
-
-                                                       // Show next link
-                                                       if (isExtensionActive('task')) {
-                                                               loadTemplate('admin_next_link', false, array(
-                                                                       'url'   => 'modules.php?module=admin&amp;what=list_task',
-                                                                       'title' => '{--ADMIN_EXTENSION_REGISTER_NEXT_LINK--}'
-                                                               ));
-                                                       } else {
-                                                               loadTemplate('admin_next_link', false, array(
-                                                                       'url'   => 'modules.php?module=admin',
-                                                                       'title' => '{--ADMIN_EXTENSION_REGISTER_NEXT_LINK--}'
-                                                               ));
-                                                       }
+                                                       redirectToUrl('modules.php?module=admin&amp;what=extensions&amp;registered=' . getExtensionId($ext_name));
                                                } else {
                                                        // Errors detected!
                                                        loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_EXTENSION_NOT_REGISTERED', $ext_name));
index e29ca2856e1dabe47ab7ecead182b85a0d73ada8..fad3dc2df35d68961d078876cebc6f263f70b6f9 100644 (file)
@@ -234,7 +234,7 @@ function doFinalCompilation ($code, $insertComments = true) {
        $cnt = 0;
 
        // Compile all out
-       while (((strpos($code, '{--') !== false) || (strpos($code, '{DQUOTE}') !== false) || (strpos($code, '{?') !== false) || (strpos($code, '{%') !== false)) && ($cnt < 4)) {
+       while (((strpos($code, '{--') !== false) || (strpos($code, '{DQUOTE}') !== false) || (strpos($code, '{?') !== false) || (strpos($code, '{%') !== false)) && ($cnt < 5)) {
                // Init common variables
                $content = array();
                $newContent = '';
index c0a2a676098554d1253c750456e7b01f4ffe9a6e..58521af6c7c745fa7a0b17cfc5b22787c87f61b4 100644 (file)
@@ -1,4 +1,3 @@
-<br />
 <div align="center">
        <div class="admin_table dashed" style="width:400px;margin-bottom:5px">
        <ul style="padding:0px;margin:0px">