X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fextensions%2Fext-wernis.php;h=f2dd74a5e5e37574483391f54a8e04fbc0c78f36;hb=e9da1508b2a3ccbf63adc999981674740a47e074;hp=3f6a9240ac9cd6ccae3f87cef770f7e7b51b8093;hpb=3f7f0051c91c54cb691303b9d49fb9cd1a7a4e8c;p=mailer.git diff --git a/inc/extensions/ext-wernis.php b/inc/extensions/ext-wernis.php index 3f6a9240ac..f2dd74a5e5 100644 --- a/inc/extensions/ext-wernis.php +++ b/inc/extensions/ext-wernis.php @@ -16,8 +16,8 @@ * $Author:: $ * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * - * Copyright (c) 2009 - 2011 by Mailer Developer Team * - * For more information visit: http://www.mxchange.org * + * Copyright (c) 2009 - 2015 by Mailer Developer Team * + * For more information visit: http://mxchange.org * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -41,13 +41,13 @@ if (!defined('__SECURITY')) { } // END - if // Version of this extension -setThisExtensionVersion('0.0.3'); +setThisExtensionVersion('0.0.9'); // Version history array (add more with , '0.0.1' and so on) -setExtensionVersionHistory(array('0.0.0', '0.0.1', '0.0.2', '0.0.3')); +setExtensionVersionHistory(array('0.0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.0.5', '0.0.6', '0.0.7', '0.0.8', '0.0.9')); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running + case 'setup': // Do stuff when installation is running // SQL commands to run addDropTableSql('user_wernis'); addCreateTableSql('user_wernis', " @@ -56,10 +56,10 @@ switch (getExtensionMode()) { `wernis_account` VARCHAR(255) NOT NULL DEFAULT '', `wernis_amount` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000, `wernis_timestamp` VARCHAR(10) NOT NULL DEFAULT 0, -`wernis_type` ENUM('IN','OUT','FAILED') NOT NULL DEFAULT 'FAILED', -`wernis_api_message` TINYTEXT, +`wernis_type` ENUM('WITHDRAW','PAYOUT','FAILED') NOT NULL DEFAULT 'FAILED', +`wernis_api_message` TINYTEXT NOT NULL, `wernis_api_status` VARCHAR(255) NULL DEFAULT NULL, -PRIMARY KEY (`id`) +PRIMARY KEY (`id`), INDEX (`userid`)", 'Transfered Wernis per user'); @@ -71,12 +71,13 @@ INDEX (`userid`)", addConfigAddSql('wernis_api_url', "VARCHAR(255) NOT NULL DEFAULT 'http://www.wds66.com/api/'"); // User data - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD wernis_userid VARCHAR(6) NOT NULL DEFAULT ''"); + addExtensionAddTableColumnSql('user_data', 'wernis_userid', "VARCHAR(6) NULL DEFAULT NULL"); + addExtensionAddTableColumnSql('user_data', 'wernis_refid', "VARCHAR(6) NULL DEFAULT NULL"); // Admin menu addAdminMenuSql('wernis', NULL, 'Wernis-Management', 'Konfiguration zur WDS66-API einstellen, Auszahlungen auflisten usw..', 15); addAdminMenuSql('wernis', 'config_wernis', 'WDS66-API-Einstellungen', 'Konfiguration zur WDS66-API einstellen.', 1); - addAdminMenuSql('wernis', 'list_wernis', 'Wernis-Anfragen auflisten', 'Listet alle Wernis-Auszahlungsanfragen Ihrer Mitglieder auf.', 2); + addAdminMenuSql('wernis', 'list_wernis', 'Anfragen auflisten', 'Listet alle Wernis-Ein- und -auszahlungsanfragen Ihrer Mitglieder und Sponsoren auf.', 2); // Member menu addMemberMenuSql('main', 'wernis', 'Wernis-Ein-/Auszahlungen', 11); @@ -88,53 +89,36 @@ INDEX (`userid`)", case 'remove': // Do stuff when removing extension // SQL commands to run addDropTableSql('user_wernis'); + addDropTableSql('wernis_regs'); addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='wernis'"); addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what`='wernis' LIMIT 1"); addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE `what`='wernis_portal' LIMIT 1"); + + // Unregister points data + unregisterExtensionPointsData('wernis_withdraw'); + + // Unregister all filters + unregisterFilter(__FILE__, __LINE__, 'user_registration', 'WERNIS_USER_REGISTRATION', TRUE, isExtensionDryRun()); + unregisterFilter(__FILE__, __LINE__, 'user_registration_done', 'WERNIS_USER_REGISTRATION_DONE', TRUE, isExtensionDryRun()); + unregisterFilter(__FILE__, __LINE__, 'user_registration_failed', 'WERNIS_USER_REGISTRATION_FAILED', TRUE, isExtensionDryRun()); + unregisterFilter(__FILE__, __LINE__, 'user_registration_form', 'WERNIS_USER_REGISTRATION_FORM', TRUE, isExtensionDryRun()); + unregisterFilter(__FILE__, __LINE__, 'user_login', 'WERNIS_USER_LOGIN', TRUE, isExtensionDryRun()); + unregisterFilter(__FILE__, __LINE__, 'pre_user_registration', 'PRE_USER_REGISTRATION_WERNIS', TRUE, isExtensionDryRun()); break; case 'activate': // Do stuff when admin activates this extension // SQL commands to run - addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_guest_menu` SET `visible`='Y', `locked`='N' WHERE `what`='wernis_portal' LIMIT 1"); - addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `visible`='Y', `locked`='N' WHERE `what`='wernis' LIMIT 1"); + addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_guest_menu` SET `visible`='Y',`locked`='N' WHERE `what`='wernis_portal' LIMIT 1"); + addExtensionSql("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 - addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_guest_menu` SET `visible`='N', `locked`='Y' WHERE `what`='wernis_portal' LIMIT 1"); - addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `visible`='N', `locked`='Y' WHERE `what`='wernis' LIMIT 1"); + addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_guest_menu` SET `visible`='N',`locked`='Y' WHERE `what`='wernis_portal' LIMIT 1"); + addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `visible`='N',`locked`='Y' WHERE `what`='wernis' LIMIT 1"); break; case 'update': // Update an extension - switch (getCurrentExtensionVersion()) { - case '0.0.1': // SQL queries for v0.0.1 - addConfigAddSql('wernis_payout_active', "ENUM ('Y','N') NOT NULL DEFAULT 'Y'"); - addConfigAddSql('wernis_withdraw_active', "ENUM ('Y','N') NOT NULL DEFAULT 'Y'"); - addConfigAddSql('wernis_payout_factor', 'FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 1.00000'); - addConfigAddSql('wernis_withdraw_factor', 'FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 1.00000'); - addConfigAddSql('wernis_payout_fee_percent', 'FLOAT(8,5) UNSIGNED NOT NULL DEFAULT 0.00000'); - addConfigAddSql('wernis_withdraw_fee_percent', 'FLOAT(8,5) UNSIGNED NOT NULL DEFAULT 0.00000'); - addConfigAddSql('wernis_payout_fee_fix', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 0'); - addConfigAddSql('wernis_withdraw_fee_fix', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 0'); - - // Update notes (these will be set as task text!) - setExtensionUpdateNotes("Ein-/Auszahlungsfunktion getrennt ein- und ausschaltbar, sowie mit Umrechungsfaktoren {?POINTS?}->Wernis versehen. Prozentualer Abzug als "Betreibergebühr hinzugefügt, was z.B. für Wechselstuben interessant ist."); - break; - - case '0.0.2': // SQL queries for v0.0.2 - addConfigAddSql('wernis_pass_md5', "VARCHAR(32) NOT NULL DEFAULT ''"); - - // Update notes (these will be set as task text!) - setExtensionUpdateNotes("Auszahlunsfunktion an die neue API 0.2-BETA angepasst. Demnach muss Ihr Wernis-Passwort beim Auszahlen benutzt werden und in Ihrem {?mt_word?} als MD5-Hash gespeichert werden."); - break; - - case '0.0.3': // SQL queries for v0.0.3 - addConfigAddSql('wernis_refid', 'INT(5) UNSIGNED ZEROFILL NOT NULL DEFAULT 00000'); - - // Update notes (these will be set as task text!) - setExtensionUpdateNotes("WDS66-Username muss nun eintragen werden (API-Anpassung)."); - break; - } // END - switch break; case 'modify': // When the extension got modified @@ -149,7 +133,7 @@ INDEX (`userid`)", break; default: // Unknown extension mode - logDebugMessage(__FILE__, __LINE__, sprintf("Unknown extension mode %s in extension %s detected.", getExtensionMode(), getCurrentExtensionName())); + reportBug(__FILE__, __LINE__, sprintf('Unknown extension mode %s in extension %s detected.', getExtensionMode(), getCurrentExtensionName())); break; } // END - switch