From feda50ff73c05935417ed33164d30caf966ba854 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sat, 22 Nov 2008 19:22:52 +0000 Subject: [PATCH] More calls of DEBUG_LOG() added --- inc/databases.php | 2 +- inc/functions.php | 14 +++++++--- inc/install-inc.php | 1 + inc/libs/sponsor_functions.php | 2 ++ inc/libs/wernis_functions.php | 1 + inc/modules/admin.php | 3 ++- inc/modules/admin/overview-inc.php | 2 ++ inc/modules/admin/what-adminedit.php | 29 ++++++++++---------- inc/modules/admin/what-edit_sponsor.php | 1 + inc/modules/admin/what-guestedit.php | 1 + inc/modules/admin/what-list_task.php | 1 + inc/modules/guest/what-login.php | 2 ++ inc/modules/guest/what-register.php | 1 + inc/modules/guest/what-sponsor_reg.php | 36 +++++++++---------------- inc/modules/login.php | 1 + inc/modules/member/what-mydata.php | 8 +++--- inc/modules/member/what-order.php | 17 +++++++----- inc/modules/member/what-primera.php | 3 ++- inc/modules/member/what-wernis.php | 3 ++- inc/mysql-manager.php | 30 +++++++++++---------- mailid.php | 1 + modules.php | 14 +++++----- 22 files changed, 95 insertions(+), 78 deletions(-) diff --git a/inc/databases.php b/inc/databases.php index 8e09b8e81b..6457ef2cd4 100644 --- a/inc/databases.php +++ b/inc/databases.php @@ -114,7 +114,7 @@ define('USAGE_BASE', "usage"); define('SERVER_URL', "http://www.mxchange.org"); // This current patch level -define('CURR_SVN_REVISION', "533"); +define('CURR_SVN_REVISION', "534"); // Take a prime number which is long (if you know a longer one please try it out!) define('_PRIME', 591623); diff --git a/inc/functions.php b/inc/functions.php index 8e533d3582..bf8b9b907b 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -132,7 +132,8 @@ function OUTPUT_HTML($HTML, $NEW_LINE = true) { default: // Huh, something goes wrong or maybe you have edited config.php ??? - die ("".FATAL_ERROR.": ".LANG_NO_RENDER_DIRECT); + DEBUG_LOG(__FILE__, __LINE__, sprintf("Invalid renderer %s detected.", OUTPUT_MODE)); + MXCHANGE_DIE("".FATAL_ERROR.": ".LANG_NO_RENDER_DIRECT); break; } } elseif ((_OB_CACHING == "on") && ($footer == 1)) { @@ -537,13 +538,13 @@ function GEN_PASS($LEN = 0) { $PASS = ""; for ($i = 0; $i < $LEN; $i++) { $PASS .= $ABC[mt_rand(0, sizeof($ABC) -1)]; - } + } // END - for // When the size is below 40 we can also add additional security by scrambling it if (strlen($PASS) <= 40) { // Also scramble the password $PASS = scrambleString($PASS); - } + } // END - if // Return the password return $PASS; @@ -567,6 +568,9 @@ function MAKE_DATETIME ($time, $mode="0") case "1": $ret = strtolower(date("d.m.Y - H:i", $time)); break; case "2": $ret = date("d.m.Y|H:i", $time); break; case "3": $ret = date("d.m.Y", $time); break; + default: + DEBUG_LOG(__FILE__, __LINE__, sprintf("Invalid date mode %s detected.", $mode)); + break; } break; @@ -576,6 +580,9 @@ function MAKE_DATETIME ($time, $mode="0") case "1": $ret = date("Y-m-d - g:i A", $time); break; case "2": $ret = date("y-m-d|H:i", $time); break; case "3": $ret = date("y-m-d", $time); break; + default: + DEBUG_LOG(__FILE__, __LINE__, sprintf("Invalid date mode %s detected.", $mode)); + break; } } return $ret; @@ -696,6 +703,7 @@ function TRANSLATE_STATUS($status) { break; default: + DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown status %s detected.", $status)); $ret = UNKNOWN_STATUS_1.$status.UNKNOWN_STATUS_2; break; } diff --git a/inc/install-inc.php b/inc/install-inc.php index f19cf3a718..f9ce4811d8 100644 --- a/inc/install-inc.php +++ b/inc/install-inc.php @@ -479,6 +479,7 @@ if ((!isBooleanConstantAndTrue('mxchange_installed')) || (!isBooleanConstantAndT break; default: + DEBUG_LOG(__FILE__, __LINE__, sprintf("Wrong page %s detected.", $_GET['page'])); OUTPUT_HTML(" ".WRONG_PAGE.""); break; } diff --git a/inc/libs/sponsor_functions.php b/inc/libs/sponsor_functions.php index beebdc41cd..340958e686 100644 --- a/inc/libs/sponsor_functions.php +++ b/inc/libs/sponsor_functions.php @@ -283,6 +283,7 @@ function SPONSOR_TRANSLATE_STATUS($status) break; default: + DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown status %s detected.", $status)); $ret = UNKNOWN_STATUS_1.$status.UNKNOWN_STATUS_2; break; } @@ -567,6 +568,7 @@ function SPONSOR_SAVE_DATA($POST, $content) break; default: // Unknown sponsor what value! + DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown sponsor module (what) %s detected.", $_GET['what'])); $MSG = SPONSOR_UNKNOWN_WHAT_1.$_GET['what'].SPONSOR_UNKNOWN_WHAT_2; $templ = ""; $subj = ""; break; diff --git a/inc/libs/wernis_functions.php b/inc/libs/wernis_functions.php index 011e2175bb..db76a64749 100644 --- a/inc/libs/wernis_functions.php +++ b/inc/libs/wernis_functions.php @@ -170,6 +170,7 @@ function WERNIS_SEND_REQUEST ($scriptName, $requestData = array()) { break; default: // Unknown error (maybe new?) + DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown error %s from WDS66 API received.", $data[1])); $return = array( 'status' => "request_failed", 'message' => sprintf(WERNIS_API_REQUEST_FAILED, $data[1]) diff --git a/inc/modules/admin.php b/inc/modules/admin.php index 1017c5b164..d416353943 100644 --- a/inc/modules/admin.php +++ b/inc/modules/admin.php @@ -90,6 +90,7 @@ if (!isBooleanConstantAndTrue('admin_registered')) { $ret = "done"; } + // Admin still not registered? if (!isBooleanConstantAndTrue('admin_registered')) { // Write to config that registration is done admin_WriteData(PATH."inc/config.php", "ADMIN-SETUP", "define('admin_registered', ", ");", "true", 0); @@ -97,7 +98,7 @@ if (!isBooleanConstantAndTrue('admin_registered')) { // Load URL for login $URL = URL."/modules.php?module=admin&action=login"; LOAD_URL($URL); - } + } // END - if break; } } diff --git a/inc/modules/admin/overview-inc.php b/inc/modules/admin/overview-inc.php index 9a81ae8795..db0af358c5 100644 --- a/inc/modules/admin/overview-inc.php +++ b/inc/modules/admin/overview-inc.php @@ -277,6 +277,7 @@ function OUTPUT_SELECTED_TASKS($_POST, $result_tasks) { switch ($mode) { default: // Unknown support mode + DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown support mode %s detected. This part is under construction!", $mode)); $OUT .= "".ADMIN_UNKNOWN_SUPPORT_MODE_1.$mode.ADMIN_UNKNOWN_SUPPORT_MODE_2."\n"; break; } @@ -356,6 +357,7 @@ function OUTPUT_SELECTED_TASKS($_POST, $result_tasks) { break; default: // Unknown task type + DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown task type %s detected.", $type)); $OUT .= "".ADMIN_UNKNOWN_TASK_TYPE_1.$type.ADMIN_UNKNOWN_TASK_TYPE_2.$id.ADMIN_UNKNOWN_TASK_TYPE_3."\n"; break; } diff --git a/inc/modules/admin/what-adminedit.php b/inc/modules/admin/what-adminedit.php index 75045efc2b..688b5758c5 100644 --- a/inc/modules/admin/what-adminedit.php +++ b/inc/modules/admin/what-adminedit.php @@ -146,15 +146,12 @@ if ((isset($_POST['edit'])) && ($chk > 0) && (!IS_DEMO())) { // Load template LOAD_TEMPLATE("admin_amenu_delete"); -} - elseif ((isset($_POST['ok'])) && (!IS_DEMO())) -{ +} elseif ((isset($_POST['ok'])) && (!IS_DEMO())) { // An action is done... switch ($_POST['ok']) { case "edit": // Edit menu - foreach ($_POST['sel'] as $sel => $menu) - { + foreach ($_POST['sel'] as $sel => $menu) { // Secure ID $sel = bigintval($sel); @@ -173,33 +170,35 @@ WHERE ".$AND." AND id=%s LIMIT 1", $sel, ), __FILE__, __LINE__); } + + // Purge admin menu cache CACHE_PURGE_ADMIN_MENU(0, $_POST['sel_action'][$sel], $_POST['sel_what'][$sel]); + + // Load template LOAD_TEMPLATE("admin_data_saved"); break; case "del": // Delete menu - foreach ($_POST['sel'] as $sel => $menu) - { + foreach ($_POST['sel'] as $sel => $menu) { $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE ".$AND." AND id=%s LIMIT 1", array(bigintval($sel)), __FILE__, __LINE__); CACHE_PURGE_ADMIN_MENU(0, "", "", $AND); - } + } // END - foreach + + // Load template LOAD_TEMPLATE("admin_data_saved"); break; default: // Unexpected action + DEBUG_LOG(__FILE__, __LINE__, sprintf("Unsupported action %s detected.", $_POST['ok'])); define('__OK_VALUE', $_POST['ok']); LOAD_TEMPLATE("admin_menu_unknown_okay"); break; } -} - else -{ - if ((!empty($_GET['act'])) && (!empty($_GET['tid'])) && (!empty($_GET['fid']))) - { +} else { + if ((!empty($_GET['act'])) && (!empty($_GET['tid'])) && (!empty($_GET['fid']))) { // Get IDs - if (!empty($_GET['w'])) - { + if (!empty($_GET['w'])) { // Sub menus selected $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_admin_menu WHERE action='%s' AND sort='%s' LIMIT 1", array($_GET['act'], bigintval($_GET['tid'])), __FILE__, __LINE__); diff --git a/inc/modules/admin/what-edit_sponsor.php b/inc/modules/admin/what-edit_sponsor.php index 5ab5c8ec3a..631eef7531 100644 --- a/inc/modules/admin/what-edit_sponsor.php +++ b/inc/modules/admin/what-edit_sponsor.php @@ -170,6 +170,7 @@ if ((!empty($_GET['id'])) && (!empty($_GET['mode']))) { break; default: // Unknown mode + DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown mode %s detected.", $_GET['mode'])); $MSG = ADMIN_INVALID_MODE_1.SQL_ESCAPE($_GET['mode']).ADMIN_INVALID_MODE_2; break; } diff --git a/inc/modules/admin/what-guestedit.php b/inc/modules/admin/what-guestedit.php index cf7ed37a83..dc1d4bad68 100644 --- a/inc/modules/admin/what-guestedit.php +++ b/inc/modules/admin/what-guestedit.php @@ -188,6 +188,7 @@ if ((isset($_POST['edit'])) && ($chk > 0) && (!IS_DEMO())) default: // Unexpected action define('__OK_VALUE', $_POST['ok']); + DEBUG_LOG(__FILE__, __LINE__, sprintf("Unsupported action %s detected.", $_POST['ok'])); LOAD_TEMPLATE("admin_menu_unknown_okay"); break; } diff --git a/inc/modules/admin/what-list_task.php b/inc/modules/admin/what-list_task.php index 251cf29082..22dd312f09 100644 --- a/inc/modules/admin/what-list_task.php +++ b/inc/modules/admin/what-list_task.php @@ -73,6 +73,7 @@ case "closed": // List all closed break; default: // Unknown type + DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown task type %s detected.", $_GET['type'])); LOAD_TEMPLATE("admin_settings_saved", false, TASK_ADMIN_UNKNOWN_MODE_1.$_GET['type'].TASK_ADMIN_UNKNOWN_MODE_2); break; } diff --git a/inc/modules/guest/what-login.php b/inc/modules/guest/what-login.php index efaf745c31..6dddc59702 100644 --- a/inc/modules/guest/what-login.php +++ b/inc/modules/guest/what-login.php @@ -213,6 +213,7 @@ if (IS_MEMBER()) { break; default: + DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown error status %s detected.", $status)); $ERROR = CODE_UNKNOWN_STATUS; break; } @@ -325,6 +326,7 @@ if (!empty($ERROR)) { break; default: + DEBUG_LOG(__FILE__, __LINE__, sprintf("Unhandled error code %s detected.", $ERROR)); $MSG .= LOGIN_WRONG_ID; break; } diff --git a/inc/modules/guest/what-register.php b/inc/modules/guest/what-register.php index c38e2e5bb5..542db3ef96 100644 --- a/inc/modules/guest/what-register.php +++ b/inc/modules/guest/what-register.php @@ -398,6 +398,7 @@ VALUES ('%s','%s','%s','%s','%s',%s,'%s','%s',%s, %s,%s,'%s',%s, %s,'%s','UNCONF break; default: // Default is the US date format... :) + define('BIRTHDAY_SELECTION', ADD_SELECTION("month", $_POST['month']).ADD_SELECTION("day", $_POST['day']).ADD_SELECTION("year", $_POST['year'])); break; } diff --git a/inc/modules/guest/what-sponsor_reg.php b/inc/modules/guest/what-sponsor_reg.php index d3af4b373c..9e61d124e3 100644 --- a/inc/modules/guest/what-sponsor_reg.php +++ b/inc/modules/guest/what-sponsor_reg.php @@ -279,13 +279,11 @@ WHERE id='%s' LIMIT 1", array($_POST['pay_type']), __FILE__, __LINE__); break; default: - if (!IS_ADMIN()) - { + DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown status %s detected.", $STATUS)); + if (!IS_ADMIN()) { // Message for testing admin $MSG = ADMIN_SPONSOR_UNKOWN_STATUS_1.$STATUS.ADMIN_SPONSOR_UNKOWN_STATUS_2; - } - else - { + } else { // Message for the guest $MSG = SPONSOR_UNKOWN_STATUS_1.$STATUS.SPONSOR_UNKOWN_STATUS_2; } @@ -294,15 +292,12 @@ WHERE id='%s' LIMIT 1", array($_POST['pay_type']), __FILE__, __LINE__); // Display message LOAD_TEMPLATE("admin_settings_saved", false, $MSG); -} - else -{ +} else { // Check for payment types $result = SQL_QUERY("SELECT id, pay_name, pay_rate, pay_currency, pay_min_count FROM "._MYSQL_PREFIX."_sponsor_paytypes ORDER BY pay_name", __FILE__, __LINE__); - if (SQL_NUMROWS($result) > 0) - { + if (SQL_NUMROWS($result) > 0) { // Load all types... $OUT = "\n"; $SW = 2; @@ -381,16 +376,14 @@ ORDER BY pay_name", __FILE__, __LINE__); ".SPONSOR_REGISTER_SOMETHING_MISSING.":

    \n"; - foreach ($FORM_ERRORS as $error) - { + foreach ($FORM_ERRORS as $error) { $OUT .= "
  1. ".$error."
  2. \n"; - } + } // END - if + $OUT .= "

\n"; define('__SPONSOR_FORM_ERRORS', $OUT); define('__SPONSOR_REFID', $_POST['refid']); - } - else - { + } else { // None found, first call define('__COMPANY' , ""); define('__POSITION' , ""); @@ -418,22 +411,17 @@ ORDER BY pay_name", __FILE__, __LINE__); } // Prepare referal things - if (!isset($_GET['refid'])) - { + if (!isset($_GET['refid'])) { // No referal link define('__SPONSOR_REFID', "0"); - } - else - { + } else { // Referal ID transmitted, we don't care here if it is right or not define('__SPONSOR_REFID', bigintval($_GET['refid'])); } // Display registration form LOAD_TEMPLATE("guest_sponsor_reg"); - } - else - { + } else { // Nothing added so far LOAD_TEMPLATE("admin_settings_saved", false, SPONSOR_PAYMENT_LIST_IS_EMPTY); } diff --git a/inc/modules/login.php b/inc/modules/login.php index 9ca58e5f02..5928f54c60 100644 --- a/inc/modules/login.php +++ b/inc/modules/login.php @@ -54,6 +54,7 @@ if ($status != "CONFIRMED") { break; default: + DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown status %s detected.", $status)); $ERROR = CODE_UNKNOWN_STATUS; break; } diff --git a/inc/modules/member/what-mydata.php b/inc/modules/member/what-mydata.php index 848b54f136..8213cb1644 100644 --- a/inc/modules/member/what-mydata.php +++ b/inc/modules/member/what-mydata.php @@ -168,11 +168,11 @@ FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1", default: // Default is the US date format... :) break; } + define('DOB', $DOB); define('MAX_REC_LIST', ADD_MAX_RECEIVE_LIST("member", $DATA[11], true)); - if (EXT_IS_ACTIVE("country")) - { + if (EXT_IS_ACTIVE("country")) { // Generate selection box $OUT = ""; define('__COUNTRY_CONTENT', $OUT); - } - else - { + } else { // Ouput default input box define('__COUNTRY_CONTENT', ""); } diff --git a/inc/modules/member/what-order.php b/inc/modules/member/what-order.php index 1f216e16b7..51c11ef419 100644 --- a/inc/modules/member/what-order.php +++ b/inc/modules/member/what-order.php @@ -603,20 +603,20 @@ LIMIT 1", array(bigintval($ucat)), __FILE__, __LINE__); break; default: + DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown error code %s detected.", $_GET['msg'])); $MSG = UNKNOWN_CODE_1.$_GET['msg'].UNKNOWN_CODE_2; break; } - if (!empty($MSG)) - { + + if (!empty($MSG)) { // We got system message so we drop it out to the user LOAD_TEMPLATE("admin_settings_saved", false, $MSG); - } + } // END - if // Load all email types... - while ($typeS[] = SQL_FETCHROW($result)) - { + while ($typeS[] = SQL_FETCHROW($result)) { // Nothing to do here... ;-) - } + } // END - while // Free memory SQL_FREERESULT($result); @@ -634,6 +634,11 @@ LIMIT 1", array(bigintval($ucat)), __FILE__, __LINE__); case "ORDER": // He is allowed to send as much as he setup the receiving value define('ORDER_MAX_VALUE', ORDER_ALLOWED_RECEIVE_1.$ALLOWED.ORDER_ALLOWED_RECEIVE_2.$MAXI.ORDER_ALLOWED_RECEIVE_3); break; + + default: // Unknown/invalid + DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown order_mas_full config detected.", $_CONFIG['order_max_full'])); + define('ORDER_MAX_VALUE', ORDER_ALLOED_UNKNOWN); + break; } // Load final template diff --git a/inc/modules/member/what-primera.php b/inc/modules/member/what-primera.php index 7b8343db0e..ad350d165c 100644 --- a/inc/modules/member/what-primera.php +++ b/inc/modules/member/what-primera.php @@ -216,10 +216,11 @@ if ((isset($_POST['ok'])) && (isset($_GET['mode']))) { break; default: // Invalid mode! + DEBUG_LOG(__FILE__, __LINE__, sprintf("Invalid mode %s detected.", $_GET['mode'])); LOAD_TEMPLATE("admin_settings_saved", false, sprintf(PRIMERA_MEMBER_MODE_INVALID, SQL_ESCAPE($_GET['mode']))); return; } -} +} // END - if // Prepare mode for template name $mode = sprintf("member_primera_mode_%s", SQL_ESCAPE($_GET['mode'])); diff --git a/inc/modules/member/what-wernis.php b/inc/modules/member/what-wernis.php index f38498b40b..eba573efd6 100644 --- a/inc/modules/member/what-wernis.php +++ b/inc/modules/member/what-wernis.php @@ -290,11 +290,12 @@ if ((isset($_POST['ok'])) && (isset($_GET['mode']))) { break; default: // Invalid mode! + DEBUG_LOG(__FILE__, __LINE__, sprintf("Invalid mode %s detected.", $_GET['mode'])); LOAD_TEMPLATE("admin_settings_saved", false, sprintf(WERNIS_MEMBER_MODE_INVALID, SQL_ESCAPE($_GET['mode']))); return; } } -} +} // END - if // Prepare mode for template name $mode = sprintf("member_wernis_mode_%s", SQL_ESCAPE($_GET['mode'])); diff --git a/inc/mysql-manager.php b/inc/mysql-manager.php index e92f1e4d50..093ea4ee8f 100644 --- a/inc/mysql-manager.php +++ b/inc/mysql-manager.php @@ -205,13 +205,13 @@ function ADD_DESCR($ACC_LVL, $file, $return = false, $output = true) { switch ($ACC_LVL) { case "admin": - $MOD_CHECK = "admin"; + $modCheck = "admin"; break; case "sponsor": case "guest": case "member": - $MOD_CHECK = $GLOBALS['module']; + $modCheck = $GLOBALS['module']; break; } $AND = " AND (what='' OR what IS NULL)"; @@ -223,12 +223,12 @@ function ADD_DESCR($ACC_LVL, $file, $return = false, $output = true) { switch ($ACC_LVL) { case "admin": - $MOD_CHECK = "admin"; + $modCheck = "admin"; break; case "guest": case "member": - $MOD_CHECK = $GLOBALS['module']; + $modCheck = $GLOBALS['module']; if (!IS_ADMIN()) { $AND = " AND visible='Y' AND locked='N'"; } @@ -240,13 +240,13 @@ function ADD_DESCR($ACC_LVL, $file, $return = false, $output = true) { // Sponsor / engine menu $type = "what"; $search = $file; - $MOD_CHECK = $GLOBALS['module']; + $modCheck = $GLOBALS['module']; $AND = ""; } else { // Other $type = "menu"; $search = $file; - $MOD_CHECK = $GLOBALS['module']; + $modCheck = $GLOBALS['module']; $AND = ""; } if ((!isset($DEPTH)) && (!$return)) { @@ -278,9 +278,9 @@ function ADD_DESCR($ACC_LVL, $file, $return = false, $output = true) { if ($return) { // Return title return $ret; - } elseif (((GET_EXT_VERSION("sql_patches") >= "0.2.3") && ($_CONFIG['youre_here'] == "Y")) || ((IS_ADMIN()) && ($MOD_CHECK == "admin"))) { + } elseif (((GET_EXT_VERSION("sql_patches") >= "0.2.3") && ($_CONFIG['youre_here'] == "Y")) || ((IS_ADMIN()) && ($modCheck == "admin"))) { // Output HTML code - $OUT = $prefix."".$ret."\n"; + $OUT = $prefix."".$ret."\n"; // Can we close the you-are-here navigation? //* DEBUG: */ echo __LINE__."*".$type."/".$GLOBALS['what']."*
\n"; @@ -839,6 +839,7 @@ function SEND_MODE_MAILS($mod, $modes) break; default: + DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown mode %s detected.", $mode)); $content = MEMBER_UNKNOWN_MODE.": ".$mode."\n\n"; break; } @@ -855,11 +856,11 @@ function SEND_MODE_MAILS($mod, $modes) if ($_CONFIG['admin_notify'] == "Y") { // The admin needs to be notified about a profile change $msg_admin = "admin_mydata_notify"; - $sub_adm = ADMIN_CHANGED_DATA; + $sub_adm = ADMIN_CHANGED_DATA; } else { // No mail to admin $msg_admin = ""; - $sub_adm = ""; + $sub_adm = ""; } // Set subject lines @@ -870,6 +871,7 @@ function SEND_MODE_MAILS($mod, $modes) break; default: + DEBUG_LOG(__FILE__, __LINE__, sprintf("Unsupported module %s detected.", $mod)); $content = "".UNKNOWN_MODULE.""; break; } @@ -1759,12 +1761,12 @@ function LOAD_CONFIG($no="0") { return $CFG_DUMMY; } // Gets the matching what name from module -function GET_WHAT($MOD_CHECK) { +function GET_WHAT($modCheck) { global $_CONFIG; $wht = ""; - //* DEBUG: */ echo __LINE__."!".$MOD_CHECK."!
\n"; - switch ($MOD_CHECK) + //* DEBUG: */ echo __LINE__."!".$modCheck."!
\n"; + switch ($modCheck) { case "admin": $wht = "overview"; @@ -1773,7 +1775,7 @@ function GET_WHAT($MOD_CHECK) { case "login": case "index": $wht = "welcome"; - if (($MOD_CHECK == "index") && (!empty($_CONFIG['index_home']))) $wht = $_CONFIG['index_home']; + if (($modCheck == "index") && (!empty($_CONFIG['index_home']))) $wht = $_CONFIG['index_home']; break; default: diff --git a/mailid.php b/mailid.php index fcb310d01b..a913ef06ff 100644 --- a/mailid.php +++ b/mailid.php @@ -213,6 +213,7 @@ if (isBooleanConstantAndTrue('mxchange_installed')) break; default: + DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown status %s detected in mailid_error_redirect.", $_CONFIG['mailid_error_redirect'])); LOAD_URL("modules.php?module=index&msg=".CODE_UNKNOWN_STATUS."&ext=mailid"); break; } diff --git a/modules.php b/modules.php index 3787101d99..78bf8c7c39 100644 --- a/modules.php +++ b/modules.php @@ -129,21 +129,21 @@ if ((!empty($_CONFIG['maintenance'])) && ($_CONFIG['maintenance'] == "Y") && (!I break; case "locked": - if (!FILE_READABLE(PATH."inc/modules/".$GLOBALS['module'].".php")) - { + if (!FILE_READABLE(PATH."inc/modules/".$GLOBALS['module'].".php")) { // Module does addionally not exists ADD_FATAL(LANG_MOD_REG_404_1.$GLOBALS['module'].LANG_MOD_REG_404_2); - } + } // END - if + + // Add fatal message ADD_FATAL(LANG_MOD_LOCKED_1.$GLOBALS['module'].LANG_MOD_LOCKED_2); break; default: + DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown status %s return from module check. Module=%s", $check, $GLOBALS['module'])); ADD_FATAL(LANG_MOD_UNKNOWN_1.$check.LANG_MOD_UNKNOWN_2); break; } -} - elseif (sizeof($FATAL) == 0) -{ +} elseif (sizeof($FATAL) == 0) { // MySQL problems! ADD_FATAL(MYSQL_ERRORS); } @@ -155,7 +155,7 @@ if ($MOD_VALID) { // // Everything is okay so we can load the module include (__MODULE); -} +} // END - if // Next-to-end add the footer include (PATH."inc/footer.php"); -- 2.39.5