id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
cat_id BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
subject VARCHAR(255) NOT NULL DEFAULT '',
-text LONGBLOB NOT NULL,
-receivers LONGBLOB NOT NULL,
+text LONGTEXT NOT NULL,
+receivers LONGTEXT NOT NULL,
points BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
time TINYINT(3) UNSIGNED NOT NULL DEFAULT 0,
data_type ENUM('NEW','QUEUE','SEND') NOT NULL DEFAULT 'NEW',
ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD bonus_order FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000");
ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD bonus_ref FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000");
ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD bonus_stats FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000");
- ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_stats` ADD is_stats ENUM('Y','N') NOT NULL DEFAULT 'N'");
// Update notes (these will be set as task text!)
EXT_SET_UPDATE_NOTES("Bonus-{!POINTS!} für: Mailbestellung, Referal-Werbung (bei Best. der EMail-Adresse) und wenn 100% Klickrate jeder Mailbuchung erreicht wurde.<br />Template <u>admin_config_bonus_pro.tpl</u> ist überflüssig geworden. Bitte löschen Sie dies!<br />Eingestellte Bonus-{!POINTS!} für Rank 2 war um eins verschoben.");
userid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
holiday_start VARCHAR(10) NOT NULL DEFAULT 0,
holiday_end VARCHAR(10) NOT NULL DEFAULT 0,
-comments LONGBLOB NOT NULL,
+comments LONGTEXT NOT NULL,
KEY (userid),
PRIMARY KEY(id)
) TYPE={!_TABLE_TYPE!}");
break;
case "0.1.5": // SQL queries for v0.1.5
- ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_payouts` ADD target_url LONGBLOB NOT NULL");
- ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_payouts` ADD banner_url LONGBLOB NOT NULL");
+ ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_payouts` ADD target_url LONGTEXT NOT NULL");
+ ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_payouts` ADD banner_url LONGTEXT NOT NULL");
ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_payouts` ADD link_text VARCHAR(30) NOT NULL DEFAULT ''");
ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_payout_types` ADD allow_url ENUM('Y','N') NOT NULL DEFAULT 'N'");
break;
id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
admin_id BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
title VARCHAR(255) NOT NULL DEFAULT '',
-descr LONGBLOB NOT NULL,
+descr LONGTEXT NOT NULL,
template VARCHAR(255) NOT NULL DEFAULT '',
start_time VARCHAR(10) NOT NULL DEFAULT 0,
end_time VARCHAR(10) NOT NULL DEFAULT 0,
rallye_id BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
price_level BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
points BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
-info LONGBLOB NOT NULL,
+info LONGTEXT NOT NULL,
KEY (rallye_id),
PRIMARY KEY(id)
) TYPE={!_TABLE_TYPE!}");
campaign_expired ENUM('Y','N') NOT NULL DEFAULT 'N',
campaign_locked ENUM('Y','N') NOT NULL DEFAULT 'Y',
campaign_ended VARCHAR(10) NOT NULL DEFAULT 0,
-locked_reason TINYBLOB,
+locked_reason TINYTEXT,
locked_timestamp VARCHAR(10) NOT NULL DEFAULT 0,
status ENUM('PENDING','ACTIVE','LOCKED') NOT NULL DEFAULT 'PENDING',
KEY(aid),
ADD_EXT_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_admin_menu_las`");
ADD_EXT_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_admin_menu_las_data`");
ADD_EXT_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_admin_menu_stats`");
- ADD_EXT_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_stats_data`");
- ADD_EXT_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_book`");
ADD_EXT_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_filters`");
// Delete admin menu entries
/* @TODO SQL_ALTER_TABLE() should work now properly
ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_extensions` DROP UNIQUE KEY `ext_name`");
ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_admins` DROP UNIQUE KEY `login`");
- ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` DROP INDEX `status`");
ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_refbanner` DROP INDEX `visible`");
ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_refdepths` DROP UNIQUE KEY `level`");
ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_refsystem` DROP INDEX `level`");
ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_task_system` DROP FULLTEXT `subject`");
ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_task_system` DROP INDEX `subject`");
ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_extensions` DROP INDEX `ext_active`");
- ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` DROP INDEX `status`");
- ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` DROP FULLTEXT `family`");
- ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` DROP INDEX `max_mails`");
- ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` DROP INDEX `password`");
ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_guest_menu` DROP INDEX `action`");
ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_guest_menu` DROP INDEX `what`");
ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_guest_menu` DROP INDEX `sort`");
ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_payments` CHANGE payment payment FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000");
ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_payments` CHANGE price price FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000");
- ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` CHANGE used_points used_points FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000");
- ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_points` CHANGE points points FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000");
- ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_points` CHANGE locked_points locked_points FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000");
-
// Update notes (these will be set as task text!)
EXT_SET_UPDATE_NOTES("5 Nachkommastellen implementiert");
break;
break;
case "0.2.5": // SQL queries for v0.2.5
- ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` CHANGE receive_mails receive_mails BIGINT(20) UNSIGNED NOT NULL DEFAULT 0");
- ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` CHANGE max_mails max_mails BIGINT(20) UNSIGNED NOT NULL DEFAULT 0");
-
// Update notes (these will be set as task text!)
EXT_SET_UPDATE_NOTES("Spalten <u>max_mails</u> und <u>receive_mails</u> auf BIGINT(20) gesetzt.");
break;
break;
case "0.2.8": // SQL queries for v0.2.8
- ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD last_login VARCHAR(10) NOT NULL DEFAULT 0");
-
// Update notes (these will be set as task text!)
- EXT_SET_UPDATE_NOTES("Letzter Login wird gespeichert, Cache wird bei installierter Cache-Erweiterung bei Sprachenänderung aufgefrischt.");
+ EXT_SET_UPDATE_NOTES("Nicht mehr gültiges Update.");
break;
case "0.2.9": // SQL queries for v0.2.9
case "0.3.1": // SQL queries for v0.3.1
ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_extensions` ADD UNIQUE KEY (ext_name)");
ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_admins` ADD UNIQUE KEY (login)");
- ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD INDEX (status)");
ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_refbanner` ADD INDEX (visible)");
ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_refdepths` ADD UNIQUE KEY (level)");
ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_refsystem` ADD INDEX (level)");
ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_task_system` ADD FULLTEXT (subject)");
ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_task_system` ADD INDEX (subject)");
ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_extensions` ADD INDEX (ext_active)");
- ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD INDEX (status)");
- ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD FULLTEXT (family)");
- ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD INDEX (max_mails)");
- ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD INDEX (password)");
ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_guest_menu` ADD INDEX (action)");
ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_guest_menu` ADD INDEX (what)");
ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_guest_menu` ADD INDEX (sort)");
case "0.3.6": // SQL queries for v0.3.6
ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD salt_length TINYINT(3) UNSIGNED NOT NULL DEFAULT '9'");
ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD pass_scramble VARCHAR(255) NOT NULL DEFAULT ''");
- ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` MODIFY password VARCHAR(255) NOT NULL DEFAULT ''");
- ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` MODIFY user_hash VARCHAR(255) NOT NULL DEFAULT ''");
ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_admins` MODIFY password VARCHAR(255) NOT NULL DEFAULT ''");
ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD rand_no BIGINT(20) UNSIGNED NOT NULL DEFAULT 0");
ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD file_hash VARCHAR(255) NOT NULL DEFAULT ''");
break;
case "0.4.1": // SQL queries for v0.4.1
- ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` DROP INDEX `status`");
- ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD INDEX `status_mails` (`status`,`max_mails`)");
ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `show_timings` ENUM ('Y','N') NOT NULL DEFAULT 'Y'");
// Update notes (these will be set as task text!)
break;
case "0.4.6": // SQL queries for v0.4.6
- ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD gender ENUM ('M','F') NOT NULL DEFAULT 'M'");
- // @DEPRECATED ADD_EXT_SQL("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET gender=sex WHERE sex != 'M'");
- // @DEPRECATED ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` DROP sex");
-
// Update notes (these will be set as task text!)
- EXT_SET_UPDATE_NOTES("Offensives Wort "Sex" gegen "Gender" ausgetauscht.");
+ EXT_SET_UPDATE_NOTES("Nicht mehr gültiges Update.");
break;
case "0.4.7": // SQL queries for v0.4.7
break;
case "0.4.9": // SQL queries for v0.4.9
- ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` CHANGE `user_hash` `user_hash` VARCHAR(255) NULL DEFAULT NULL");
- ADD_EXT_SQL("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET user_hash=NULL WHERE user_hash IS NOT NULL AND `status`='CONFIRMED'");
- ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD UNIQUE (`user_hash`)");
-
// Update notes (these will be set as task text!)
- EXT_SET_UPDATE_NOTES("User-Hash zum Bestätigen wird auf NULL gesetzt, wenn Account bestätigt wird.");
+ EXT_SET_UPDATE_NOTES("Nicht mehr gültiges Update.");
break;
case "0.5.0": // SQL queries for v0.5.0
break;
case "0.5.6": // SQL queries for v0.5.6
- ADD_EXT_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_stats_data`");
- ADD_EXT_SQL("CREATE TABLE `{!_MYSQL_PREFIX!}_user_stats_data` (
-`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
-`userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
-`stats_type` VARCHAR(255) NOT NULL DEFAULT 'unknown',
-`stats_data` VARCHAR(255) NOT NULL DEFAULT '',
-`inserted` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
-PRIMARY KEY(`id`),
-INDEX (`userid`),
-INDEX (`stats_type`)
-) TYPE={!_TABLE_TYPE!} COMMENT='Member statistics data'");
-
// Update notes (these will be set as task text!)
- EXT_SET_UPDATE_NOTES("Mitglieder könnnen nun z.B. in den Mail-Details zu jeder Mail sehen, wann sie diese bestätigt haben. Die neue Statistik-Tabelle ist aber universell einsetzbar.");
+ EXT_SET_UPDATE_NOTES("Nicht mehr gültiges Update.");
break;
case "0.5.7": // SQL queries for v0.5.7
break;
case "0.6.1": // SQL queries for v0.6.1
- ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` DROP login_failtures");
- ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` DROP last_failture");
- ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD login_failures BIGINT(20) UNSIGNED NOT NULL DEFAULT 0");
- ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD last_failure TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00'");
-
// Update notes (these will be set as task text!)
- EXT_SET_UPDATE_NOTES("Falsche Schreibweise korregiert.");
+ EXT_SET_UPDATE_NOTES("Nicht mehr gültiges Update.");
break;
case "0.6.2": // SQL queries for v0.6.2
switch ($EXT_LOAD_MODE)
{
case "register": // Do stuff when installation is running (modules.php?module=admin&action=login is called)
- ADD_EXT_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}user_cats`");
- ADD_EXT_SQL("CREATE TABLE `{!_MYSQL_PREFIX!}user_cats` (
+ ADD_EXT_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_cats`");
+ ADD_EXT_SQL("CREATE TABLE `{!_MYSQL_PREFIX!}_user_cats` (
`id` BIGINT(22) NOT NULL AUTO_INCREMENT,
`userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`cat_id` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
INDEX (`userid`),
INDEX (`cat_id`)
-) TYPE={!type!}");
+) TYPE={!_TABLE_TYPE!}");
- ADD_EXT_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}user_data`");
- ADD_EXT_SQL("CREATE TABLE `{!_MYSQL_PREFIX!}user_data` (
+ ADD_EXT_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_data`");
+ ADD_EXT_SQL("CREATE TABLE `{!_MYSQL_PREFIX!}_user_data` (
`userid` BIGINT(22) NOT NULL AUTO_INCREMENT,
`surname` VARCHAR(255) NOT NULL DEFAULT '',
`family` VARCHAR(255) NOT NULL DEFAULT '',
`birth_day` CHAR(2) NOT NULL DEFAULT '01',
`birth_month` CHAR(2) NOT NULL DEFAULT '01',
`birth_year` VARCHAR(4) NOT NULL DEFAULT '1970',
- `password` VARCHAR(32) NOT NULL DEFAULT '',
- `max_mails` INT(7) NOT NULL DEFAULT 0,
- `receive_mails` INT(7) NOT NULL DEFAULT 0,
+ `password` VARCHAR(255) NOT NULL DEFAULT '',
+ `max_mails` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+ `receive_mails` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`refid` BIGINT(22) NOT NULL DEFAULT 0,
`status` ENUM('UNCONFIRMED','CONFIRMED','LOCKED') NOT NULL DEFAULT 'UNCONFIRMED',
- `user_hash` VARCHAR(32) NOT NULL DEFAULT '',
+ `user_hash` VARCHAR(255) NULL DEFAULT NULL,
`REMOTE_ADDR` VARCHAR(15) NOT NULL DEFAULT '0.0.0.0',
`last_online` VARCHAR(10) NOT NULL DEFAULT 0,
`last_module` VARCHAR(255) NOT NULL DEFAULT '',
`ref_clicks` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`total_logins` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`gender` ENUM('M','F') NOT NULL DEFAULT 'M',
- `used_points` FLOAT(22,3) NOT NULL DEFAULT '0.000',
+ `used_points` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000,
`emails_sent` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`joined` VARCHAR(10) NOT NULL DEFAULT 0,
`last_update` VARCHAR(10) NOT NULL DEFAULT 0,
`last_profile_sent` VARCHAR(10) NOT NULL DEFAULT 0,
`notified` ENUM('Y','N') NOT NULL DEFAULT 'N',
`ref_payout` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0,
+ `last_login` VARCHAR(10) NOT NULL DEFAULT 0,
+ `login_failures` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+ `last_failure` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`userid`),
-INDEX (`refid`)
-) TYPE={!type!}");
+UNIQUE (`user_hash`),
+INDEX (`refid`),
+INDEX `status_mails` (`status`,`max_mails`)
+) TYPE={!_TABLE_TYPE!}");
- ADD_EXT_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}user_points`");
- ADD_EXT_SQL("CREATE TABLE `{!_MYSQL_PREFIX!}user_points` (
+ ADD_EXT_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_points`");
+ ADD_EXT_SQL("CREATE TABLE `{!_MYSQL_PREFIX!}_user_points` (
`id` BIGINT(22) NOT NULL AUTO_INCREMENT,
`userid` BIGINT(22) NOT NULL DEFAULT 0,
`ref_depth` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0,
- `points` FLOAT(22,3) NOT NULL DEFAULT '0.000',
- `locked_points` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+ `points` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000,
+ `locked_points` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000,
PRIMARY KEY (`id`),
INDEX (`userid`)
-) TYPE={!type!}");
+) TYPE={!_TABLE_TYPE!}");
- ADD_EXT_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}user_links`");
- ADD_EXT_SQL("CREATE TABLE `{!_MYSQL_PREFIX!}user_links` (
+ ADD_EXT_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_links`");
+ ADD_EXT_SQL("CREATE TABLE `{!_MYSQL_PREFIX!}_user_links` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`stats_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
INDEX (`userid`),
INDEX (`stats_id`)
-) TYPE={!type!}");
+) TYPE={!_TABLE_TYPE!}");
- ADD_EXT_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}user_stats`");
- ADD_EXT_SQL("CREATE TABLE `{!_MYSQL_PREFIX!}user_stats` (
+ ADD_EXT_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_stats`");
+ ADD_EXT_SQL("CREATE TABLE `{!_MYSQL_PREFIX!}_user_stats` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`cat_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`payment_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`subject` VARCHAR(200) NOT NULL DEFAULT '',
- `url` TINYBLOB NOT NULL,
+ `url` TINYTEXT NOT NULL,
`max_rec` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`timestamp_ordered` VARCHAR(10) NOT NULL DEFAULT '',
`pool_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`timestamp_sstart` VARCHAR(10) NOT NULL DEFAULT '',
`timestamp_send` VARCHAR(10) NOT NULL DEFAULT '',
- BIGINT(20) UNSIGNED NOT NULL,
+ `is_stats` ENUM('Y','N') NOT NULL DEFAULT 'N',
PRIMARY KEY (`id`),
INDEX (`userid`),
INDEX (`cat_id`),
INDEX (`payment_id`),
INDEX (`pool_id`)
-) TYPE={!type!}");
+) TYPE={!_TABLE_TYPE!}");
+
+ ADD_EXT_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_stats_data`");
+ ADD_EXT_SQL("CREATE TABLE `{!_MYSQL_PREFIX!}_user_stats_data` (
+`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+`userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`stats_type` VARCHAR(255) NOT NULL DEFAULT 'unknown',
+`stats_data` VARCHAR(255) NOT NULL DEFAULT '',
+`inserted` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
+PRIMARY KEY(`id`),
+INDEX (`userid`),
+INDEX (`stats_type`)
+) TYPE={!_TABLE_TYPE!} COMMENT='Member statistics data'");
// Admin menu
ADD_EXT_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('user',NULL,'Mitglieder-Management','Mitglieder freischalten, sperren, Accounts editieren, Neuanmeldungen verwalten, {!POINTS!} gutschreiben und abziehen und und und...',3)");
// SQL commands to run
ADD_EXT_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what` IN('config_user','user_contct','list_user_del') OR `action`='user'");
ADD_EXT_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_del`");
- ADD_EXT_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}user_cats`");
- ADD_EXT_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}user_data`");
- ADD_EXT_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}user_points`");
- ADD_EXT_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}user_links`");
- ADD_EXT_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}user_stats`");
+ ADD_EXT_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_cats`");
+ ADD_EXT_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_data`");
+ ADD_EXT_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_points`");
+ ADD_EXT_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_links`");
+ ADD_EXT_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_stats`");
+ ADD_EXT_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_stats_data`");
break;
case "activate": // Do stuff when admin activates this extension
}
// Shall I test for a main or sub menu? (action or what?)
- $lines = 0; $acl_mode = "failed";
+ $acl_mode = "failed";
if (GET_EXT_VERSION("cache") >= "0.1.2") {
- // Load only from array when there are lines!
- if ((isset($GLOBALS['cache_array']['admin_acls'])) && (is_array($GLOBALS['cache_array']['admin_acls'])) && (count($GLOBALS['cache_array']['admin_acls']) > 0)) {
- // Load ACL from array
- foreach ($GLOBALS['cache_array']['admin_acls']['admin_id'] as $id => $aid_acls) {
- if ($aid == $aid_acls) {
- // Okay, one line was found!
- if ((!empty($act)) && ($GLOBALS['cache_array']['admin_acls']['action_menu'][$id] == $act)) {
- // Main menu line found
- $acl_mode = $GLOBALS['cache_array']['admin_acls']['access_mode'][$id];
- $lines = 1;
- }
- elseif ((!empty($wht)) && ($GLOBALS['cache_array']['admin_acls']['what_menu'][$id] == $wht)) {
- // Check sub menu
- $acl_mode = $GLOBALS['cache_array']['admin_acls']['access_mode'][$id];
- $lines = 1;
- }
- if ($lines == 1) {
- // Count cache hits
- incrementConfigEntry('cache_hits');
- break;
- }
- }
- }
-
- // No ACL found?
- if ($acl_mode == "failed") {
- $acl_mode = "";
- $lines = 0;
- }
- } else {
- // No lines here
- $lines = 0;
+ // Lookup in cache
+ if ((!empty($act)) && (isset($GLOBALS['cache_array']['admin_acls']['action_menu'][$aid])) & ($GLOBALS['cache_array']['admin_acls']['action_menu'][$aid] == $act)) {
+ // Main menu line found
+ $acl_mode = $GLOBALS['cache_array']['admin_acls']['access_mode'][$aid];
+
+ // Count cache hits
+ incrementConfigEntry('cache_hits');
+ } elseif ((!empty($wht)) && (isset($GLOBALS['cache_array']['admin_acls']['what_menu'][$aid])) && ($GLOBALS['cache_array']['admin_acls']['what_menu'][$aid] == $wht)) {
+ // Check sub menu
+ $acl_mode = $GLOBALS['cache_array']['admin_acls']['access_mode'][$aid];
+
+ // Count cache hits
+ incrementConfigEntry('cache_hits');
}
} else {
// Old version, so load it from database
- if (!empty($act))
- {
+ if (!empty($act)) {
// Main menu
$result = SQL_QUERY_ESC("SELECT access_mode FROM `{!_MYSQL_PREFIX!}_admins_acls` WHERE admin_id=%s AND action_menu='%s' LIMIT 1",
- array(bigintval($aid), $act), __FUNCTION__, __LINE__);
+ array(bigintval($aid), $act), __FUNCTION__, __LINE__);
} elseif (!empty($wht)) {
// Sub menu
$result = SQL_QUERY_ESC("SELECT access_mode FROM `{!_MYSQL_PREFIX!}_admins_acls` WHERE admin_id=%s AND what_menu='%s' LIMIT 1",
- array(bigintval($aid), $wht), __FUNCTION__, __LINE__);
+ array(bigintval($aid), $wht), __FUNCTION__, __LINE__);
}
- // Get number of lines
- $lines = SQL_NUMROWS($result);
+ // Is an entry found?
+ if (SQL_NUMROWS($result) == 1) {
+ // Load ACL
+ list($acl_mode) = SQL_FETCHROW($result);
+ } // END - if
- // Load ACL
- list($acl_mode) = SQL_FETCHROW($result);
+ // Free memory
SQL_FREERESULT($result);
}
// Check ACL and (maybe) allow
- if ((($default == "allow") && ($lines == 0)) || (($default == "deny") && ($lines == "1") && ($acl_mode == "allow")) || (($lines == 0) && ($parent))) $ret = true;
+ if (($default == "allow") || (($default == "deny") && ($acl_mode == "allow")) || ($parent === true)) {
+ // Access is granted
+ $ret = true;
+ } // END - if
// Return value
return $ret;
$GLOBALS['cache_instance']->init("ADMINS_ACLS");
$GLOBALS['cache_instance']->storeExtensionVersion("admins");
- // Load all modules and their data
- $result = SQL_QUERY("SELECT id, admin_id, action_menu, what_menu, access_mode FROM `{!_MYSQL_PREFIX!}_admins_acls` ORDER BY admin_id, action_menu, what_menu", __FILE__, __LINE__);
+ // Load all modules and their data (column 'id' is no longer required)
+ $result = SQL_QUERY("SELECT admin_id, action_menu, what_menu, access_mode FROM `{!_MYSQL_PREFIX!}_admins_acls` ORDER BY admin_id, action_menu, what_menu", __FILE__, __LINE__);
// Add all rows
while ($data = SQL_FETCHARRAY($result)) {
// Check if the admin has submitted data or not
if ((IS_FORM_SENT()) && ((!REQUEST_ISSET_POST(('login'))) || (!REQUEST_ISSET_POST(('pass'))) || (strlen(REQUEST_POST('pass')) < 4))) {
REQUEST_SET_POST('ok', "***");
- }
+ } // END - if
if ((IS_FORM_SENT()) && (REQUEST_POST('ok') != "***")) {
// All required data was entered so we check his account