Fix for ext-wernis, some rewrites, fixes for array-to-string convertion
authorRoland Häder <roland@mxchange.org>
Sun, 26 Jul 2009 19:31:02 +0000 (19:31 +0000)
committerRoland Häder <roland@mxchange.org>
Sun, 26 Jul 2009 19:31:02 +0000 (19:31 +0000)
inc/extensions/ext-wernis.php
inc/modules/admin/what-extensions.php
inc/request-functions.php

index 9d03db33ff890eaf0eda4e85aba4e444def4eb51..23d8cb6e87b68a9253e88acec9932dfadff5f03c 100644 (file)
 if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
        require($INC);
-}
+} // END - if
 
 // Version of this extension
-EXT_SET_VERSION('0.0.4');
+EXT_SET_VERSION('0.0.3');
 
 // Version history array (add more with , '0.1.0' and so on)
-EXT_SET_VER_HISTORY(array('0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4'));
+EXT_SET_VER_HISTORY(array('0.0', '0.0.1', '0.0.2', '0.0.3'));
 
-switch ($EXT_LOAD_MODE)
-{
+switch ($EXT_LOAD_MODE) {
        case 'register': // Do stuff when installation is running (modules.php?module=admin&action=login is called)
                // SQL commands to run
                ADD_EXT_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_wernis`");
@@ -104,8 +103,7 @@ PRIMARY KEY(id)
                break;
 
        case 'update': // Update an extension
-               switch ($EXT_VER)
-               {
+               switch ($EXT_VER) {
                        case '0.0.1': // SQL queries for v0.0.1
                                ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD wernis_payout_active ENUM ('Y','N') NOT NULL DEFAULT 'Y'");
                                ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD wernis_withdraw_active ENUM ('Y','N') NOT NULL DEFAULT 'Y'");
@@ -128,17 +126,10 @@ PRIMARY KEY(id)
                                break;
 
                        case '0.0.3': // SQL queries for v0.0.3
-                               ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` CHANGE `wernis_refid` `wernis_refid` INT(5) UNSIGNED ZEROFILL NOT NULL DEFAULT '00000'");
-
-                               // Update notes (these will be set as task text!)
-                               EXT_SET_UPDATE_NOTES("Spaltentyp von VARCHAR(6) auf BIGINT(5) ge&auml;ndert.");
-                               break;
-
-                       case '0.0.4': // SQL queries for v0.0.4
                                ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `wernis_refid` INT(5) UNSIGNED ZEROFILL NOT NULL DEFAULT '00000'");
 
                                // Update notes (these will be set as task text!)
-                               EXT_SET_UPDATE_NOTES("Fehlende Ref-Id hinzugetan.");
+                               EXT_SET_UPDATE_NOTES("Spaltentyp von VARCHAR(6) auf INT(5) ge&auml;ndert.");
                                break;
                }
                break;
index cd21e9208ed5d91222f58002163b5ec3660829d4..be7cc1d23b573616d76408fa95239a6f9674e89a 100644 (file)
@@ -46,11 +46,16 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
 ADD_DESCR('admin', __FILE__);
 
 // Normally we want the overview of all registered extensions
-$do = "overview";
+$do = 'overview';
 $SEL = 0;
-if (REQUEST_ISSET_POST('sel')) $SEL = countPostSelection();
 
-if (REQUEST_ISSET_GET(('reg_ext'))) {
+// Are some extensions submitted?
+if (REQUEST_ISSET_POST('sel')) {
+       // Then count all
+       $SEL = countPostSelection();
+} // END - if
+
+if (REQUEST_ISSET_GET('reg_ext')) {
        // We are about to register a new extension
        $do = 'register'; $ext_id = bigintval(REQUEST_GET('reg_ext'));
        // The ID comes from task management and it is - of course - *not* the extension's name!
index 5f9f1e263bb2b36378af1ddf877dc7d161a2c130..0ae3de0a6a52c4d17edc49eb04507f38ddf6a8b6 100644 (file)
@@ -129,13 +129,13 @@ function REQUEST_POST ($element, $subElement=-1) {
                if (($subElement != -1) && (REQUEST_ISSET_POST($element, $subElement))) {
                        // Then use this
                        $value = SQL_ESCAPE($value[$subElement]);
-               } else {
+               } elseif (!is_array($value)) {
                        // Escape it here
                        $value = SQL_ESCAPE($value);
                }
 
                // Set it in cache
-               $GLOBALS['cache_request']['request_post'][$element][$subElement] = SQL_ESCAPE($value);
+               $GLOBALS['cache_request']['request_post'][$element][$subElement] = $value;
        } // END - if
 
        // Return value