]> git.mxchange.org Git - mailer.git/blobdiff - inc/extensions/ext-transfer.php
Security line in all includes changed
[mailer.git] / inc / extensions / ext-transfer.php
index 76fec572ee57d642e0a94c6ae437ee1535166efd..d4d757336625204d2a3ec4f01c0149eded4e17cd 100644 (file)
@@ -32,8 +32,7 @@
  ************************************************************************/
 
 // 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);
 }
@@ -56,10 +55,10 @@ case "register": // Do stuff when installtion is running
 
        // Transfer from a member
        $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_user_transfers_in (
-id BIGINT(20) NOT NULL AUTO_INCREMENT,
-userid BIGINT(20) NOT NULL DEFAULT '0',
-from_uid BIGINT(20) NOT NULL DEFAULT '0',
-points BIGINT(20) NOT NULL DEFAULT '0',
+id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+userid BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+from_uid BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+points BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
 reason VARCHAR(255) NOT NULL DEFAULT '',
 time_trans VARCHAR(14) NOT NULL DEFAULT '0',
 trans_id VARCHAR(12) NOT NULL DEFAULT '',
@@ -70,10 +69,10 @@ PRIMARY KEY(id)
 
        // Transfers to a member
        $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_user_transfers_out (
-id BIGINT(20) NOT NULL AUTO_INCREMENT,
-userid BIGINT(20) NOT NULL DEFAULT '0',
-to_uid BIGINT(20) NOT NULL DEFAULT '0',
-points BIGINT(20) NOT NULL DEFAULT '0',
+id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+userid BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+to_uid BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+points BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
 reason VARCHAR(255) NOT NULL DEFAULT '',
 time_trans VARCHAR(14) NOT NULL DEFAULT '0',
 trans_id VARCHAR(12) NOT NULL DEFAULT '',
@@ -92,11 +91,11 @@ PRIMARY KEY(id)
        $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (action, what, title, visible, locked, sort) VALUES ('main', 'transfer', '{!POINTS!}-Transfer', 'Y', 'Y', 5)";
 
        // Add config values
-       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD transfer_max BIGINT(20) NOT NULL DEFAULT '50'";
-       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD transfer_age BIGINT(20) NOT NULL DEFAULT '".(ONE_DAY*28)."'";
-       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD transfer_timeout BIGINT(20) NOT NULL DEFAULT '".ONE_DAY."'";
-       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD transfer_balance BIGINT(20) NOT NULL DEFAULT '100'";
-       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD transfer_code BIGINT(20) NOT NULL DEFAULT '5'";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD transfer_max BIGINT(20) UNSIGNED NOT NULL DEFAULT '50'";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD transfer_age BIGINT(20) UNSIGNED NOT NULL DEFAULT '".(ONE_DAY*28)."'";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD transfer_timeout BIGINT(20) UNSIGNED NOT NULL DEFAULT '".ONE_DAY."'";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD transfer_balance BIGINT(20) UNSIGNED NOT NULL DEFAULT '100'";
+       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD transfer_code BIGINT(20) UNSIGNED NOT NULL DEFAULT '5'";
 
        // Add row(s) to user's data
        $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD opt_in ENUM('Y', 'N') NOT NULL DEFAULT 'N'";
@@ -108,11 +107,6 @@ case "remove": // Do stuff when removing extension
        $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_user_transfers_out";
        $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE action='transfer' LIMIT 4";
        $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_member_menu WHERE what='transfer' LIMIT 1";
-       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config DROP transfer_max";
-       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config DROP transfer_age";
-       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config DROP transfer_timeout";
-       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config DROP transfer_balance";
-       $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config DROP transfer_code";
        $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data DROP opt_in";
        break;
 
@@ -183,7 +177,7 @@ case "update": // Update an extension
 
        case "0.1.2": // SQL queries for v0.1.2
                // 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.1.3": // SQL queries for v0.1.3
@@ -283,17 +277,13 @@ case "update": // Update an extension
        break;
 
 default: // Do stuff when extension is loaded
-       $dummy = LOAD_CONFIG();
-       $_CONFIG = array_merge($_CONFIG, $dummy);
-       unset($dummy);
-
-       if ((defined('__DAILY_RESET')) && ($_CONFIG['ap_transfer'] == "Y"))
-       {
+       if ((isBooleanConstantAndTrue('__DAILY_RESET')) && ($_CONFIG['ap_transfer'] == "Y")) {
                // Automatically remove outdated or not displayed transactions
                TRANSFER_AUTPPURGE($_CONFIG['transfer_max'], $_CONFIG['transfer_age']);
        }
        break;
 }
+
 // Language file prefix
 $EXT_LANG_PREFIX = "transfer";