From 2a7c266e9b6f72122f569613791af7706b314ab5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sat, 20 Sep 2008 20:07:24 +0000 Subject: [PATCH] Queries for de-/activation and removal of extensions fixed --- inc/databases.php | 2 +- inc/db/lib-mysql3.php | 1 + inc/extensions/ext-autopurge.php | 3 +-- inc/extensions/ext-bonus.php | 6 +++--- inc/extensions/ext-holiday.php | 4 ++-- inc/extensions/ext-html_mail.php | 6 +++--- inc/extensions/ext-nickname.php | 4 ++-- inc/extensions/ext-online.php | 2 +- inc/extensions/ext-order.php | 2 +- inc/extensions/ext-payout.php | 6 +++--- inc/extensions/ext-primera.php | 6 +++--- inc/extensions/ext-register.php | 2 +- inc/extensions/ext-surfbar.php | 2 +- inc/extensions/ext-wernis.php | 4 ++-- inc/functions.php | 16 +++++++++------- inc/modules/guest/what-register.php | 6 +++--- 16 files changed, 37 insertions(+), 35 deletions(-) diff --git a/inc/databases.php b/inc/databases.php index cd89754c17..c8d260cb4a 100644 --- a/inc/databases.php +++ b/inc/databases.php @@ -113,7 +113,7 @@ define('USAGE_BASE', "usage"); define('SERVER_URL', "http://www.mxchange.org"); // This current patch level -define('CURR_SVN_REVISION', "369"); +define('CURR_SVN_REVISION', "370"); // Take a prime number which is long (if you know a longer one please try it out!) define('_PRIME', 591623); diff --git a/inc/db/lib-mysql3.php b/inc/db/lib-mysql3.php index 9b42362a0f..c9b5b320c1 100644 --- a/inc/db/lib-mysql3.php +++ b/inc/db/lib-mysql3.php @@ -274,6 +274,7 @@ function SQL_ESCAPE($str, $secureString = true) { if (function_exists('mysql_real_escape_string')) { // The new and improved version + //* DEBUG: */ echo __FUNCTION__.":str={$str}
\n"; return mysql_real_escape_string($str, $link); } elseif (function_exists('mysql_escape_string')) { // The obsulete function diff --git a/inc/extensions/ext-autopurge.php b/inc/extensions/ext-autopurge.php index 8acd0f78c5..1d9c2b1783 100644 --- a/inc/extensions/ext-autopurge.php +++ b/inc/extensions/ext-autopurge.php @@ -64,8 +64,7 @@ case "remove": // Do stuff when removing extension { $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_bonus MODIFY data_type ENUM('NEW','QUEUE','SEND') NOT NULL DEFAULT 'NEW'"; } - $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE action='setup' AND what='config_autopurge' LIMIT 1"; - $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE action='user' AND what='list_autopurge' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE what IN('config_autopurge','list_autopurge') LIMIT 2"; $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data DROP ap_notified"; break; diff --git a/inc/extensions/ext-bonus.php b/inc/extensions/ext-bonus.php index d93b02a857..33704b4101 100644 --- a/inc/extensions/ext-bonus.php +++ b/inc/extensions/ext-bonus.php @@ -93,14 +93,14 @@ case "remove": // Do stuff when removing extension case "activate": // Do stuff when admin activates this extension // SQL commands to run - $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='Y', locked='N' WHERE action='main' AND what='bonus' LIMIT 1"; + $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='Y', locked='N' WHERE what='bonus' LIMIT 1"; $SQLs[] = "UPDATE "._MYSQL_PREFIX."_guest_menu SET visible='Y', locked='N' WHERE action='bonus' LIMIT 1"; $SQLs[] = "UPDATE "._MYSQL_PREFIX."_mod_reg SET locked='N', hidden='N', admin_only='N', mem_only='N' WHERE module='show_bonus' LIMIT 1"; break; case "deactivate": // Do stuff when admin deactivates this extension // SQL commands to run - $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='Y', locked='Y' WHERE action='main' AND what='bonus' LIMIT 1"; + $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='Y', locked='Y' WHERE what='bonus' LIMIT 1"; $SQLs[] = "UPDATE "._MYSQL_PREFIX."_guest_menu SET visible='Y', locked='Y' WHERE action='bonus' LIMIT 1"; $SQLs[] = "UPDATE "._MYSQL_PREFIX."_mod_reg SET locked='Y' WHERE module='show_bonus' LIMIT 1"; break; @@ -159,7 +159,7 @@ KEY userid (userid) break; case "0.2.3": // SQL queries for v0.2.3 - $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_member_menu WHERE action='main' AND what='bonus' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_member_menu WHERE what='bonus' LIMIT 1"; $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu VALUES (NULL,'main','bonus','Aktiv-Rallye',7,'Y','Y','', 0)"; // Update notes (these will be set as task text!) diff --git a/inc/extensions/ext-holiday.php b/inc/extensions/ext-holiday.php index 645aa6f295..43c5459af3 100644 --- a/inc/extensions/ext-holiday.php +++ b/inc/extensions/ext-holiday.php @@ -88,12 +88,12 @@ case "remove": // Do stuff when removing extension case "activate": // Do stuff when admin activates this extension // SQL commands to run - $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='Y', locked='N' WHERE action='main' AND what='holiday' LIMIT 1"; + $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='Y', locked='N' WHERE what='holiday' LIMIT 1"; break; case "deactivate": // Do stuff when admin deactivates this extension // SQL commands to run - $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='Y', locked='Y' WHERE action='main' AND what='holiday' LIMIT 1"; + $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='Y', locked='Y' WHERE what='holiday' LIMIT 1"; break; case "update": // Update an extension diff --git a/inc/extensions/ext-html_mail.php b/inc/extensions/ext-html_mail.php index 346f7429d0..01a98f8bc2 100644 --- a/inc/extensions/ext-html_mail.php +++ b/inc/extensions/ext-html_mail.php @@ -61,17 +61,17 @@ case "remove": // Do stuff when removing extension $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data DROP html"; $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_bonus DROP html_msg"; $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_pool DROP html_msg"; - $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_member_menu WHERE action='main' AND what='html_mail' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_member_menu WHERE what='html_mail' LIMIT 1"; break; case "activate": // Do stuff when admin activates this extension // SQL commands to run - $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='Y', locked='N' WHERE action='main' AND what='html_mail' LIMIT 1"; + $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='Y', locked='N' WHERE what='html_mail' LIMIT 1"; break; case "deactivate": // Do stuff when admin deactivates this extension // SQL commands to run - $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='Y', locked='Y' WHERE action='main' AND what='html_mail' LIMIT 1"; + $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='Y', locked='Y' WHERE what='html_mail' LIMIT 1"; break; case "update": // Update an extension diff --git a/inc/extensions/ext-nickname.php b/inc/extensions/ext-nickname.php index de36467c6d..76a5f625a4 100644 --- a/inc/extensions/ext-nickname.php +++ b/inc/extensions/ext-nickname.php @@ -67,12 +67,12 @@ case "remove": // Do stuff when removing extension case "activate": // Do stuff when admin activates this extension // SQL commands to run - $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='Y', locked='N' WHERE action='main' AND what='nickname' LIMIT 1"; + $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='Y', locked='N' WHERE what='nickname' LIMIT 1"; break; case "deactivate": // Do stuff when admin deactivates this extension // SQL commands to run - $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='Y', locked='Y' WHERE action='main' AND what='nickname' LIMIT 1"; + $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='Y', locked='Y' WHERE what='nickname' LIMIT 1"; break; case "update": // Update an extension diff --git a/inc/extensions/ext-online.php b/inc/extensions/ext-online.php index 92e91571e6..eea20c913c 100644 --- a/inc/extensions/ext-online.php +++ b/inc/extensions/ext-online.php @@ -73,7 +73,7 @@ KEY(refid) case "remove": // Do stuff when removing extension // SQL commands to run $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_online"; - $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE action='misc', what='usr_online' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE what='usr_online' LIMIT 1"; break; case "activate": // Do stuff when admin activates this extension diff --git a/inc/extensions/ext-order.php b/inc/extensions/ext-order.php index e23f1402a1..a7d0b9c260 100644 --- a/inc/extensions/ext-order.php +++ b/inc/extensions/ext-order.php @@ -285,7 +285,7 @@ nicht die vom Mitglied eingegebene. Resultat: Das Script beschwerte sich, der Us break; case "0.4.8": // SQL queries for v0.4.8 - $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET title='Mailbuchung' WHERE action='setup' AND what='config_order' LIMIT 1"; + $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET title='Mailbuchung' WHERE what='config_order' LIMIT 1"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Menüpunkt "Mailbuchungsseite" nach "Mailbuchung" umbenannt und weitere Einstellungen aus Sonstige Einstellungen verschoben."; diff --git a/inc/extensions/ext-payout.php b/inc/extensions/ext-payout.php index 2951770584..029dcd9135 100644 --- a/inc/extensions/ext-payout.php +++ b/inc/extensions/ext-payout.php @@ -82,17 +82,17 @@ case "remove": // Do stuff when removing extension $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_user_payouts"; $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_payout_types"; $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE action='payouts'"; - $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_member_menu WHERE action='main' AND what='payout' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_member_menu WHERE what='payout' LIMIT 1"; break; case "activate": // Do stuff when admin activates this extension // SQL commands to run - $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='Y', locked='N' WHERE action='main' AND what='payout' LIMIT 1"; + $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='Y', locked='N' WHERE what='payout' LIMIT 1"; break; case "deactivate": // Do stuff when admin deactivates this extension // SQL commands to run - $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='Y', locked='Y' WHERE action='main' AND what='payout' LIMIT 1"; + $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='Y', locked='Y' WHERE what='payout' LIMIT 1"; break; case "update": // Update an extension diff --git a/inc/extensions/ext-primera.php b/inc/extensions/ext-primera.php index 77638b908e..4ea33b11c2 100644 --- a/inc/extensions/ext-primera.php +++ b/inc/extensions/ext-primera.php @@ -86,17 +86,17 @@ case "remove": // Do stuff when removing extension // SQL commands to run $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_user_primera"; $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE action='primera'"; - $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_member_menu WHERE action='main' AND what='primera' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_member_menu WHERE what='primera' LIMIT 1"; break; case "activate": // Do stuff when admin activates this extension // SQL commands to run - $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='Y', locked='N' WHERE action='main' AND what='primera' LIMIT 1"; + $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='Y', locked='N' WHERE what='primera' LIMIT 1"; break; case "deactivate": // Do stuff when admin deactivates this extension // SQL commands to run - $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='Y', locked='Y' WHERE action='main' AND what='primera' LIMIT 1"; + $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='Y', locked='Y' WHERE what='primera' LIMIT 1"; break; case "update": // Update an extension diff --git a/inc/extensions/ext-register.php b/inc/extensions/ext-register.php index f1c7adc7a0..68a632d88b 100644 --- a/inc/extensions/ext-register.php +++ b/inc/extensions/ext-register.php @@ -58,7 +58,7 @@ case "register": // Do stuff when installtion is running (modules.php?module=adm case "remove": // Do stuff when removing extension // SQL commands to run - $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE action='setup' AND what='config_register' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE what='config_register' LIMIT 1"; break; case "activate": // Do stuff when admin activates this extension diff --git a/inc/extensions/ext-surfbar.php b/inc/extensions/ext-surfbar.php index 95ab6a8f3c..d759cf7ff6 100644 --- a/inc/extensions/ext-surfbar.php +++ b/inc/extensions/ext-surfbar.php @@ -146,7 +146,7 @@ case "remove": // Do stuff when removing extension $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_surfbar_salts`"; $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_surfbar_stats`"; $SQLs[] = "DELETE LOW_PRIORITY FROM `"._MYSQL_PREFIX."_member_menu` WHERE `action`='surfbar' LIMIT 5"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `"._MYSQL_PREFIX."_admin_menu` WHERE action='surfbar' LIMIT 6"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `"._MYSQL_PREFIX."_admin_menu` WHERE `action`='surfbar' LIMIT 6"; break; case "activate": // Do stuff when admin activates this extension diff --git a/inc/extensions/ext-wernis.php b/inc/extensions/ext-wernis.php index 1e774e0287..c88c31d6c8 100644 --- a/inc/extensions/ext-wernis.php +++ b/inc/extensions/ext-wernis.php @@ -97,12 +97,12 @@ case "remove": // Do stuff when removing extension case "activate": // Do stuff when admin activates this extension // SQL commands to run - $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='Y', locked='N' WHERE action='main' AND what='wernis' LIMIT 1"; + $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='Y', locked='N' WHERE what='wernis' LIMIT 1"; break; case "deactivate": // Do stuff when admin deactivates this extension // SQL commands to run - $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='Y', locked='Y' WHERE action='main' AND what='wernis' LIMIT 1"; + $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='Y', locked='Y' WHERE what='wernis' LIMIT 1"; break; case "update": // Update an extension diff --git a/inc/functions.php b/inc/functions.php index 0e6812343d..61d6763fdb 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -133,9 +133,10 @@ function OUTPUT_HTML($HTML, $NEW_LINE = true) { // Clear output buffer for later output ob_end_clean(); + // Extension "rewrite" installed? if ((EXT_IS_ACTIVE("rewrite", true)) && (function_exists('REWRITE_LINKS')) && ($CSS != "1") && ($CSS != "-1")) { $OUTPUT = REWRITE_LINKS($OUTPUT); - } + } // END - if // Compile and run finished rendered HTML code while (strpos($OUTPUT, '{!') > 0) { @@ -144,12 +145,13 @@ function OUTPUT_HTML($HTML, $NEW_LINE = true) { $eval = "\$newContent = \"".COMPILE_CODE(addslashes($OUTPUT))."\";"; @eval($eval); + // Was that eval okay? if (empty($newContent)) { // Something went wrong! die("Evaluation error:
".htmlentities($eval)."
"); - } + } // END - if $OUTPUT = $newContent; - } + } // END - while // Output code here, DO NOT REMOVE! ;-) OUTPUT_RAW($OUTPUT); @@ -157,13 +159,13 @@ function OUTPUT_HTML($HTML, $NEW_LINE = true) { // Rewrite links when rewrite extension is active if ((EXT_IS_ACTIVE("rewrite", true)) && (function_exists('REWRITE_LINKS')) && ($CSS != "1") && ($CSS != "-1")) { $OUTPUT = REWRITE_LINKS($OUTPUT); - } + } // END - if // Compile and run finished rendered HTML code while (strpos($OUTPUT, '{!') > 0) { $eval = "\$OUTPUT = \"".COMPILE_CODE(addslashes($OUTPUT))."\";"; eval($eval); - } + } // END - while // Output code here, DO NOT REMOVE! ;-) OUTPUT_RAW($OUTPUT); @@ -173,13 +175,13 @@ function OUTPUT_HTML($HTML, $NEW_LINE = true) { // Output the raw HTML code function OUTPUT_RAW ($HTML) { // Output stripped HTML code to avoid broken JavaScript code, etc. - echo stripslashes($HTML); + echo stripslashes(stripslashes($HTML)); // Flush the output if only _OB_CACHING is not "on" if (_OB_CACHING != "on") { // Flush it flush(); - } + } // END - if } // Add a fatal error message to the queue array diff --git a/inc/modules/guest/what-register.php b/inc/modules/guest/what-register.php index ac63b929b2..3e7b2b8ec0 100644 --- a/inc/modules/guest/what-register.php +++ b/inc/modules/guest/what-register.php @@ -299,7 +299,7 @@ array( $DATA = array( 'hash' => $hash, 'uid' => $userid, - 'gender' => $gender, + 'gender' => $gender, 'surname' => SQL_ESCAPE($_POST['surname']), 'family' => SQL_ESCAPE($_POST['family_name']), 'email' => SQL_ESCAPE($_POST['addy']), @@ -424,10 +424,10 @@ array( // Shall I display the refid or shall I make it editable? if ($_CONFIG['display_refid'] == "Y") { // Load template to enter it - define('REFID_CONTENT', LOAD_TEMPLATE("guest_register_refid", true, $GLOBALS['refid'])); + define('REFID_CONTENT', LOAD_TEMPLATE("guest_register_refid_hide", true, $GLOBALS['refid'])); } else { // Load "hide" form template - define('REFID_CONTENT', LOAD_TEMPLATE("guest_register_refid_hide", true, $GLOBALS['refid'])); + define('REFID_CONTENT', LOAD_TEMPLATE("guest_register_refid", true, $GLOBALS['refid'])); } // You may want to modify the register_header.tpl.xx file and not this script when you add your scripts etc. :-) -- 2.39.5