X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fextensions%2Fext-debug.php;h=886c13554816aef3bea08341631c74e8ffc2da47;hp=8339bd4482d99daf12a7207b552a18bee9ad1410;hb=1e6d7b906ac9481fc5120d7a1a5e6a4d7a509296;hpb=aa106991e88b0dab33bf2a2d2409638e26a4c656 diff --git a/inc/extensions/ext-debug.php b/inc/extensions/ext-debug.php index 8339bd4482..886c135548 100644 --- a/inc/extensions/ext-debug.php +++ b/inc/extensions/ext-debug.php @@ -52,9 +52,11 @@ case "register": // Do stuff when installation is running (modules.php?module=ad // Table for debug log entries $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_debug_log`"; $SQLs[] = "CREATE TABLE `"._MYSQL_PREFIX."_debug_log` ( -`id` BIGINT(20) NOT NULL AUTO_INCREMENT, -`sender_id` BIGINT(20) NOT NULL DEFAULT 0, +`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, +`sender_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `timestamp` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00', +`file` VARCHAR(255) NOT NULL DEFAULT '', +`line` MEDIUMINT NOT NOT NULL DEFAULT 0, `message` LONGTEXT, `comment` TINYTEXT, `status` ENUM('NEW','PENDING','ACCEPTED','FIXED','INVALID','DUBLICATE','SPAM') NOT NULL DEFAULT 'NEW', @@ -66,8 +68,8 @@ PRIMARY KEY (`id`) // Table against debug log abuse $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_debug_log_abuse`"; $SQLs[] = "CREATE TABLE `"._MYSQL_PREFIX."_debug_log_abuse` ( -`id` BIGINT(20) NOT NULL AUTO_INCREMENT, -`client_id` BIGINT(20) NOT NULL DEFAULT 0, +`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, +`client_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `timestamp` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00', `raw_data` LONGTEXT, `inserted` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, @@ -78,13 +80,13 @@ PRIMARY KEY (`id`) // Table on relay/server for client exchanges $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_debug_client`"; $SQLs[] = "CREATE TABLE `"._MYSQL_PREFIX."_debug_client` ( -`id` BIGINT(20) NOT NULL AUTO_INCREMENT, +`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `key` VARCHAR(255) NOT NULL DEFAULT 'SELF', `url` VARCHAR(255) NOT NULL DEFAULT '', `webmaster` VARCHAR(255) NOT NULL DEFAULT '', `title` VARCHAR(255) NOT NULL DEFAULT '', `status` ENUM('ACTIVE','NEW','PENDING','LOCKED','DELETED','SPAM') NOT NULL DEFAULT 'PENDING', -`type` ENUM ('CLIENT','RELAY') NOT NULL DEFAULT 'CLIENT', +`type` ENUM ('CLIENT','RELAY','SERVER') NOT NULL DEFAULT 'CLIENT', `inserted` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, `lock_spam_reason` TINYTEXT, UNIQUE (`key`), @@ -93,14 +95,14 @@ PRIMARY KEY (`id`) ) TYPE=MyISAM COMMENT='Debug clients'"; // Add this exchange as first client - $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_debug_client` (`url`,`title`,`webmaster`,`status`) VALUES ('".URL."','".MAIN_TITLE."','".WEBMASTER."','ACTIVE')"; + $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_debug_client` (`url`,`title`,`webmaster`,`status`) VALUES ('{!URL!}','{!MAIN_TITLE!}','{!WEBMASTER!}','ACTIVE')"; // Table for debug log <-> client connection $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_debug_client_log`"; $SQLs[] = "CREATE TABLE `"._MYSQL_PREFIX."_debug_client_log` ( -`id` BIGINT(20) NOT NULL AUTO_INCREMENT, -`client_id` BIGINT(20) NOT NULL DEFAULT 1, -`log_id` BIGINT(20) NOT NULL DEFAULT 0, +`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, +`client_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 1, +`log_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, INDEX `client_log` (`client_id`,`log_id`), UNIQUE (`log_id`), PRIMARY KEY (`id`) @@ -111,7 +113,7 @@ PRIMARY KEY (`id`) $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_guest_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('debug','debug_info','Informationen','Y','Y',1)"; $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_guest_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('debug','debug_reg','Anmeldung','Y','Y',2)"; $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_guest_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('debug','debug_unreg','Abmeldung','Y','Y',3)"; - $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_guest_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('debug','debug_pilory','Pranger','Y','Y',4)"; + $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_guest_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('debug','debug_pilory','Spam-Pranger','Y','Y',4)"; // Admin menu $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('debug',NULL,'Debug-System','Verwalten Sie hier komfortabel das debug.log, welches sich im Verzeichnis inc/cache/ befindet.',10)"; @@ -122,12 +124,13 @@ PRIMARY KEY (`id`) $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('debug','config_debug','Einstellungen','Ändern Sie hier alle Einstellungen, wie auch den Debug-Modus - ob Client, Hub oder selber Server sein. Lesen Sie dazu die Anleitung unter DOCs/de/debug/README.txt durch! Oder kommen Sie in's Forum. Das Team von MXChange.org hilft Ihnen gerne weiter.',5)"; // Config entries - $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `debug_id` BIGINT(20) NOT NULL DEFAULT 0"; + $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `debug_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `debug_key` VARCHAR(255) NOT NULL DEFAULT ''"; $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `debug_mode` ENUM('CLIENT','RELAY','SERVER') NOT NULL DEFAULT 'CLIENT'"; $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `debug_new_log` ENUM('ACCEPT','FIRST','REG') NOT NULL DEFAULT 'FIRST'"; $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `debug_new_client` ENUM('ACTIVE','NEW','REG') NOT NULL DEFAULT 'NEW'"; - $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `debug_reject_log` BIGINT(20) NOT NULL DEFAULT ".($_CONFIG['one_day'] * 30).""; + $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `debug_reject_log` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('one_day') * 30).""; + $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `debug_master_url` VARCHAR(255) NOT NULL DEFAULT '{!SERVER_URL!}'"; break; case "remove": // Do stuff when removing extension @@ -162,13 +165,13 @@ case "update": // Update an extension } break; +case "test": // For testing purposes. For details see file inc/modules/admin/what-extensions.php, arround line 305. + break; + default: // Do stuff when extension is loaded break; } -// Language file prefix -$EXT_LANG_PREFIX = "debug"; - // Keep this extension always active! $EXT_ALWAYS_ACTIVE = "Y";