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 * -------------------------------------------------------------------- *
13 * Copyright (c) 2003 - 2009 by Roland Haeder *
14 * Copyright (c) 2009 - 2016 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 addDropTableSql('user_cats');
40 addCreateTableSql('user_cats', "
41 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
42 `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
43 `cat_id` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0,
47 'User->category connection data');
49 addDropTableSql('user_data');
50 addCreateTableSql('user_data', "
51 `userid` BIGINT(20) NOT NULL AUTO_INCREMENT,
52 `surname` VARCHAR(255) NOT NULL DEFAULT '',
53 `family` VARCHAR(255) NOT NULL DEFAULT '',
54 `street_nr` VARCHAR(255) NOT NULL DEFAULT '',
55 `country` VARCHAR(4) NOT NULL DEFAULT '',
56 `zip` VARCHAR(6) NOT NULL DEFAULT '',
57 `city` VARCHAR(255) NOT NULL DEFAULT '',
58 `email` VARCHAR(255) NOT NULL DEFAULT '',
59 `birth_day` CHAR(2) NOT NULL DEFAULT '01',
60 `birth_month` CHAR(2) NOT NULL DEFAULT '01',
61 `birth_year` VARCHAR(4) NOT NULL DEFAULT '1970',
62 `password` VARCHAR(255) NOT NULL DEFAULT '',
63 `max_mails` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
64 `receive_mails` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
65 `refid` BIGINT(20) NULL DEFAULT NULL,
66 `status` ENUM('UNCONFIRMED','CONFIRMED','LOCKED') NOT NULL DEFAULT 'UNCONFIRMED',
67 `user_hash` VARCHAR(255) NULL DEFAULT NULL,
68 `REMOTE_ADDR` VARCHAR(15) NOT NULL DEFAULT '0.0.0.0',
69 `last_online` VARCHAR(10) NOT NULL DEFAULT 0,
70 `last_module` VARCHAR(255) NULL DEFAULT NULL,
71 `ref_clicks` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
72 `total_logins` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
73 `gender` ENUM('M','F') NOT NULL DEFAULT 'M',
74 `used_points` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000,
75 `emails_sent` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
76 `joined` VARCHAR(10) NOT NULL DEFAULT 0,
77 `last_update` VARCHAR(10) NOT NULL DEFAULT 0,
78 `last_profile_sent` VARCHAR(10) NOT NULL DEFAULT 0,
79 `notified` ENUM('Y','N') NOT NULL DEFAULT 'N',
80 `ref_payout` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0,
81 `last_login` VARCHAR(10) NOT NULL DEFAULT 0,
82 `login_failures` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
83 `last_failure` TIMESTAMP NULL DEFAULT NULL,
84 PRIMARY KEY (`userid`),
85 UNIQUE INDEX (`user_hash`),
87 INDEX `status_mails` (`status`, `max_mails`)",
90 addDropTableSql('user_points');
91 addCreateTableSql('user_points', "
92 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
93 `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
94 `ref_depth` TINYINT(3) UNSIGNED NULL DEFAULT NULL,
95 `points` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000,
96 `locked_points` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000,
99 'User points (no used points)');
101 addDropTableSql('user_links');
102 addCreateTableSql('user_links', "
103 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
104 `stats_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
105 `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
106 `link_type` VARCHAR(255) NOT NULL DEFAULT 'NORMAL',
110 'Unconfirmed mails per user');
112 addDropTableSql('user_stats');
113 addCreateTableSql('user_stats', "
114 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
115 `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
116 `cat_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
117 `payment_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
118 `subject` VARCHAR(255) NOT NULL DEFAULT '',
119 `url` TINYTEXT NOT NULL,
120 `max_rec` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
121 `clicks` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
122 `timestamp_ordered` VARCHAR(10) NOT NULL DEFAULT '',
123 `pool_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
124 `timestamp_sstart` VARCHAR(10) NOT NULL DEFAULT '',
125 `timestamp_send` VARCHAR(10) NOT NULL DEFAULT '',
126 `is_stats` ENUM('Y','N') NOT NULL DEFAULT 'N',
130 INDEX (`payment_id`),
132 'Mail statistics per user order');
134 addDropTableSql('user_stats_data');
135 addCreateTableSql('user_stats_data', "
136 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
137 `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
138 `stats_type` VARCHAR(255) NOT NULL DEFAULT 'unknown',
139 `stats_data` VARCHAR(255) NOT NULL DEFAULT '',
140 `inserted` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
143 INDEX (`stats_type`)",
144 'Member statistics data');
147 addAdminMenuSql('user', NULL, 'Mitglieder-Management', 'Mitglieder freischalten, sperren, Accounts editieren, Neuanmeldungen verwalten, {OPEN_CONFIG}POINTS{CLOSE_CONFIG} gutschreiben und abziehen und und und...', 3);
148 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);
149 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);
150 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);
151 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);
152 addAdminMenuSql('user', 'edit_user', 'Account editieren', 'Daten eines Mitgliedaccountes ändern.', 6);
153 addAdminMenuSql('user', 'list_refs', 'Referrals anzeigen', 'Mit diesem Menüpunkt können Sie die generierten Referrals eines Mitgliedes auflisten.', 7);
154 addAdminMenuSql('user', 'list_links', 'Unbestätigte Mails', 'Mit diesem Menüpunkt können Sie die vom Mitglied nicht bestätigten Mails anzeigen.', 8);
155 addAdminMenuSql('user', 'list_user_cats', 'Kategorien anzeigen', 'Listet die ausgewählten Kategorien eines Mitgliedes auf.', 9);
157 // Add dependency to ext-other as pool-user requires it
158 addExtensionDependency('other');