More calls of DEBUG_LOG() added
authorRoland Häder <roland@mxchange.org>
Sat, 22 Nov 2008 19:22:52 +0000 (19:22 +0000)
committerRoland Häder <roland@mxchange.org>
Sat, 22 Nov 2008 19:22:52 +0000 (19:22 +0000)
22 files changed:
inc/databases.php
inc/functions.php
inc/install-inc.php
inc/libs/sponsor_functions.php
inc/libs/wernis_functions.php
inc/modules/admin.php
inc/modules/admin/overview-inc.php
inc/modules/admin/what-adminedit.php
inc/modules/admin/what-edit_sponsor.php
inc/modules/admin/what-guestedit.php
inc/modules/admin/what-list_task.php
inc/modules/guest/what-login.php
inc/modules/guest/what-register.php
inc/modules/guest/what-sponsor_reg.php
inc/modules/login.php
inc/modules/member/what-mydata.php
inc/modules/member/what-order.php
inc/modules/member/what-primera.php
inc/modules/member/what-wernis.php
inc/mysql-manager.php
mailid.php
modules.php

index 8e09b8e..6457ef2 100644 (file)
@@ -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);
index 8e533d3..bf8b9b9 100644 (file)
@@ -132,7 +132,8 @@ function OUTPUT_HTML($HTML, $NEW_LINE = true) {
 
                default:
                        // Huh, something goes wrong or maybe you have edited config.php ???
-                       die ("<STRONG>".FATAL_ERROR.":</STRONG> ".LANG_NO_RENDER_DIRECT);
+                       DEBUG_LOG(__FILE__, __LINE__, sprintf("Invalid renderer %s detected.", OUTPUT_MODE));
+                       MXCHANGE_DIE("<STRONG>".FATAL_ERROR.":</STRONG> ".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;
        }
index f19cf3a..f9ce481 100644 (file)
@@ -479,6 +479,7 @@ if ((!isBooleanConstantAndTrue('mxchange_installed')) || (!isBooleanConstantAndT
                break;
 
        default:
+               DEBUG_LOG(__FILE__, __LINE__, sprintf("Wrong page %s detected.", $_GET['page']));
                OUTPUT_HTML("    <STRONG class=\"install_error\">".WRONG_PAGE."</STRONG>");
                break;
        }
index beebdc4..340958e 100644 (file)
@@ -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;
index 011e217..db76a64 100644 (file)
@@ -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])
index 1017c5b..d416353 100644 (file)
@@ -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&amp;action=login";
                                LOAD_URL($URL);
-                       }
+                       } // END - if
                        break;
                }
        }
index 9a81ae8..db0af35 100644 (file)
@@ -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 .= "<FONT class=\"admin_failed medium\">".ADMIN_UNKNOWN_SUPPORT_MODE_1.$mode.ADMIN_UNKNOWN_SUPPORT_MODE_2."</FONT>\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 .= "<FONT class=\"admin_failed medium\">".ADMIN_UNKNOWN_TASK_TYPE_1.$type.ADMIN_UNKNOWN_TASK_TYPE_2.$id.ADMIN_UNKNOWN_TASK_TYPE_3."</FONT>\n";
                                        break;
                                }
index 75045ef..688b575 100644 (file)
@@ -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__);
index 5ab5c8e..631eef7 100644 (file)
@@ -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;
                        }
index cf7ed37..dc1d4ba 100644 (file)
@@ -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;
        }
index 251cf29..22dd312 100644 (file)
@@ -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;
 }
index efaf745..6dddc59 100644 (file)
@@ -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;
                }
index c38e2e5..542db3e 100644 (file)
@@ -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;
        }
 
index d3af4b3..9e61d12 100644 (file)
@@ -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 = "<TABLE border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"300\" class=\"left2 right2 top2\">\n";
                $SW = 2;
@@ -381,16 +376,14 @@ ORDER BY pay_name", __FILE__, __LINE__);
   <STRONG><FONT class=\"guest_failed\">".SPONSOR_REGISTER_SOMETHING_MISSING.":</FONT></STRONG><br />
 </P>
 <OL>\n";
-                       foreach ($FORM_ERRORS as $error)
-                       {
+                       foreach ($FORM_ERRORS as $error) {
                                $OUT .= "<LI>".$error."</LI>\n";
-                       }
+                       } // END - if
+
                        $OUT .= "</OL><br />\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);
        }
index 9ca58e5..5928f54 100644 (file)
@@ -54,6 +54,7 @@ if ($status != "CONFIRMED") {
                break;
 
        default:
+               DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown status %s detected.", $status));
                $ERROR = CODE_UNKNOWN_STATUS;
                break;
        }
index 848b54f..8213cb1 100644 (file)
@@ -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  = "<SELECT name=\"country_code\" class=\"member_select\" size=\"1\">\n";
                        $whereStatement = "WHERE is_active='Y'";
@@ -180,9 +180,7 @@ FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
                        $OUT .= ADD_OPTION_LINES("countries", "id", "descr", $DATA[3], "code", $whereStatement);
                        $OUT .= "</SELECT>";
                        define('__COUNTRY_CONTENT', $OUT);
-               }
-                else
-               {
+               } else {
                        // Ouput default input box
                        define('__COUNTRY_CONTENT', "<INPUT type=\"text\" name=\"cntry\" class=\"member_normal\" size=\"2\" maxlength=\"3\" value=\"".$DATA[3]."\">");
                }
index 1f216e1..51c11ef 100644 (file)
@@ -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
index 7b8343d..ad350d1 100644 (file)
@@ -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']));
index f38498b..eba573e 100644 (file)
@@ -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']));
index e92f1e4..093ea4e 100644 (file)
@@ -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."<STRONG><A class=\"you_are_here\" href=\"".URL."/modules.php?module=".$MOD_CHECK."&amp;".$type."=".$search.$LINK_ADD."\">".$ret."</A></STRONG>\n";
+                       $OUT = $prefix."<STRONG><A class=\"you_are_here\" href=\"".URL."/modules.php?module=".$modCheck."&amp;".$type."=".$search.$LINK_ADD."\">".$ret."</A></STRONG>\n";
 
                        // Can we close the you-are-here navigation?
                        //* DEBUG: */ echo __LINE__."*".$type."/".$GLOBALS['what']."*<br />\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 = "<STRONG><SPAN class=\"member_failed\">".UNKNOWN_MODULE."</SPAN></STRONG>";
                                        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."!<br />\n";
-       switch ($MOD_CHECK)
+       //* DEBUG: */ echo __LINE__."!".$modCheck."!<br />\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:
index fcb310d..a913ef0 100644 (file)
@@ -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&amp;msg=".CODE_UNKNOWN_STATUS."&amp;ext=mailid");
                                break;
                }
index 3787101..78bf8c7 100644 (file)
@@ -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");