Added update_year.sh (still not fully flexible) and updated all years with it.
[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  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
14  * Copyright (c) 2009 - 2015 by Mailer Developer Team                   *
15  * For more information visit: http://mxchange.org                      *
16  *                                                                      *
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.                                  *
21  *                                                                      *
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.                         *
26  *                                                                      *
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,               *
30  * MA  02110-1301  USA                                                  *
31  ************************************************************************/
32
33 // Some security stuff...
34 if (!defined('__SECURITY')) {
35         die();
36 } // END - if
37
38 // Setup all
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,
44 PRIMARY KEY (`id`),
45 INDEX (`userid`),
46 INDEX (`cat_id`)",
47         'User->category connection data');
48
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`),
86 INDEX (`refid`),
87 INDEX `status_mails` (`status`, `max_mails`)",
88         'Main user data');
89
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,
97 PRIMARY KEY (`id`),
98 INDEX (`userid`)",
99         'User points (no used points)');
100
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',
107 PRIMARY KEY (`id`),
108 INDEX (`userid`),
109 INDEX (`stats_id`)",
110         'Unconfirmed mails per user');
111
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',
127 PRIMARY KEY (`id`),
128 INDEX (`userid`),
129 INDEX (`cat_id`),
130 INDEX (`payment_id`),
131 INDEX (`pool_id`)",
132         'Mail statistics per user order');
133
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,
141 PRIMARY KEY (`id`),
142 INDEX (`userid`),
143 INDEX (`stats_type`)",
144         'Member statistics data');
145
146 // Admin menu
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&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);
149 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);
150 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);
151 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);
152 addAdminMenuSql('user', 'edit_user', 'Account editieren', 'Daten eines Mitgliedaccountes &auml;ndern.', 6);
153 addAdminMenuSql('user', 'list_refs', 'Referrals anzeigen', 'Mit diesem Men&uuml;punkt k&ouml;nnen Sie die generierten Referrals eines Mitgliedes auflisten.', 7);
154 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);
155 addAdminMenuSql('user', 'list_user_cats', 'Kategorien anzeigen', 'Listet die ausgew&auml;hlten Kategorien eines Mitgliedes auf.', 9);
156
157 // Add dependency to ext-other as pool-user requires it
158 addExtensionDependency('other');
159
160 // [EOF]
161 ?>