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);
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)) {
$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;
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;
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;
break;
default:
+ DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown status %s detected.", $status));
$ret = UNKNOWN_STATUS_1.$status.UNKNOWN_STATUS_2;
break;
}
break;
default:
+ DEBUG_LOG(__FILE__, __LINE__, sprintf("Wrong page %s detected.", $_GET['page']));
OUTPUT_HTML(" <STRONG class=\"install_error\">".WRONG_PAGE."</STRONG>");
break;
}
break;
default:
+ DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown status %s detected.", $status));
$ret = UNKNOWN_STATUS_1.$status.UNKNOWN_STATUS_2;
break;
}
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;
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])
$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);
// Load URL for login
$URL = URL."/modules.php?module=admin&action=login";
LOAD_URL($URL);
- }
+ } // END - if
break;
}
}
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;
}
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;
}
// 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);
$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__);
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;
}
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;
}
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;
}
break;
default:
+ DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown error status %s detected.", $status));
$ERROR = CODE_UNKNOWN_STATUS;
break;
}
break;
default:
+ DEBUG_LOG(__FILE__, __LINE__, sprintf("Unhandled error code %s detected.", $ERROR));
$MSG .= LOGIN_WRONG_ID;
break;
}
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;
}
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;
}
// 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;
<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' , "");
}
// 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);
}
break;
default:
+ DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown status %s detected.", $status));
$ERROR = CODE_UNKNOWN_STATUS;
break;
}
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'";
$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]."\">");
}
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);
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
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']));
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']));
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)";
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'";
}
// 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)) {
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."&".$type."=".$search.$LINK_ADD."\">".$ret."</A></STRONG>\n";
+ $OUT = $prefix."<STRONG><A class=\"you_are_here\" href=\"".URL."/modules.php?module=".$modCheck."&".$type."=".$search.$LINK_ADD."\">".$ret."</A></STRONG>\n";
// Can we close the you-are-here navigation?
//* DEBUG: */ echo __LINE__."*".$type."/".$GLOBALS['what']."*<br />\n";
break;
default:
+ DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown mode %s detected.", $mode));
$content = MEMBER_UNKNOWN_MODE.": ".$mode."\n\n";
break;
}
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
break;
default:
+ DEBUG_LOG(__FILE__, __LINE__, sprintf("Unsupported module %s detected.", $mod));
$content = "<STRONG><SPAN class=\"member_failed\">".UNKNOWN_MODULE."</SPAN></STRONG>";
break;
}
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";
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:
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;
}
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);
}
//
// Everything is okay so we can load the module
include (__MODULE);
-}
+} // END - if
// Next-to-end add the footer
include (PATH."inc/footer.php");