Security line in all includes changed
[mailer.git] / inc / extensions / ext-order.php
index 9c0b64948ec05103d68443d4ae2927fcb9bf5017..537f7b36cd2b4ddd65fc70d3fed7759a66a22407 100644 (file)
@@ -32,7 +32,7 @@
  ************************************************************************/
 
 // Some security stuff...
  ************************************************************************/
 
 // Some security stuff...
-if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF']))) {
+if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 }
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 }
@@ -55,7 +55,6 @@ case "register": // Do stuff when installtion is running (modules.php?module=adm
 
 case "remove": // Do stuff when removing extension
        // SQL commands to run
 
 case "remove": // Do stuff when removing extension
        // SQL commands to run
-       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config DROP order_max_full";
        $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE what='config_order' LIMIT 1";
        break;
 
        $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE what='config_order' LIMIT 1";
        break;
 
@@ -85,7 +84,7 @@ case "update": // Update an extension
        case "0.1.1": // SQL queries for v0.1.1
                $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE what='config_order' LIMIT 1";
                $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (action, what, title, sort, descr) VALUES ('setup', 'config_order', 'Mailbuchungsseite', '7', 'Einstellungen am Mailbuchungsformular.')";
        case "0.1.1": // SQL queries for v0.1.1
                $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE what='config_order' LIMIT 1";
                $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (action, what, title, sort, descr) VALUES ('setup', 'config_order', 'Mailbuchungsseite', '7', 'Einstellungen am Mailbuchungsformular.')";
-               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD mail_orders BIGINT(20) NOT NULL DEFAULT '0'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD mail_orders BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'";
 
                // Update notes (these will be set as task text!)
                $UPDATE_NOTES = "Maximale Mailbuchung vervollständigt (Admin-Bereich und im Buchungsformular selber).";
 
                // Update notes (these will be set as task text!)
                $UPDATE_NOTES = "Maximale Mailbuchung vervollständigt (Admin-Bereich und im Buchungsformular selber).";
@@ -128,7 +127,7 @@ case "update": // Update an extension
 
        case "0.2.0": // SQL queries for v0.2.0
                // Update notes (these will be set as task text!)
 
        case "0.2.0": // SQL queries for v0.2.0
                // Update notes (these will be set as task text!)
-               $UPDATE_NOTES = "Seit <A href=\"".SERVER_URL."/patches/340-Gast_Mitgliedsmenue_Deaktivieren.zip\">Patch 340</A> &uuml;berfl&uuml;ssige HTML-Tags entfernt.";
+               $UPDATE_NOTES = "Seit <A href=\"#\">Patch 340</A> &uuml;berfl&uuml;ssige HTML-Tags entfernt.";
                break;
 
        case "0.2.1": // SQL queries for v0.2.1
                break;
 
        case "0.2.1": // SQL queries for v0.2.1
@@ -142,7 +141,7 @@ case "update": // Update an extension
                break;
 
        case "0.2.3": // SQL queries for v0.2.3
                break;
 
        case "0.2.3": // SQL queries for v0.2.3
-               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD order_min BIGINT(20) NOT NULL DEFAULT '10'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD order_min BIGINT(20) UNSIGNED NOT NULL DEFAULT '10'";
 
                // Update notes (these will be set as task text!)
                $UPDATE_NOTES = "Minimum an Empf&auml;nger pro Mailbuchung einstellbar. Standart: 10 Empf&auml;nger";
 
                // Update notes (these will be set as task text!)
                $UPDATE_NOTES = "Minimum an Empf&auml;nger pro Mailbuchung einstellbar. Standart: 10 Empf&auml;nger";
@@ -303,18 +302,15 @@ nicht die vom Mitglied eingegebene. Resultat: Das Script beschwerte sich, der Us
        break;
 
 default: // Do stuff when extension is loaded
        break;
 
 default: // Do stuff when extension is loaded
-       $dummy = LOAD_CONFIG();
-       $_CONFIG = array_merge($_CONFIG, $dummy);
-       unset($dummy);
-
        // Do daily reset only when installed and extension version is at least 0.1.1
        // Do daily reset only when installed and extension version is at least 0.1.1
-       if ((defined('__DAILY_RESET')) && (isBooleanConstantAndTrue('mxchange_installed')) && (isBooleanConstantAndTrue('mxchange_installed')) && (isBooleanConstantAndTrue('admin_registered')) && (GET_EXT_VERSION("order") >= "0.1.1"))
+       if ((isBooleanConstantAndTrue('__DAILY_RESET')) && (isBooleanConstantAndTrue('mxchange_installed')) && (isBooleanConstantAndTrue('mxchange_installed')) && (isBooleanConstantAndTrue('admin_registered')) && (GET_EXT_VERSION("order") >= "0.1.1"))
        {
                // Reset mail order values
                $result_ext = SQL_QUERY("UPDATE "._MYSQL_PREFIX."_user_data SET mail_orders=0 WHERE mail_orders > 0", __FILE__, __LINE__);
        }
        break;
 }
        {
                // Reset mail order values
                $result_ext = SQL_QUERY("UPDATE "._MYSQL_PREFIX."_user_data SET mail_orders=0 WHERE mail_orders > 0", __FILE__, __LINE__);
        }
        break;
 }
+
 // Language file prefix
 $EXT_LANG_PREFIX = "order";
 
 // Language file prefix
 $EXT_LANG_PREFIX = "order";