6be7b14ec70973be32f5ea7cd94941048c943fea
[mailer.git] / inc / extensions / wernis / mode-update.php
1 <?php
2 /************************************************************************
3  * Mailer v0.2.1-FINAL                                Start: 07/31/2013 *
4  * ===================                          Last change: 07/31/2013 *
5  *                                                                      *
6  * -------------------------------------------------------------------- *
7  * File              : mode-update.php                                  *
8  * -------------------------------------------------------------------- *
9  * Short description : Wernis extension                                 *
10  * -------------------------------------------------------------------- *
11  * Kurzbeschreibung  : Auszahlung-Erweiterung                           *
12  * -------------------------------------------------------------------- *
13  * $Revision::                                                        $ *
14  * $Date::                                                            $ *
15  * $Tag:: 0.2.1-FINAL                                                 $ *
16  * $Author::                                                          $ *
17  * -------------------------------------------------------------------- *
18  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
19  * Copyright (c) 2009 - 2013 by Mailer Developer Team                   *
20  * For more information visit: http://mxchange.org                      *
21  *                                                                      *
22  * This program is free software; you can redistribute it and/or modify *
23  * it under the terms of the GNU General Public License as published by *
24  * the Free Software Foundation; either version 2 of the License, or    *
25  * (at your option) any later version.                                  *
26  *                                                                      *
27  * This program is distributed in the hope that it will be useful,      *
28  * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
29  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
30  * GNU General Public License for more details.                         *
31  *                                                                      *
32  * You should have received a copy of the GNU General Public License    *
33  * along with this program; if not, write to the Free Software          *
34  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
35  * MA  02110-1301  USA                                                  *
36  ************************************************************************/
37
38 // Some security stuff...
39 if (!defined('__SECURITY')) {
40         die();
41 } // END - if
42
43 // All updates
44 switch (getCurrentExtensionVersion()) {
45         case '0.0.1': // SQL queries for v0.0.1
46                 addConfigAddSql('wernis_payout_active', "ENUM ('Y','N') NOT NULL DEFAULT 'Y'");
47                 addConfigAddSql('wernis_withdraw_active', "ENUM ('Y','N') NOT NULL DEFAULT 'Y'");
48                 addConfigAddSql('wernis_payout_factor', 'FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 1.00000');
49                 addConfigAddSql('wernis_withdraw_factor', 'FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 1.00000');
50                 addConfigAddSql('wernis_payout_fee_percent', 'FLOAT(8,5) UNSIGNED NOT NULL DEFAULT 0.00000');
51                 addConfigAddSql('wernis_withdraw_fee_percent', 'FLOAT(8,5) UNSIGNED NOT NULL DEFAULT 0.00000');
52                 addConfigAddSql('wernis_payout_fee_fix', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 0');
53                 addConfigAddSql('wernis_withdraw_fee_fix', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 0');
54
55                 // Update notes (these will be set as task text!)
56                 setExtensionUpdateNotes("Ein-/Auszahlungsfunktion getrennt ein- und ausschaltbar, sowie mit Umrechungsfaktoren {?POINTS?}-&gt;Wernis versehen. Prozentualer Abzug als &quot;Betreibergeb&uuml;hr hinzugef&uuml;gt, was z.B. f&uuml;r Wechselstuben interessant ist.");
57                 break;
58
59         case '0.0.2': // SQL queries for v0.0.2
60                 addConfigAddSql('wernis_pass_md5', "VARCHAR(32) NOT NULL DEFAULT ''");
61
62                 // Update notes (these will be set as task text!)
63                 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.");
64                 break;
65
66         case '0.0.3': // SQL queries for v0.0.3
67                 addConfigAddSql('wernis_refid', 'INT(5) UNSIGNED ZEROFILL NOT NULL DEFAULT 00000');
68
69                 // Update notes (these will be set as task text!)
70                 setExtensionUpdateNotes("WDS66-Username muss nun eintragen werden (API-Anpassung).");
71                 break;
72
73         case '0.0.4': // SQL queries for v0.0.4
74                 // Register points data
75                 registerExtensionPointsData('wernis_withdraw', 'order_points', 'LOCKED', 'DIRECT');
76
77                 // Update notes
78                 setExtensionUpdateNotes("&Uuml;berweisungen vom Portal werden nun &uuml;ber die Tabelle <strong>{OPEN_CONFIG}_MYSQL_PREFIX{CLOSE_CONFIG}_points_data</strong> verwaltet.");
79                 break;
80
81         case '0.0.5': // SQL queries for v0.0.5
82                 addExtensionChangeTableColumnSql('user_wernis', 'wernis_type', 'wernis_type', "ENUM('WITHDRAW','PAYOUT','FAILED') NOT NULL DEFAULT 'FAILED'");
83
84                 // Update notes
85                 setExtensionUpdateNotes("IN/OUT ersetzt mit WITHDRAW/PAYOUT.");
86                 break;
87
88         case '0.0.6': // SQL queries for v0.0.6
89                 addExtensionChangeTableColumnSql('config', 'wernis_pass_md5', 'wernis_pass_md5', " VARCHAR(255) NOT NULL DEFAULT ''");
90
91                 // Update notes
92                 setExtensionUpdateNotes("Es wird seit API-Version 0.6-BETA SHA256 (hexadezimal kodiert) verwendet.");
93                 break;
94
95         case '0.0.7': // SQL queries for v0.0.7
96                 // This update depends on ext-register and ext-user
97                 addExtensionDependency('register');
98                 addExtensionDependency('user');
99
100                 // Add data to both tables
101                 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_user_register_provider` (`provider_name`, `provider_extension`) VALUES ('wernis_user_registration', 'wernis')");
102                 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_user_login_provider` (`provider_name`, `provider_extension`) VALUES ('wernis_user_login', 'wernis')");
103
104                 // Register all filters
105                 registerFilter(__FILE__, __LINE__, 'user_registration', 'WERNIS_USER_REGISTRATION', FALSE, TRUE, isExtensionDryRun());
106                 registerFilter(__FILE__, __LINE__, 'user_registration_done', 'WERNIS_USER_REGISTRATION_DONE', FALSE, TRUE, isExtensionDryRun());
107                 registerFilter(__FILE__, __LINE__, 'user_registration_failed', 'WERNIS_USER_REGISTRATION_FAILED', FALSE, TRUE, isExtensionDryRun());
108                 registerFilter(__FILE__, __LINE__, 'user_registration_form', 'WERNIS_USER_REGISTRATION_FORM', FALSE, TRUE, isExtensionDryRun());
109                 registerFilter(__FILE__, __LINE__, 'user_login', 'WERNIS_USER_LOGIN', FALSE, TRUE, isExtensionDryRun());
110                 registerFilter(__FILE__, __LINE__, 'check_user_registration', 'WERNIS_USER_REGISTRATION_CHECK', FALSE, TRUE, isExtensionDryRun());
111                 registerFilter(__FILE__, __LINE__, 'check_user_login', 'WERNIS_USER_LOGIN_CHECK', FALSE, TRUE, isExtensionDryRun());
112
113                 // Update notes
114                 setExtensionUpdateNotes("Anmeldung &uuml;rber WDS66 API angefangen: Filter registriert.");
115                 break;
116 } // END - switch
117
118 // [EOF]
119 ?>