From: Roland Häder Date: Thu, 28 Aug 2008 23:32:16 +0000 (+0000) Subject: Surfbar now has admin menu (dummy extension!), menu system rebuilded for unique key... X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=commitdiff_plain;h=52690b87d4382bd4bc15905068ab99bb70b1e3c9 Surfbar now has admin menu (dummy extension!), menu system rebuilded for unique key on column 'what' --- diff --git a/inc/extensions/ext- b/inc/extensions/ext- index d714a3e593..ca956b8af3 100644 --- a/inc/extensions/ext- +++ b/inc/extensions/ext- @@ -81,8 +81,8 @@ case "update": // Update an extension break; default: // Do stuff when extension is loaded - $DUMMY = LOAD_CONFIG("0"); - unset($DUMMY); + $dummy = LOAD_CONFIG(); + unset($dummy); break; } diff --git a/inc/extensions/ext-admins.php b/inc/extensions/ext-admins.php index 3588605375..b721f0b8db 100644 --- a/inc/extensions/ext-admins.php +++ b/inc/extensions/ext-admins.php @@ -271,7 +271,7 @@ PRIMARY KEY (id) break; case "0.6.9": // SQL queries for v0.6.9 - $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET title = 'Admin-Management' WHERE action = 'admins' AND what='' LIMIT 1"; + $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET title = 'Admin-Management' WHERE action = 'admins' AND (what='' OR what IS NULL) LIMIT 1"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Verwaltung nach Management umbenannt."; diff --git a/inc/extensions/ext-holiday.php b/inc/extensions/ext-holiday.php index 8e121a3e08..454c67a062 100644 --- a/inc/extensions/ext-holiday.php +++ b/inc/extensions/ext-holiday.php @@ -210,7 +210,7 @@ case "update": // Update an extension break; case "0.2.0": // SQL queries for v0.2.0 - $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET title = 'Urlaubsmanagement' WHERE action = 'holiday' AND what='' LIMIT 1"; + $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET title = 'Urlaubsmanagement' WHERE action = 'holiday' AND (what='' OR what IS NULL) LIMIT 1"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Mitgliedsmenü komplett umgebaut."; diff --git a/inc/extensions/ext-mods.php b/inc/extensions/ext-mods.php index 676eaef3f7..6911f805b0 100644 --- a/inc/extensions/ext-mods.php +++ b/inc/extensions/ext-mods.php @@ -105,7 +105,7 @@ case "update": // Update an extension break; case "0.0.8": // SQL queries for v0.0.8 - $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET title = 'Modul-Management' WHERE action = 'mods' AND what='' LIMIT 1"; + $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET title = 'Modul-Management' WHERE action = 'mods' AND (what='' OR what IS NULL) LIMIT 1"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Verwaltung auf Management umgestellt."; diff --git a/inc/extensions/ext-payout.php b/inc/extensions/ext-payout.php index f3fad50154..a63a63332b 100644 --- a/inc/extensions/ext-payout.php +++ b/inc/extensions/ext-payout.php @@ -226,7 +226,7 @@ case "update": // Update an extension break; case "0.3.7": // SQL queries for v0.3.7 - $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET title = 'Auszahlungsmanagement' WHERE action = 'payouts' AND what='' LIMIT 1"; + $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET title = 'Auszahlungsmanagement' WHERE action = 'payouts' AND (what='' OR what IS NULL) LIMIT 1"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Verwaltung nach Management umgestellt."; diff --git a/inc/extensions/ext-sponsor.php b/inc/extensions/ext-sponsor.php index cec77cc1da..bfdc4542c5 100644 --- a/inc/extensions/ext-sponsor.php +++ b/inc/extensions/ext-sponsor.php @@ -427,11 +427,9 @@ case "update": // Update an extension break; default: // Do stuff when extension is loaded - $result_user = SQL_QUERY("SELECT * FROM "._MYSQL_PREFIX."_config WHERE config='0' LIMIT 1", __FILE__, __LINE__); - $DUMMY = SQL_FETCHARRAY($result_user); - $CONFIG['sponsor_min_points'] = $DUMMY['sponsor_min_points']; // Minimum points to order - $CONFIG['sponsor_ref_points'] = $DUMMY['sponsor_ref_points']; // Additional points when a sponsor brings you another sponsor - unset($DUMMY); + $dummy = LOAD_CONFIG(); + $_CONFIG = array_merge($_CONFIG, $dummy); + unset($dummy); break; } diff --git a/inc/extensions/ext-sql_patches.php b/inc/extensions/ext-sql_patches.php index 471300b250..6f7696923a 100644 --- a/inc/extensions/ext-sql_patches.php +++ b/inc/extensions/ext-sql_patches.php @@ -38,13 +38,13 @@ if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF']))) { } // Version number -$EXT_VERSION = "0.4.3"; +$EXT_VERSION = "0.4.4"; // Auto-set extension version if (!isset($EXT_VER)) $EXT_VER = $EXT_VERSION; // Version history array (add more with , "0.1" and so on) -$EXT_VER_HISTORY = array("0.0", "0.0.1", "0.0.2", "0.0.3", "0.0.4", "0.0.5", "0.0.6", "0.0.7", "0.0.8", "0.0.9", "0.1.0", "0.1.1", "0.1.2", "0.1.3", "0.1.4", "0.1.5", "0.1.6", "0.1.7", "0.1.8", "0.1.9", "0.2.0", "0.2.1", "0.2.2", "0.2.3", "0.2.4", "0.2.5", "0.2.6", "0.2.7", "0.2.8", "0.2.9", "0.3.0", "0.3.1", "0.3.2", "0.3.3", "0.3.4", "0.3.5", "0.3.6", "0.3.7", "0.3.8", "0.3.9", "0.4.0", "0.4.1", "0.4.2", "0.4.3"); +$EXT_VER_HISTORY = array("0.0", "0.0.1", "0.0.2", "0.0.3", "0.0.4", "0.0.5", "0.0.6", "0.0.7", "0.0.8", "0.0.9", "0.1.0", "0.1.1", "0.1.2", "0.1.3", "0.1.4", "0.1.5", "0.1.6", "0.1.7", "0.1.8", "0.1.9", "0.2.0", "0.2.1", "0.2.2", "0.2.3", "0.2.4", "0.2.5", "0.2.6", "0.2.7", "0.2.8", "0.2.9", "0.3.0", "0.3.1", "0.3.2", "0.3.3", "0.3.4", "0.3.5", "0.3.6", "0.3.7", "0.3.8", "0.3.9", "0.4.0", "0.4.1", "0.4.2", "0.4.3", "0.4.4"); switch ($EXT_LOAD_MODE) { @@ -72,10 +72,10 @@ LIMIT 13"; $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_member_menu WHERE action='themes' OR what='themes' OR -(action='stats' AND what='') OR -(action='extras' AND what='') OR -(action='rals' AND what='') OR -(action='account' AND what='') LIMIT 7"; +(action='stats' AND (what='' OR what IS NULL)) OR +(action='extras' AND (what='' OR what IS NULL)) OR +(action='rals' AND (what='' OR what IS NULL)) OR +(action='account' AND (what='' OR what IS NULL)) LIMIT 7"; $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET action='main' WHERE action='stats' OR action='extras' OR @@ -509,7 +509,7 @@ PRIMARY KEY (id) break; case "0.4.0": // SQL queries for v0.4.0 - $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET title = 'Email-Management' WHERE action = 'email' AND what='' LIMIT 1"; + $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET title = 'Email-Management' WHERE action = 'email' AND (what='' OR what IS NULL) LIMIT 1"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Email-Verwaltung nach Email-Management umbenannt."; @@ -525,6 +525,9 @@ PRIMARY KEY (id) case "0.4.2": // SQL queries for v0.4.2 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_online` ADD INDEX `admin_member` (`is_admin`, `is_member`)"; + + // Update notes (these will be set as task text!) + $UPDATE_NOTES = "Neuen Schlüssel zur Online-Tabelle hinzugefügt."; break; case "0.4.3": // SQL queries for v0.4.3 @@ -533,6 +536,25 @@ PRIMARY KEY (id) $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `proxy_username` VARCHAR(255) NOT NULL DEFAULT ''"; $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `proxy_password` VARCHAR(255) NOT NULL DEFAULT ''"; $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (action, what, title, descr, sort) VALUES ('setup', 'config_proxy', 'Proxy-Einstellungen', 'Sollte Ihr Webserver sich hinter einem Proxy befinden, so können Sie hier MXChange so konfigurieren, dass es Updates durch diesen hindurch sucht!', 15)"; + + // Update notes (these will be set as task text!) + $UPDATE_NOTES = "Proxy-Einstellungen hinzugefügt."; + break; + + case "0.4.4": // SQL queries for v0.4.4 + $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_admin_menu` CHANGE `what` `what` VARCHAR(255) NULL DEFAULT NULL"; + $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_guest_menu` CHANGE `what` `what` VARCHAR(255) NULL DEFAULT NULL"; + $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_member_menu` CHANGE `what` `what` VARCHAR(255) NULL DEFAULT NULL"; + $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET what=NULL WHERE what=''"; + $SQLs[] = "UPDATE "._MYSQL_PREFIX."_guest_menu SET what=NULL WHERE what=''"; + $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET what=NULL WHERE what=''"; + $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_admin_menu` DROP INDEX `what`, ADD UNIQUE (`what`)"; + $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_guest_menu` DROP INDEX `what`, ADD UNIQUE (`what`)"; + $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_member_menu` ADD INDEX `action` (`action`)"; + $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_member_menu` DROP INDEX `what`, ADD UNIQUE (`what`)"; + + // Update notes (these will be set as task text!) + $UPDATE_NOTES = "Schlüssel in Admin-, Gast- und Mitgliedsmenü verbessert."; break; } break; diff --git a/inc/extensions/ext-surfbar.php b/inc/extensions/ext-surfbar.php index 8274e3d821..b3df4d9002 100644 --- a/inc/extensions/ext-surfbar.php +++ b/inc/extensions/ext-surfbar.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF']))) -{ +if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF']))) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } @@ -51,21 +50,56 @@ switch ($EXT_LOAD_MODE) { case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called) // SQL commands to run + $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_surfbar_urls`"; + $SQLs[] = "CREATE TABLE `"._MYSQL_PREFIX."_surfbar_urls` ( +`id` BIGINT(20) NOT NULL AUTO_INCREMENT, +`userid` BIGINT(20) NOT NULL DEFAULT '0', +`url` VARCHAR(255) NOT NULL DEFAULT '', +`reward` double(20,5) NOT NULL DEFAULT '0.00000', +`views_total` BIGINT(20) NOT NULL DEFAULT '0', +`status` ENUM('PENDING','CONFIRMED', 'LOCKED') NOT NULL DEFAULT 'CONFIRMED', +`registered` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, +`last_locked` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00', +`lock_reason` VARCHAR(255) NOT NULL DEFAULT '', +PRIMARY KEY(`id`), +UNIQUE KEY `userid_url` (`userid`, `url`) +) TYPE=MyISAM COMMENT='Surfbar URLs'"; + $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_surfbar_locks`"; + $SQLs[] = "CREATE TABLE `"._MYSQL_PREFIX."_surfbar_locks` ( +`id` BIGINT(20) NOT NULL AUTO_INCREMENT, +`userid` BIGINT(20) NOT NULL DEFAULT '0', +`url_id` BIGINT(20) NOT NULL DEFAULT '0', +`last_surfed` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, +PRIMARY KEY(`id`), +INDEX(`userid`), +INDEX(`url_id`) +) TYPE=MyISAM COMMENT='Surfbar reload locks'"; + $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES('extras','surfbar','Surfbar starten','Y','Y',5)"; + $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES('surfbar','','Surfbar','URLs in der Surfbar verwalten, Einstellungen ändern und vieles mehr.',7)"; + $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES('surfbar','surfbar_list_urls','URLs verwalten','Verwalten Sie hier alle in der Surfbar befindlichen URLs mit nur wenigen Klicks.',1)"; + $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES('surfbar','surfbar_unlock_urls','Surfbar URLs freigeben','Geben Sie hier nur direkt in der Surfbar gebuchte URLs frei.',2)"; + $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES('surfbar','config_surfbar','Einstellungen','Einstellungen an der Surfbar ändern, wie Festvergütung, prozentuale Ref-Vergütung und vieles mehr.',3)"; // Load CSS file? - $EXT_CSS = 'Y'; + $EXT_CSS = "Y"; break; case "remove": // Do stuff when removing extension // SQL commands to run + $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_surfbar_urls`"; + $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_surfbar_locks`"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `"._MYSQL_PREFIX."_member_menu` WHERE `what` = 'surfbar' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `"._MYSQL_PREFIX."_admin_menu` WHERE action='surfbar' LIMIT 4"; break; case "activate": // Do stuff when admin activates this extension // SQL commands to run + $SQLs[] = "UPDATE `"._MYSQL_PREFIX."_member_menu` SET `visible` = 'Y'`, `locked` = 'N' WHERE `what` = 'surfbar' LIMIT 1"; break; case "deactivate": // Do stuff when admin deactivates this extension // SQL commands to run + $SQLs[] = "UPDATE `"._MYSQL_PREFIX."_member_menu` SET `locked` = 'Y' WHERE `what` = 'surfbar' LIMIT 1"; break; case "update": // Update an extension @@ -81,8 +115,9 @@ case "update": // Update an extension break; default: // Do stuff when extension is loaded - $DUMMY = LOAD_CONFIG("0"); - unset($DUMMY); + $dummy = LOAD_CONFIG(); + $_CONFIG = array_merge($_CONFIG, $dummy); + unset($dummy); break; } diff --git a/inc/extensions/ext-user.php b/inc/extensions/ext-user.php index f96acbf5a7..17142d78a0 100644 --- a/inc/extensions/ext-user.php +++ b/inc/extensions/ext-user.php @@ -195,7 +195,7 @@ case "update": // Update an extension break; case "0.3.1": // SQL queries for v0.3.1 - $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET title = 'Mitglieder-Management' WHERE action = 'user' AND what='' LIMIT 1"; + $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET title = 'Mitglieder-Management' WHERE action = 'user' AND (what='' OR what IS NULL) LIMIT 1"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Verwaltung auf Management umgestellt"; diff --git a/inc/extensions/ext-yoomedia.php b/inc/extensions/ext-yoomedia.php index b34984bea3..0df7477429 100644 --- a/inc/extensions/ext-yoomedia.php +++ b/inc/extensions/ext-yoomedia.php @@ -83,8 +83,8 @@ case "update": // Update an extension break; default: // Do stuff when extension is loaded - $DUMMY = LOAD_CONFIG("0"); - unset($DUMMY); + $dummy = LOAD_CONFIG(); + unset($dummy); break; } diff --git a/inc/functions.php b/inc/functions.php index 7462021a9d..25ae3c78fc 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -1187,15 +1187,21 @@ function TRANSLATE_YESNO($yn) // Deprecated : $length // Optional : $DATA // -function GEN_RANDOM_CODE($length, $code, $uid, $DATA="") -{ +function GEN_RANDOM_CODE($length, $code, $uid, $DATA="") { global $_CONFIG; + // Fix missing _MAX constant + if (!defined('_MAX')) define('_MAX', 15235); + // Build server string $server = $_SERVER['PHP_SELF'].":".getenv('HTTP_USER_AGENT').":".getenv('SERVER_SOFTWARE').":".getenv('REMOTE_ADDR').":".":".filemtime(PATH."inc/databases.php"); // Build key string - $keys = SITE_KEY.":".DATE_KEY.":".$_CONFIG['secret_key'].":".$_CONFIG['file_hash'].":".date("d-m-Y (l-F-T)", $_CONFIG['patch_ctime']).":".$_CONFIG['master_salt']; + $keys = SITE_KEY.":".DATE_KEY; + if (isset($_CONFIG['secret_key'])) $keys .= ":".$_CONFIG['secret_key']; + if (isset($_CONFIG['file_hash'])) $keys .= ":".$_CONFIG['file_hash']; + $keys .= ":".date("d-m-Y (l-F-T)", $_CONFIG['patch_ctime']); + if (isset($_CONFIG['master_salt'])) $keys .= ":".$_CONFIG['master_salt']; // Build string from misc data $data = $code.":".$uid.":".$DATA; @@ -1211,11 +1217,19 @@ function GEN_RANDOM_CODE($length, $code, $uid, $DATA="") // Calculate number for generating the code $a = $code + _ADD - 1; - // Generate hash with master salt from modula of number with the prime number and other data - $saltedHash = generateHash(($a % _PRIME).":".$server.":".$keys.":".$data.":".date("d-m-Y (l-F-T)", time()).":".$a, $_CONFIG['master_salt']); + if (isset($_CONFIG['master_hash'])) { + // Generate hash with master salt from modula of number with the prime number and other data + $saltedHash = generateHash(($a % _PRIME).":".$server.":".$keys.":".$data.":".date("d-m-Y (l-F-T)", time()).":".$a, $_CONFIG['master_salt']); - // Create number from hash - $rcode = hexdec(substr($saltedHash, strlen($_CONFIG['master_salt']), 9)) / abs(_MAX - $a + sqrt(_ADD)) / pi(); + // Create number from hash + $rcode = hexdec(substr($saltedHash, strlen($_CONFIG['master_salt']), 9)) / abs(_MAX - $a + sqrt(_ADD)) / pi(); + } else { + // Generate hash with "hash of site key" from modula of number with the prime number and other data + $saltedHash = generateHash(($a % _PRIME).":".$server.":".$keys.":".$data.":".date("d-m-Y (l-F-T)", time()).":".$a, substr(sha1(SITE_KEY), 0, 8)); + + // Create number from hash + $rcode = hexdec(substr($saltedHash, 8, 9)) / abs(_MAX - $a + sqrt(_ADD)) / pi(); + } // At least 10 numbers shall be secure enought! $len = $_CONFIG['code_length']; diff --git a/inc/header.php b/inc/header.php index 704ffd2cff..aa9f78a6b7 100644 --- a/inc/header.php +++ b/inc/header.php @@ -55,7 +55,9 @@ if (($header != "1") && ($header != "2")) { $TITLE .= MAIN_TITLE; // Add title of module? (middle decoration will also be added!) - if (($_CONFIG['enable_mod_title'] == 'Y') || ((empty($GLOBALS['what'])) && (empty($GLOBALS['action']))) || ($GLOBALS['module'] == "admin")) $TITLE .= " ".trim($_CONFIG['title_middle'])." ".ADD_MODULE_TITLE($GLOBALS['module']); + if (isset($_CONFIG['enable_mod_title'])) { + if (($_CONFIG['enable_mod_title'] == 'Y') || ((empty($GLOBALS['what'])) && (empty($GLOBALS['action']))) || ($GLOBALS['module'] == "admin")) $TITLE .= " ".trim($_CONFIG['title_middle'])." ".ADD_MODULE_TITLE($GLOBALS['module']); + } // END - if // Add title from what file $MODE = ""; diff --git a/inc/libs/sponsor_functions.php b/inc/libs/sponsor_functions.php index e0c63d5316..6f43da5bb6 100644 --- a/inc/libs/sponsor_functions.php +++ b/inc/libs/sponsor_functions.php @@ -356,7 +356,7 @@ function GENERATE_SPONSOR_MENU($current) // Load main menu entries $result_main = SQL_QUERY("SELECT action, title FROM "._MYSQL_PREFIX."_sponsor_menu -WHERE what='' ".$WHERE." +WHERE (what='' OR what IS NULL) ".$WHERE." ORDER BY sort", __FILE__, __LINE__); if (SQL_NUMROWS($result_main) > 0) { diff --git a/inc/load_extensions.php b/inc/load_extensions.php index 82337575ee..75b0c422be 100644 --- a/inc/load_extensions.php +++ b/inc/load_extensions.php @@ -59,14 +59,12 @@ if (file_exists(PATH."inc/extensions/ext-sql_patches.php") && is_readable(PATH." // // Load extensions // -if (EXT_IS_ACTIVE("cache")) -{ +if (EXT_IS_ACTIVE("cache")) { // Load cache extension alone include_once(PATH."inc/libs/cache_functions.php"); $cacheMode = ""; include_once(PATH."inc/extensions/ext-cache.php"); - switch($cacheInstance->cache_file("extensions", true)) - { + switch($cacheInstance->cache_file("extensions", true)) { case true : $cacheMode = "load"; break; case false: $cacheMode = "init"; break; } @@ -80,8 +78,7 @@ if (EXT_IS_ACTIVE("cache")) $cacheMode = "no"; } -if ($cacheMode == "load") -{ +if ($cacheMode == "load") { // Load more cache files (like admins) require_once(PATH."inc/load_cache.php"); @@ -90,14 +87,12 @@ if ($cacheMode == "load") // Load extension data from cache file $EXT_DUMMY = $cacheInstance->cache_load(); - foreach ($EXT_DUMMY['ext_name'] as $k=>$name) - { + foreach ($EXT_DUMMY['ext_name'] as $k=>$name) { // Load functions file if ($EXT_DUMMY['ext_funcs'][$k] == 'Y') require_once(PATH."inc/libs/".$name."_functions.php"); // Load Language file - if ($EXT_DUMMY['ext_lang'][$k] == 'Y') - { + if ($EXT_DUMMY['ext_lang'][$k] == 'Y') { $INC = sprintf(PATH."inc/language/%s_%s.php", $name, GET_LANGUAGE()); if (file_exists($INC)) require_once($INC); } @@ -106,8 +101,7 @@ if ($cacheMode == "load") if ($EXT_DUMMY['ext_css'][$k] == 'Y') $EXT_CSS_FILES[] = "".$name.".css"; // Load extension file itself - if (($EXT_DUMMY['ext_active'][$k] == 'Y') || ($EXT_DUMMY['ext_keep'][$k] == 'Y') || (IS_ADMIN())) - { + if (($EXT_DUMMY['ext_active'][$k] == 'Y') || ($EXT_DUMMY['ext_keep'][$k] == 'Y') || (IS_ADMIN())) { require_once(PATH."inc/extensions/ext-".$name.".php"); } @@ -143,22 +137,17 @@ if ($cacheMode == "load") // No database load needed $res_ext_crt = false; -} - else -{ +} else { // If current user is not admin load only activated extensions // The admin shall use every available extension for testing purposes if ((!IS_ADMIN()) && ($cacheMode != "init")) $ADD = " WHERE ext_active='Y'"; - if (GET_EXT_VERSION("sql_patches") >= "0.0.6") - { + if (GET_EXT_VERSION("sql_patches") >= "0.0.6") { // Query with CSS file from DB $res_ext_crt = SQL_QUERY("SELECT id, ext_name, ext_lang_file, ext_has_css, ext_active, ext_version FROM "._MYSQL_PREFIX."_extensions".$ADD." ORDER BY ext_name", __FILE__, __LINE__); - } - else - { + } else { // Old obsulete query string $res_ext_crt = SQL_QUERY("SELECT id, ext_name, ext_lang_file, ext_name, ext_active, ext_version FROM "._MYSQL_PREFIX."_extensions".$ADD." diff --git a/inc/modules/admin/admin-inc.php b/inc/modules/admin/admin-inc.php index 2fc9b17210..a56c7a10f1 100644 --- a/inc/modules/admin/admin-inc.php +++ b/inc/modules/admin/admin-inc.php @@ -300,7 +300,7 @@ function ADMIN_DO_ACTION($wht) // Check if action/what pair is valid $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_admin_menu -WHERE action='%s' AND ((what='%s' AND what != 'overview') OR (what='' AND '%s'='overview')) +WHERE action='%s' AND ((what='%s' AND what != 'overview') OR ((what='' OR what IS NULL) AND '%s'='overview')) LIMIT 1", array($act, $wht, $wht), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { @@ -346,7 +346,7 @@ function ADD_ADMIN_MENU($act, $wht,$return=false) $menuTitle = array(); // Build main menu - $result_main = SQL_QUERY("SELECT action, title, descr FROM "._MYSQL_PREFIX."_admin_menu WHERE what='' ORDER BY sort, id DESC", __FILE__, __LINE__); + $result_main = SQL_QUERY("SELECT action, title, descr FROM "._MYSQL_PREFIX."_admin_menu WHERE (what='' OR what IS NULL) ORDER BY sort, id DESC", __FILE__, __LINE__); $OUT = ""; if (SQL_NUMROWS($result_main) > 0) { @@ -522,7 +522,7 @@ function ADD_MEMBER_SELECTION_BOX($add_all = false, $return = false, $none = fal // function ADMIN_MENU_SELECTION($MODE, $default="", $defid="") { $wht = "what != ''"; - if ($MODE == "action") $wht = "what='' AND action !='login'"; + if ($MODE == "action") $wht = "(what='' OR what IS NULL) AND action !='login'"; $result = SQL_QUERY_ESC("SELECT %s, title FROM "._MYSQL_PREFIX."_admin_menu WHERE ".$wht." ORDER BY sort", array($MODE), __FILE__, __LINE__); if (SQL_NUMROWS($result) > 0) diff --git a/inc/modules/admin/what-admin_add.php b/inc/modules/admin/what-admin_add.php index bd2d9f1b33..7c938cb84f 100644 --- a/inc/modules/admin/what-admin_add.php +++ b/inc/modules/admin/what-admin_add.php @@ -54,7 +54,7 @@ if (!isset($_POST['ok'])) $menus = array(); $titles = array(); $below = array(); // Get all available main menus - $result = SQL_QUERY("SELECT action, title, sort FROM "._MYSQL_PREFIX."_admin_menu WHERE what='' ORDER BY sort", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT action, title, sort FROM "._MYSQL_PREFIX."_admin_menu WHERE (what='' OR what IS NULL) ORDER BY sort", __FILE__, __LINE__); if (SQL_NUMROWS($result) > 0) { // Read menu structure diff --git a/inc/modules/admin/what-adminedit.php b/inc/modules/admin/what-adminedit.php index ab9fa33a99..4b4970f406 100644 --- a/inc/modules/admin/what-adminedit.php +++ b/inc/modules/admin/what-adminedit.php @@ -216,11 +216,11 @@ WHERE ".$AND." AND id=%d LIMIT 1", else { // Main menu selected - $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_admin_menu WHERE what='' AND sort='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_admin_menu WHERE (what='' OR what IS NULL) AND sort='%s' LIMIT 1", array(bigintval($_GET['tid'])), __FILE__, __LINE__); list($tid) = SQL_FETCHROW($result); SQL_FREERESULT($result); - $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_admin_menu WHERE what='' AND sort='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_admin_menu WHERE (what='' OR what IS NULL) AND sort='%s' LIMIT 1", array(bigintval($_GET['fid'])), __FILE__, __LINE__); list($fid) = SQL_FETCHROW($result); SQL_FREERESULT($result); @@ -246,7 +246,7 @@ WHERE ".$AND." AND id=%d LIMIT 1", else { // Main menus - $result = SQL_QUERY("SELECT id, action, what, title, sort FROM "._MYSQL_PREFIX."_admin_menu WHERE what='' ORDER BY sort ASC", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT id, action, what, title, sort FROM "._MYSQL_PREFIX."_admin_menu WHERE (what='' OR what IS NULL) ORDER BY sort ASC", __FILE__, __LINE__); } $max = SQL_NUMROWS($result); if ($max > 0) diff --git a/inc/modules/admin/what-guest_add.php b/inc/modules/admin/what-guest_add.php index 414d847ce0..de1be885dd 100644 --- a/inc/modules/admin/what-guest_add.php +++ b/inc/modules/admin/what-guest_add.php @@ -55,7 +55,7 @@ if (!isset($_POST['ok'])) $menus = array(); $titles = array(); $below = array(); // Get all available main menus - $result = SQL_QUERY("SELECT action, title, sort FROM "._MYSQL_PREFIX."_guest_menu WHERE what='' ORDER BY sort", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT action, title, sort FROM "._MYSQL_PREFIX."_guest_menu WHERE (what='' OR what IS NULL) ORDER BY sort", __FILE__, __LINE__); if (SQL_NUMROWS($result) > 0) { // Read menu structure diff --git a/inc/modules/admin/what-guestedit.php b/inc/modules/admin/what-guestedit.php index a6565aead7..ea87d80141 100644 --- a/inc/modules/admin/what-guestedit.php +++ b/inc/modules/admin/what-guestedit.php @@ -266,11 +266,11 @@ if ((isset($_POST['edit'])) && ($chk > 0) && (!IS_DEMO())) else { // Main menu selected - $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_guest_menu WHERE what='' AND sort='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_guest_menu WHERE (what='' OR what IS NULL) AND sort='%s' LIMIT 1", array(bigintval($_GET['tid'])), __FILE__, __LINE__); list($tid) = SQL_FETCHROW($result); SQL_FREERESULT($result); - $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_guest_menu WHERE what='' AND sort='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_guest_menu WHERE (what='' OR what IS NULL) AND sort='%s' LIMIT 1", array(bigintval($_GET['fid'])), __FILE__, __LINE__); list($fid) = SQL_FETCHROW($result); SQL_FREERESULT($result); @@ -290,7 +290,7 @@ if ((isset($_POST['edit'])) && ($chk > 0) && (!IS_DEMO())) if (empty($SUB)) { // List only main menus - $query = SQL_QUERY("SELECT id, action, what, title, sort FROM "._MYSQL_PREFIX."_guest_menu WHERE what='' ORDER BY sort ASC", __FILE__, __LINE__); + $query = SQL_QUERY("SELECT id, action, what, title, sort FROM "._MYSQL_PREFIX."_guest_menu WHERE (what='' OR what IS NULL) ORDER BY sort ASC", __FILE__, __LINE__); } else { diff --git a/inc/modules/admin/what-mem_add.php b/inc/modules/admin/what-mem_add.php index d420e0b8d4..eaef1cdfdb 100644 --- a/inc/modules/admin/what-mem_add.php +++ b/inc/modules/admin/what-mem_add.php @@ -56,7 +56,7 @@ if (!isset($_POST['ok'])) $menus = array(); $titles = array(); $below = array(); // Get all available main menus - $result = SQL_QUERY("SELECT action, title, sort FROM "._MYSQL_PREFIX."_member_menu WHERE what='' ORDER BY sort", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT action, title, sort FROM "._MYSQL_PREFIX."_member_menu WHERE (what='' OR what IS NULL) ORDER BY sort", __FILE__, __LINE__); if (SQL_NUMROWS($result) > 0) { // Read menu structure diff --git a/inc/modules/admin/what-memedit.php b/inc/modules/admin/what-memedit.php index e8e635dbbf..d240fc7d63 100644 --- a/inc/modules/admin/what-memedit.php +++ b/inc/modules/admin/what-memedit.php @@ -244,10 +244,10 @@ if ((isset($_POST['edit'])) && ($chk > 0) && (!IS_DEMO())) else { // Main menu selected - $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_member_menu WHERE what='' AND sort='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_member_menu WHERE (what='' OR what IS NULL) AND sort='%s' LIMIT 1", array(bigintval($_GET['tid'])), __FILE__, __LINE__); list($tid) = SQL_FETCHROW($result); - $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_member_menu WHERE what='' AND sort='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_member_menu WHERE (what='' OR what IS NULL) AND sort='%s' LIMIT 1", array(bigintval($_GET['fid'])), __FILE__, __LINE__); list($fid) = SQL_FETCHROW($result); } @@ -270,7 +270,7 @@ if ((isset($_POST['edit'])) && ($chk > 0) && (!IS_DEMO())) else { // Edit main menus - $result = SQL_QUERY("SELECT id, action, what, title, sort FROM "._MYSQL_PREFIX."_member_menu WHERE what='' ORDER BY sort ASC", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT id, action, what, title, sort FROM "._MYSQL_PREFIX."_member_menu WHERE (what='' OR what IS NULL) ORDER BY sort ASC", __FILE__, __LINE__); } $max = SQL_NUMROWS($result); if ($max > 0) diff --git a/inc/modules/admin/what-repair_amenu.php b/inc/modules/admin/what-repair_amenu.php index 5cc0294ff5..b3a769dfdd 100644 --- a/inc/modules/admin/what-repair_amenu.php +++ b/inc/modules/admin/what-repair_amenu.php @@ -43,7 +43,7 @@ ADD_DESCR("admin", basename(__FILE__)); global $link; $ACTIONS = array(); // First fix all main menus (what="")... -$result_fix = SQL_QUERY("SELECT id, action FROM "._MYSQL_PREFIX."_admin_menu WHERE what='' AND action != 'logout' ORDER BY sort ASC", __FILE__, __LINE__); +$result_fix = SQL_QUERY("SELECT id, action FROM "._MYSQL_PREFIX."_admin_menu WHERE (what='' OR what IS NULL) AND action != 'logout' ORDER BY sort ASC", __FILE__, __LINE__); $cnt = 0; $REP = 0; while(list($id, $act) = SQL_FETCHROW($result_fix)) { @@ -58,7 +58,7 @@ while(list($id, $act) = SQL_FETCHROW($result_fix)) $cnt++; } // Set logout weight to 999 -$result_sort = SQL_QUERY("UPDATE "._MYSQL_PREFIX."_admin_menu SET sort='999' WHERE act='logout' AND what='' LIMIT 1", __FILE__, __LINE__); +$result_sort = SQL_QUERY("UPDATE "._MYSQL_PREFIX."_admin_menu SET sort='999' WHERE act='logout' AND (what='' OR what IS NULL) LIMIT 1", __FILE__, __LINE__); // Now sort every each menu foreach ($ACTIONS as $act) diff --git a/inc/modules/admin/what-repair_amnu.php b/inc/modules/admin/what-repair_amnu.php index a9b1844ca1..35f926b828 100644 --- a/inc/modules/admin/what-repair_amnu.php +++ b/inc/modules/admin/what-repair_amnu.php @@ -43,7 +43,7 @@ ADD_DESCR("admin", basename(__FILE__)); global $link; $ACTIONs = array(); // First fix all main menus (what="")... -$result_fix = SQL_QUERY("SELECT id, action FROM "._MYSQL_PREFIX."_admin_menu WHERE what='' AND action != 'logout' ORDER BY sort ASC", __FILE__, __LINE__); +$result_fix = SQL_QUERY("SELECT id, action FROM "._MYSQL_PREFIX."_admin_menu WHERE (what='' OR what IS NULL) AND action != 'logout' ORDER BY sort ASC", __FILE__, __LINE__); $cnt = 0; $REP = 0; while(list($id, $act) = SQL_FETCHROW($result_fix)) { @@ -63,7 +63,7 @@ while(list($id, $act) = SQL_FETCHROW($result_fix)) SQL_FREERESULT($result_fix); // Set logout weight to 999 -$result_sort = SQL_QUERY("UPDATE "._MYSQL_PREFIX."_admin_menu SET sort='999' WHERE action='logout' AND what='' LIMIT 1", __FILE__, __LINE__); +$result_sort = SQL_QUERY("UPDATE "._MYSQL_PREFIX."_admin_menu SET sort='999' WHERE action='logout' AND (what='' OR what IS NULL) LIMIT 1", __FILE__, __LINE__); // Now sort every each menu foreach ($ACTIONs as $act) diff --git a/inc/modules/admin/what-repair_gmenu.php b/inc/modules/admin/what-repair_gmenu.php index b3dc3b7293..6859336b8c 100644 --- a/inc/modules/admin/what-repair_gmenu.php +++ b/inc/modules/admin/what-repair_gmenu.php @@ -42,7 +42,7 @@ ADD_DESCR("admin", basename(__FILE__)); $ACTIONS = array(); // First fix all main menus (what="")... -$result_fix = SQL_QUERY("SELECT id, action FROM "._MYSQL_PREFIX."_guest_menu WHERE what='' AND action != 'logout' ORDER BY sort ASC", __FILE__, __LINE__); +$result_fix = SQL_QUERY("SELECT id, action FROM "._MYSQL_PREFIX."_guest_menu WHERE (what='' OR what IS NULL) AND action != 'logout' ORDER BY sort ASC", __FILE__, __LINE__); $cnt = 0; $REP = 0; while(list($id, $act) = SQL_FETCHROW($result_fix)) { @@ -57,7 +57,7 @@ while(list($id, $act) = SQL_FETCHROW($result_fix)) $cnt++; } // Set logout weight to 999 -$result_sort = SQL_QUERY("UPDATE "._MYSQL_PREFIX."_guest_menu SET sort='999' WHERE act='logout' AND what='' LIMIT 1", __FILE__, __LINE__); +$result_sort = SQL_QUERY("UPDATE "._MYSQL_PREFIX."_guest_menu SET sort='999' WHERE act='logout' AND (what='' OR what IS NULL) LIMIT 1", __FILE__, __LINE__); // Now sort every each menu foreach ($ACTIONS as $act) diff --git a/inc/modules/admin/what-repair_gmnu.php b/inc/modules/admin/what-repair_gmnu.php index 905e16d5a2..85e635484a 100644 --- a/inc/modules/admin/what-repair_gmnu.php +++ b/inc/modules/admin/what-repair_gmnu.php @@ -42,7 +42,7 @@ ADD_DESCR("admin", basename(__FILE__)); $ACTIONS = array(); // First fix all main menus (what="")... -$result_fix = SQL_QUERY("SELECT id, action FROM "._MYSQL_PREFIX."_guest_menu WHERE what='' AND action != 'logout' ORDER BY sort ASC", __FILE__, __LINE__); +$result_fix = SQL_QUERY("SELECT id, action FROM "._MYSQL_PREFIX."_guest_menu WHERE (what='' OR what IS NULL) AND action != 'logout' ORDER BY sort ASC", __FILE__, __LINE__); $cnt = 0; $REP = 0; while(list($id, $act) = SQL_FETCHROW($result_fix)) { @@ -62,7 +62,7 @@ while(list($id, $act) = SQL_FETCHROW($result_fix)) SQL_FREERESULT($result_fix); // Set logout weight to 999 -$result_sort = SQL_QUERY("UPDATE "._MYSQL_PREFIX."_guest_menu SET sort='999' WHERE action='logout' AND what='' LIMIT 1", __FILE__, __LINE__); +$result_sort = SQL_QUERY("UPDATE "._MYSQL_PREFIX."_guest_menu SET sort='999' WHERE action='logout' AND (what='' OR what IS NULL) LIMIT 1", __FILE__, __LINE__); // Now sort every each menu foreach ($ACTIONS as $act) diff --git a/inc/modules/admin/what-repair_mmenu.php b/inc/modules/admin/what-repair_mmenu.php index 0bb45740ec..23d67de7f2 100644 --- a/inc/modules/admin/what-repair_mmenu.php +++ b/inc/modules/admin/what-repair_mmenu.php @@ -42,7 +42,7 @@ ADD_DESCR("admin", basename(__FILE__)); $ACTIONS = array(); // First fix all main menus (what="")... -$result_fix = SQL_QUERY("SELECT id, action FROM "._MYSQL_PREFIX."_member_menu WHERE what='' AND action != 'logout' ORDER BY sort ASC", __FILE__, __LINE__); +$result_fix = SQL_QUERY("SELECT id, action FROM "._MYSQL_PREFIX."_member_menu WHERE (what='' OR what IS NULL) AND action != 'logout' ORDER BY sort ASC", __FILE__, __LINE__); $cnt = 0; $REP = 0; while(list($id, $act) = SQL_FETCHROW($result_fix)) { @@ -57,7 +57,7 @@ while(list($id, $act) = SQL_FETCHROW($result_fix)) $cnt++; } // Set logout weight to 999 -$result_sort = SQL_QUERY("UPDATE "._MYSQL_PREFIX."_member_menu SET sort='999' WHERE action='logout' AND what='' LIMIT 1", __FILE__, __LINE__); +$result_sort = SQL_QUERY("UPDATE "._MYSQL_PREFIX."_member_menu SET sort='999' WHERE action='logout' AND (what='' OR what IS NULL) LIMIT 1", __FILE__, __LINE__); // Now sort every each menu foreach ($ACTIONS as $act) diff --git a/inc/modules/admin/what-repair_mmnu.php b/inc/modules/admin/what-repair_mmnu.php index e2eb30b1bd..0eeb00cd14 100644 --- a/inc/modules/admin/what-repair_mmnu.php +++ b/inc/modules/admin/what-repair_mmnu.php @@ -42,7 +42,7 @@ ADD_DESCR("admin", basename(__FILE__)); $ACTIONS = array(); // First fix all main menus (what="")... -$result_fix = SQL_QUERY("SELECT id, action FROM "._MYSQL_PREFIX."_member_menu WHERE what='' AND action != 'logout' ORDER BY sort ASC", __FILE__, __LINE__); +$result_fix = SQL_QUERY("SELECT id, action FROM "._MYSQL_PREFIX."_member_menu WHERE (what='' OR what IS NULL) AND action != 'logout' ORDER BY sort ASC", __FILE__, __LINE__); $cnt = 0; $REP = 0; while(list($id, $act) = SQL_FETCHROW($result_fix)) { @@ -62,7 +62,7 @@ while(list($id, $act) = SQL_FETCHROW($result_fix)) SQL_FREERESULT($result_fix); // Set logout weight to 999 -$result_sort = SQL_QUERY("UPDATE "._MYSQL_PREFIX."_member_menu SET sort='999' WHERE action='logout' AND what='' LIMIT 1", __FILE__, __LINE__); +$result_sort = SQL_QUERY("UPDATE "._MYSQL_PREFIX."_member_menu SET sort='999' WHERE action='logout' AND (what='' OR what IS NULL) LIMIT 1", __FILE__, __LINE__); // Now sort every each menu foreach ($ACTIONS as $act) diff --git a/inc/mysql-connect.php b/inc/mysql-connect.php index bdfc0cd94a..20f4233310 100644 --- a/inc/mysql-connect.php +++ b/inc/mysql-connect.php @@ -119,9 +119,6 @@ LIMIT 1", __FILE__, __LINE__); define('__DAILY_RESET', "1"); } - // Load all extensions - require_once(PATH."inc/load_extensions.php"); - // Load "databases" aka static arrays require_once(PATH."inc/databases.php"); @@ -233,7 +230,6 @@ LIMIT 1", __FILE__, __LINE__); // Include required files require_once(PATH."inc/databases.php"); require_once(PATH."inc/theme-manager.php"); - require_once(PATH."inc/load_extensions.php"); // Check if we are in installation routine $installPhp = basename($_SERVER['PHP_SELF']); diff --git a/inc/mysql-manager.php b/inc/mysql-manager.php index 637424ef9d..757c19a1fc 100644 --- a/inc/mysql-manager.php +++ b/inc/mysql-manager.php @@ -209,7 +209,7 @@ function ADD_DESCR($ACC_LVL, $file, $return = false, $output = true) { $MOD_CHECK = $GLOBALS['module']; break; } - $AND = " AND what=''"; + $AND = " AND (what='' OR what IS NULL)"; } elseif (ereg("what-", $file)) { // This is an admin what file! $type = "what"; @@ -306,7 +306,7 @@ function ADD_MENU($MODE, $act, $wht) { } // Load SQL data and add the menu to the output stream... - $result_main = SQL_QUERY_ESC("SELECT title, action FROM "._MYSQL_PREFIX."_%s_menu WHERE what='' ".$AND." ORDER BY sort", + $result_main = SQL_QUERY_ESC("SELECT title, action FROM "._MYSQL_PREFIX."_%s_menu WHERE (what='' OR what IS NULL) ".$AND." ORDER BY sort", array($MODE), __FILE__, __LINE__); //* DEBUG: */ echo __LINE__."/".$main_cnt."/".$main_action."/".$sub_what.":".$GLOBALS['what']."*
\n"; if (SQL_NUMROWS($result_main) > 0) { @@ -679,7 +679,7 @@ function VALIDATE_MENU_ACTION ($MODE, $act, $wht, $UPDATE=false) else { // Admin login overview - $SQL = SQL_QUERY_ESC("SELECT id, what FROM "._MYSQL_PREFIX."_%s_menu WHERE action='%s' AND what=''".$ADD." ORDER BY action DESC LIMIT 1", + $SQL = SQL_QUERY_ESC("SELECT id, what FROM "._MYSQL_PREFIX."_%s_menu WHERE action='%s' AND (what='' OR what IS NULL)".$ADD." ORDER BY action DESC LIMIT 1", array($MODE, $act), __FILE__, __LINE__, false); }