2 /************************************************************************
3 * Mailer v0.2.1-FINAL Start: 01/14/2013 *
4 * =================== Last change: 01/14/2013 *
6 * -------------------------------------------------------------------- *
7 * File : mode-setup.php *
8 * -------------------------------------------------------------------- *
9 * Short description : Steps for setup on ext-user *
10 * -------------------------------------------------------------------- *
11 * Kurzbeschreibung : Schritte fuer Setup fuer ext-user *
12 * -------------------------------------------------------------------- *
15 * $Tag:: 0.2.1-FINAL $ *
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 *
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. *
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. *
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, *
36 ************************************************************************/
38 // Some security stuff...
39 if (!defined('__SECURITY')) {
44 addDropTableSql('user_cats');
45 addCreateTableSql('user_cats', "
46 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
47 `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
48 `cat_id` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0,
52 'User->category connection data');
54 addDropTableSql('user_data');
55 addCreateTableSql('user_data', "
56 `userid` BIGINT(20) NOT NULL AUTO_INCREMENT,
57 `surname` VARCHAR(255) NOT NULL DEFAULT '',
58 `family` VARCHAR(255) NOT NULL DEFAULT '',
59 `street_nr` VARCHAR(255) NOT NULL DEFAULT '',
60 `country` VARCHAR(4) NOT NULL DEFAULT '',
61 `zip` VARCHAR(6) NOT NULL DEFAULT '',
62 `city` VARCHAR(255) NOT NULL DEFAULT '',
63 `email` VARCHAR(255) NOT NULL DEFAULT '',
64 `birth_day` CHAR(2) NOT NULL DEFAULT '01',
65 `birth_month` CHAR(2) NOT NULL DEFAULT '01',
66 `birth_year` VARCHAR(4) NOT NULL DEFAULT '1970',
67 `password` VARCHAR(255) NOT NULL DEFAULT '',
68 `max_mails` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
69 `receive_mails` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
70 `refid` BIGINT(20) NULL DEFAULT NULL,
71 `status` ENUM('UNCONFIRMED','CONFIRMED','LOCKED') NOT NULL DEFAULT 'UNCONFIRMED',
72 `user_hash` VARCHAR(255) NULL DEFAULT NULL,
73 `REMOTE_ADDR` VARCHAR(15) NOT NULL DEFAULT '0.0.0.0',
74 `last_online` VARCHAR(10) NOT NULL DEFAULT 0,
75 `last_module` VARCHAR(255) NULL DEFAULT NULL,
76 `ref_clicks` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
77 `total_logins` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
78 `gender` ENUM('M','F') NOT NULL DEFAULT 'M',
79 `used_points` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000,
80 `emails_sent` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
81 `joined` VARCHAR(10) NOT NULL DEFAULT 0,
82 `last_update` VARCHAR(10) NOT NULL DEFAULT 0,
83 `last_profile_sent` VARCHAR(10) NOT NULL DEFAULT 0,
84 `notified` ENUM('Y','N') NOT NULL DEFAULT 'N',
85 `ref_payout` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0,
86 `last_login` VARCHAR(10) NOT NULL DEFAULT 0,
87 `login_failures` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
88 `last_failure` TIMESTAMP NULL DEFAULT NULL,
89 PRIMARY KEY (`userid`),
90 UNIQUE INDEX (`user_hash`),
92 INDEX `status_mails` (`status`, `max_mails`)",
95 addDropTableSql('user_points');
96 addCreateTableSql('user_points', "
97 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
98 `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
99 `ref_depth` TINYINT(3) UNSIGNED NULL DEFAULT NULL,
100 `points` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000,
101 `locked_points` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000,
104 'User points (no used points)');
106 addDropTableSql('user_links');
107 addCreateTableSql('user_links', "
108 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
109 `stats_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
110 `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
111 `link_type` VARCHAR(255) NOT NULL DEFAULT 'NORMAL',
115 'Unconfirmed mails per user');
117 addDropTableSql('user_stats');
118 addCreateTableSql('user_stats', "
119 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
120 `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
121 `cat_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
122 `payment_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
123 `subject` VARCHAR(255) NOT NULL DEFAULT '',
124 `url` TINYTEXT NOT NULL,
125 `max_rec` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
126 `clicks` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
127 `timestamp_ordered` VARCHAR(10) NOT NULL DEFAULT '',
128 `pool_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
129 `timestamp_sstart` VARCHAR(10) NOT NULL DEFAULT '',
130 `timestamp_send` VARCHAR(10) NOT NULL DEFAULT '',
131 `is_stats` ENUM('Y','N') NOT NULL DEFAULT 'N',
135 INDEX (`payment_id`),
137 'Mail statistics per user order');
139 addDropTableSql('user_stats_data');
140 addCreateTableSql('user_stats_data', "
141 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
142 `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
143 `stats_type` VARCHAR(255) NOT NULL DEFAULT 'unknown',
144 `stats_data` VARCHAR(255) NOT NULL DEFAULT '',
145 `inserted` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
148 INDEX (`stats_type`)",
149 'Member statistics data');
152 addAdminMenuSql('user', NULL, 'Mitglieder-Management', 'Mitglieder freischalten, sperren, Accounts editieren, Neuanmeldungen verwalten, {OPEN_CONFIG}POINTS{CLOSE_CONFIG} gutschreiben und abziehen und und und...', 3);
153 addAdminMenuSql('user', 'del_user', 'Mitglied löschen', 'Löschen Sie hier Mitglied, die gegen die AGBs mehrmals verstossen haben. Bitte seien Sie nett zu Ihren Mitgliedern und löschen Sie nicht gleich.', 1);
154 addAdminMenuSql('user', 'lock_user', 'Mitglied sperren / entsperren', 'Sperren Sie Mitglied, die zu viele unbestätigte Mails haben oder gegen Ihre AGBs verstossen haben über diesen Menüpunkt.', 3);
155 addAdminMenuSql('user', 'list_user', 'Mitglieder auflisten', 'Listen Sie alle Mitglied oder eingeschränkt nach Suchkritieren Ihre Userdatenbank auf. Sie könen per Klick auf die Usernummer sich Details zum Mitglied ansehen.', 4);
156 addAdminMenuSql('user', 'add_points', '{OPEN_CONFIG}POINTS{CLOSE_CONFIG} gutschreiben', 'Buchen Sie einem Mitglied direkt {OPEN_CONFIG}POINTS{CLOSE_CONFIG} auf. Sie können dazu auch einen Kommentar mitsenden.', 5);
157 addAdminMenuSql('user', 'edit_user', 'Account editieren', 'Daten eines Mitgliedaccountes ändern.', 6);
158 addAdminMenuSql('user', 'list_refs', 'Referrals anzeigen', 'Mit diesem Menüpunkt können Sie die generierten Referrals eines Mitgliedes auflisten.', 7);
159 addAdminMenuSql('user', 'list_links', 'Unbestätigte Mails', 'Mit diesem Menüpunkt können Sie die vom Mitglied nicht bestätigten Mails anzeigen.', 8);
160 addAdminMenuSql('user', 'list_user_cats', 'Kategorien anzeigen', 'Listet die ausgewählten Kategorien eines Mitgliedes auf.', 9);
162 // Add dependency to ext-other as pool-user requires it
163 addExtensionDependency('other');