a37d1cc13f38e8a1975d21c5e2166a7ec212d6e5
[mailer.git] / inc / extensions / user / mode-setup.php
1 <?php
2 /************************************************************************
3  * Mailer v0.2.1-FINAL                                Start: 01/14/2013 *
4  * ===================                          Last change: 01/14/2013 *
5  *                                                                      *
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  * $Revision::                                                        $ *
14  * $Date::                                                            $ *
15  * $Tag:: 0.2.1-FINAL                                                 $ *
16  * $Author::                                                          $ *
17  * -------------------------------------------------------------------- *
18  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
19  * Copyright (c) 2009 - 2012 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 // Setup all
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,
49 PRIMARY KEY (`id`),
50 INDEX (`userid`),
51 INDEX (`cat_id`)",
52         'User->category connection data');
53
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`),
91 INDEX (`refid`),
92 INDEX `status_mails` (`status`, `max_mails`)",
93         'Main user data');
94
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 NOT NULL DEFAULT 0,
100 `points` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000,
101 `locked_points` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000,
102 PRIMARY KEY (`id`),
103 INDEX (`userid`)",
104         'User points (no used points)');
105
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',
112 PRIMARY KEY (`id`),
113 INDEX (`userid`),
114 INDEX (`stats_id`)",
115         'Unconfirmed mails per user');
116
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',
132 PRIMARY KEY (`id`),
133 INDEX (`userid`),
134 INDEX (`cat_id`),
135 INDEX (`payment_id`),
136 INDEX (`pool_id`)",
137         'Mail statistics per user order');
138
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,
146 PRIMARY KEY (`id`),
147 INDEX (`userid`),
148 INDEX (`stats_type`)",
149         'Member statistics data');
150
151 // Admin menu
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&ouml;schen', 'L&ouml;schen Sie hier Mitglied, die gegen die AGBs mehrmals verstossen haben. Bitte seien Sie nett zu Ihren Mitgliedern und l&ouml;schen Sie nicht gleich.', 1);
154 addAdminMenuSql('user', 'lock_user', 'Mitglied sperren / entsperren', 'Sperren Sie Mitglied, die zu viele unbest&auml;tigte Mails haben oder gegen Ihre AGBs verstossen haben &uuml;ber diesen Men&uuml;punkt.', 3);
155 addAdminMenuSql('user', 'list_user', 'Mitglieder auflisten', 'Listen Sie alle Mitglied oder eingeschr&auml;nkt nach Suchkritieren Ihre Userdatenbank auf. Sie k&ouml;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&ouml;nnen dazu auch einen Kommentar mitsenden.', 5);
157 addAdminMenuSql('user', 'edit_user', 'Account editieren', 'Daten eines Mitglieder-Accountes &auml;ndern.', 6);
158 addAdminMenuSql('user', 'list_refs', 'Referrals anzeigen', 'Mit diesem Men&uuml;punkt k&ouml;nnen Sie die generierten Referrals eines Mitgliedes auflisten.', 7);
159 addAdminMenuSql('user', 'list_links', 'Unbest&auml;tigte Mails', 'Mit diesem Men&uuml;punkt k&ouml;nnen Sie die vom Mitglied nicht best&auml;tigten Mails anzeigen.', 8);
160 addAdminMenuSql('user', 'list_user_cats', 'Kategorien anzeigen', 'Listet die ausgew&auml;hlten Kategorien eines Mitgliedes auf.', 9);
161
162 // [EOF]
163 ?>