2 /************************************************************************
3 * Mailer v0.2.1-FINAL Start: 07/31/2013 *
4 * =================== Last change: 07/31/2013 *
6 * -------------------------------------------------------------------- *
7 * File : mode-update.php *
8 * -------------------------------------------------------------------- *
9 * Short description : Wernis extension *
10 * -------------------------------------------------------------------- *
11 * Kurzbeschreibung : Auszahlung-Erweiterung *
12 * -------------------------------------------------------------------- *
13 * Copyright (c) 2003 - 2009 by Roland Haeder *
14 * Copyright (c) 2009 - 2015 by Mailer Developer Team *
15 * For more information visit: http://mxchange.org *
17 * This program is free software; you can redistribute it and/or modify *
18 * it under the terms of the GNU General Public License as published by *
19 * the Free Software Foundation; either version 2 of the License, or *
20 * (at your option) any later version. *
22 * This program is distributed in the hope that it will be useful, *
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
25 * GNU General Public License for more details. *
27 * You should have received a copy of the GNU General Public License *
28 * along with this program; if not, write to the Free Software *
29 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
31 ************************************************************************/
33 // Some security stuff...
34 if (!defined('__SECURITY')) {
39 switch (getCurrentExtensionVersion()) {
40 case '0.0.1': // SQL queries for v0.0.1
41 addConfigAddSql('wernis_payout_active', "ENUM ('Y','N') NOT NULL DEFAULT 'Y'");
42 addConfigAddSql('wernis_withdraw_active', "ENUM ('Y','N') NOT NULL DEFAULT 'Y'");
43 addConfigAddSql('wernis_payout_factor', 'FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 1.00000');
44 addConfigAddSql('wernis_withdraw_factor', 'FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 1.00000');
45 addConfigAddSql('wernis_payout_fee_percent', 'FLOAT(8,5) UNSIGNED NOT NULL DEFAULT 0.00000');
46 addConfigAddSql('wernis_withdraw_fee_percent', 'FLOAT(8,5) UNSIGNED NOT NULL DEFAULT 0.00000');
47 addConfigAddSql('wernis_payout_fee_fix', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 0');
48 addConfigAddSql('wernis_withdraw_fee_fix', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 0');
50 // Update notes (these will be set as task text!)
51 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.");
54 case '0.0.2': // SQL queries for v0.0.2
55 addConfigAddSql('wernis_pass_md5', "VARCHAR(32) NOT NULL DEFAULT ''");
57 // Update notes (these will be set as task text!)
58 setExtensionUpdateNotes("Auszahlungsfunktion 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.");
61 case '0.0.3': // SQL queries for v0.0.3
62 addConfigAddSql('wernis_refid', 'INT(5) UNSIGNED ZEROFILL NOT NULL DEFAULT 00000');
64 // Update notes (these will be set as task text!)
65 setExtensionUpdateNotes("WDS66-Username muss nun eintragen werden (API-Anpassung).");
68 case '0.0.4': // SQL queries for v0.0.4
69 // Register points data
70 registerExtensionPointsData('wernis_withdraw', 'order_points', 'LOCKED', 'DIRECT');
73 setExtensionUpdateNotes("Überweisungen vom Portal werden nun über die Tabelle <strong>{OPEN_CONFIG}_MYSQL_PREFIX{CLOSE_CONFIG}_points_data</strong> verwaltet.");
76 case '0.0.5': // SQL queries for v0.0.5
77 addExtensionChangeTableColumnSql('user_wernis', 'wernis_type', 'wernis_type', "ENUM('WITHDRAW','PAYOUT','FAILED') NOT NULL DEFAULT 'FAILED'");
80 setExtensionUpdateNotes("IN/OUT ersetzt mit WITHDRAW/PAYOUT.");
83 case '0.0.6': // SQL queries for v0.0.6
84 addExtensionChangeTableColumnSql('config', 'wernis_pass_md5', 'wernis_pass_md5', " VARCHAR(255) NOT NULL DEFAULT ''");
87 setExtensionUpdateNotes("Es wird seit API-Version 0.6-BETA SHA256 (hexadezimal kodiert) verwendet.");
90 case '0.0.7': // SQL queries for v0.0.7
91 // This update depends on ext-register and ext-user
92 addExtensionDependency('register');
93 addExtensionDependency('user');
95 // Add data to both tables
96 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_user_register_provider` (`provider_name`, `provider_extension`) VALUES ('wernis_user_registration', 'wernis')");
97 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_user_login_provider` (`provider_name`, `provider_extension`) VALUES ('wernis_user_login', 'wernis')");
99 // Register all filters
100 registerFilter(__FILE__, __LINE__, 'user_registration', 'WERNIS_USER_REGISTRATION', FALSE, TRUE, isExtensionDryRun());
101 registerFilter(__FILE__, __LINE__, 'user_registration_done', 'WERNIS_USER_REGISTRATION_DONE', FALSE, TRUE, isExtensionDryRun());
102 registerFilter(__FILE__, __LINE__, 'user_registration_failed', 'WERNIS_USER_REGISTRATION_FAILED', FALSE, TRUE, isExtensionDryRun());
103 registerFilter(__FILE__, __LINE__, 'user_registration_form', 'WERNIS_USER_REGISTRATION_FORM', FALSE, TRUE, isExtensionDryRun());
104 registerFilter(__FILE__, __LINE__, 'user_login', 'WERNIS_USER_LOGIN', FALSE, TRUE, isExtensionDryRun());
105 registerFilter(__FILE__, __LINE__, 'check_user_registration', 'WERNIS_USER_REGISTRATION_CHECK', FALSE, TRUE, isExtensionDryRun());
106 registerFilter(__FILE__, __LINE__, 'check_user_login', 'WERNIS_USER_LOGIN_CHECK', FALSE, TRUE, isExtensionDryRun());
109 setExtensionUpdateNotes("Anmeldung ürber WDS66 API angefangen: Filter registriert.");
112 case '0.0.8': // SQL queries for v0.0.8
113 addConfigAddSql('wernis_base_url', "VARCHAR(255) NOT NULL DEFAULT 'http://www.wds66.com'");
115 // SQL commands to run
116 addDropTableSql('wernis_regs');
117 addCreateTableSql('wernis_regs', "
118 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
119 `local_userid` BIGINT(20) UNSIGNED NULL DEFAULT NULL,
120 `wernis_userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
121 `api_auth_status` VARCHAR(255) NOT NULL DEFAULT 'UNKNOWN',
122 `api_auth_key` VARCHAR(255) NOT NULL DEFAULT 'INVALID',
123 `api_redirect_challenge` VARCHAR(255) NOT NULL DEFAULT 'INVALID',
124 `record_inserted` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
126 INDEX (`wernis_userid`)",
127 'Registrations (also pending) over WDS66 API');
129 // Update notes (these will be set as task text!)
130 setExtensionUpdateNotes("Basis-URL für alle Scripte (Referral-Link, auth.php-Umleitung usw. nicht aber API) und Tabelle für API-Aufrufe von auth.php hinzugefügt.");
133 case '0.0.9': // SQL queries for v0.0.9
135 registerFilter(__FILE__, __LINE__, 'pre_user_registration', 'PRE_USER_REGISTRATION_WERNIS', FALSE, TRUE, isExtensionDryRun());
137 // Update notes (these will be set as task text!)
138 setExtensionUpdateNotes("Basis-URL für alle Scripte (Referral-Link, auth.php-Umleitung usw. nicht aber API) und Tabelle für API-Aufrufe von auth.php hinzugefügt.");