From: Roland Häder Date: Mon, 9 Mar 2009 08:29:22 +0000 (+0000) Subject: A lot variables renamed from all upper-case to hungarian notation X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=e98608bf2a6208376d30996cf9152e1f091ac369;p=mailer.git A lot variables renamed from all upper-case to hungarian notation --- diff --git a/inc/functions.php b/inc/functions.php index 28748b0e56..1dc08094e8 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -386,68 +386,68 @@ function LOAD_TEMPLATE ($template, $return=false, $content=array()) { } // Send mail out to an email address -function SEND_EMAIL($TO, $SUBJECT, $MSG, $HTML = "N", $FROM = "") { - //* DEBUG: */ print __FUNCTION__."(".__LINE__."):TO={$TO},SUBJECT={$SUBJECT}
\n"; +function SEND_EMAIL($toEmail, $subject, $message, $HTML = "N", $mailHeader = "") { + //* DEBUG: */ print __FUNCTION__."(".__LINE__."):TO={$toEmail},SUBJECT={$subject}
\n"; // Compile subject line (for POINTS constant etc.) - $eval = "\$SUBJECT = decodeEntities(\"".COMPILE_CODE(smartAddSlashes($SUBJECT))."\");"; + $eval = "\$subject = decodeEntities(\"".COMPILE_CODE(smartAddSlashes($subject))."\");"; eval($eval); // Set from header - if ((!eregi("@", $TO)) && ($TO > 0)) { + if ((!eregi("@", $toEmail)) && ($toEmail > 0)) { // Value detected, is the message extension installed? if (EXT_IS_ACTIVE("msg")) { - ADD_MESSAGE_TO_BOX($TO, $SUBJECT, $MSG, $HTML); + ADD_MESSAGE_TO_BOX($toEmail, $subject, $message, $HTML); return; } else { // Load email address - $result_email = SQL_QUERY_ESC("SELECT email FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array(bigintval($TO)), __FUNCTION__, __LINE__); + $result_email = SQL_QUERY_ESC("SELECT email FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array(bigintval($toEmail)), __FUNCTION__, __LINE__); //* DEBUG: */ print __FUNCTION__."(".__LINE__."):numRows=".SQL_NUMROWS($result_email)."
\n"; // Does the user exist? if (SQL_NUMROWS($result_email)) { // Load email address - list($TO) = SQL_FETCHROW($result_email); + list($toEmail) = SQL_FETCHROW($result_email); } else { // Set webmaster - $TO = constant('WEBMASTER'); + $toEmail = constant('WEBMASTER'); } // Free result SQL_FREERESULT($result_email); } - } elseif ("$TO" == "0") { + } elseif ("$toEmail" == "0") { // Is the webmaster! - $TO = constant('WEBMASTER'); + $toEmail = constant('WEBMASTER'); } - //* DEBUG: */ print __FUNCTION__."(".__LINE__."):TO={$TO}
\n"; + //* DEBUG: */ print __FUNCTION__."(".__LINE__."):TO={$toEmail}
\n"; // Check for PHPMailer or debug-mode if (!CHECK_PHPMAILER_USAGE()) { // Not in PHPMailer-Mode - if (empty($FROM)) { + if (empty($mailHeader)) { // Load email header template - $FROM = LOAD_EMAIL_TEMPLATE("header"); + $mailHeader = LOAD_EMAIL_TEMPLATE("header"); } else { // Append header - $FROM .= LOAD_EMAIL_TEMPLATE("header"); + $mailHeader .= LOAD_EMAIL_TEMPLATE("header"); } } elseif (isDebugModeEnabled()) { - if (empty($FROM)) { + if (empty($mailHeader)) { // Load email header template - $FROM = LOAD_EMAIL_TEMPLATE("header"); + $mailHeader = LOAD_EMAIL_TEMPLATE("header"); } else { // Append header - $FROM .= LOAD_EMAIL_TEMPLATE("header"); + $mailHeader .= LOAD_EMAIL_TEMPLATE("header"); } } // Compile "TO" - $eval = "\$TO = \"".COMPILE_CODE(smartAddSlashes($TO))."\";"; + $eval = "\$toEmail = \"".COMPILE_CODE(smartAddSlashes($toEmail))."\";"; eval($eval); // Compile "MSG" - $eval = "\$MSG = \"".COMPILE_CODE(smartAddSlashes($MSG))."\";"; + $eval = "\$message = \"".COMPILE_CODE(smartAddSlashes($message))."\";"; eval($eval); // Fix HTML parameter (default is no!) @@ -455,20 +455,20 @@ function SEND_EMAIL($TO, $SUBJECT, $MSG, $HTML = "N", $FROM = "") { if (isDebugModeEnabled()) { // In debug mode we want to display the mail instead of sending it away so we can debug this part print("
-".htmlentities(trim($FROM))."
-To      : ".$TO."
-Subject : ".$SUBJECT."
-Message : ".$MSG."
+".htmlentities(trim($mailHeader))."
+To      : ".$toEmail."
+Subject : ".$subject."
+Message : ".$message."
 
\n"); } elseif (($HTML == "Y") && (EXT_IS_ACTIVE("html_mail"))) { // Send mail as HTML away - SEND_HTML_EMAIL($TO, $SUBJECT, $MSG, $FROM); - } elseif (!empty($TO)) { + SEND_HTML_EMAIL($toEmail, $subject, $message, $mailHeader); + } elseif (!empty($toEmail)) { // Send Mail away - SEND_RAW_EMAIL($TO, $SUBJECT, $MSG, $FROM); + SEND_RAW_EMAIL($toEmail, $subject, $message, $mailHeader); } elseif ($HTML == "N") { // Problem found! - SEND_RAW_EMAIL(constant('WEBMASTER'), "[PROBLEM:]".$SUBJECT, $MSG, $FROM); + SEND_RAW_EMAIL(constant('WEBMASTER'), "[PROBLEM:]".$subject, $message, $mailHeader); } } @@ -482,7 +482,7 @@ function CHECK_PHPMAILER_USAGE() { /* * Send out a raw email with PHPMailer class or legacy mail() command */ -function SEND_RAW_EMAIL ($to, $subject, $msg, $from) { +function SEND_RAW_EMAIL ($toEmail, $subject, $msg, $from) { // Shall we use PHPMailer class or legacy mode? if (CHECK_PHPMAILER_USAGE()) { // Use PHPMailer class with SMTP enabled @@ -514,14 +514,14 @@ function SEND_RAW_EMAIL ($to, $subject, $msg, $from) { } else { $mail->Body = decodeEntities($msg); } - $mail->AddAddress($to, ""); + $mail->AddAddress($toEmail, ""); $mail->AddReplyTo(constant('WEBMASTER'), constant('MAIN_TITLE')); $mail->AddCustomHeader("Errors-To:".constant('WEBMASTER')); $mail->AddCustomHeader("X-Loop:".constant('WEBMASTER')); $mail->Send(); } else { // Use legacy mail() command - @mail($to, $subject, decodeEntities($msg), $from); + @mail($toEmail, $subject, decodeEntities($msg), $from); } } // @@ -976,13 +976,14 @@ function COMPILE_CODE ($code, $simple = false, $constants = true, $full = true) return $code; } // END - if - $ARRAY = $GLOBALS['security_chars']; + // Init replacement-array with full security characters + $secChars = $GLOBALS['security_chars']; // Select smaller set of chars to replace when we e.g. want to compile URLs - if (!$full) $ARRAY = $GLOBALS['url_chars']; + if (!$full) $secChars = $GLOBALS['url_chars']; // Compile constants - if ($constants) { + if ($constants === true) { // BEFORE 0.2.1 : Language and data constants // WITH 0.2.1+ : Only language constants $code = str_replace('{--','".', str_replace('--}','."', $code)); @@ -993,16 +994,16 @@ function COMPILE_CODE ($code, $simple = false, $constants = true, $full = true) } // END - if // Compile QUOT and other non-HTML codes - foreach ($ARRAY['to'] as $k => $to) { + foreach ($secChars['to'] as $k => $to) { // Do the reversed thing as in inc/libs/security_functions.php - $code = str_replace($to, $ARRAY['from'][$k], $code); + $code = str_replace($to, $secChars['from'][$k], $code); } // END - foreach // But shall I keep simple quotes for later use? if ($simple) $code = str_replace("'", '{QUOT}', $code); // Find $content[bla][blub] entries - @preg_match_all('/\$(content|DATA)((\[([a-zA-Z0-9-_]+)\])*)/', $code, $matches); + preg_match_all('/\$(content|DATA)((\[([a-zA-Z0-9-_]+)\])*)/', $code, $matches); // Are some matches found? if ((count($matches) > 0) && (count($matches[0]) > 0)) { diff --git a/inc/libs/admins_functions.php b/inc/libs/admins_functions.php index 67a2a21a5d..eed4dec958 100644 --- a/inc/libs/admins_functions.php +++ b/inc/libs/admins_functions.php @@ -240,15 +240,15 @@ WHERE id=%s LIMIT 1", CACHE_PURGE_ADMIN_MENU($id); // Admin account saved - $MSG = ADMIN_ACCOUNT_SAVED; + $message = ADMIN_ACCOUNT_SAVED; } else { // Passwords did not match - $MSG = ADMINS_ERROR_PASS_MISMATCH; + $message = ADMINS_ERROR_PASS_MISMATCH; } // Display message - if (!empty($MSG)) { - LOAD_TEMPLATE("admin_settings_saved", false, $MSG); + if (!empty($message)) { + LOAD_TEMPLATE("admin_settings_saved", false, $message); } } diff --git a/inc/libs/html_mail_functions.php b/inc/libs/html_mail_functions.php index 488c765294..7f607f7e2f 100644 --- a/inc/libs/html_mail_functions.php +++ b/inc/libs/html_mail_functions.php @@ -156,13 +156,13 @@ function HTML_INSERT_URLS ($text) { return COMPILE_CODE(str_replace("\n", "
\n", $text)); } // -function SEND_HTML_EMAIL($TO, $SUBJECT, $MSG, $FROM) +function SEND_HTML_EMAIL($TO, $SUBJECT, $message, $FROM) { if (EXT_IS_ACTIVE("html_mail")) { // Send mail away as HTML $FROM = "Content-Type: text/html\n".$FROM; - SEND_EMAIL($TO, $SUBJECT, $MSG, 'N', $FROM); + SEND_EMAIL($TO, $SUBJECT, $message, 'N', $FROM); } } // diff --git a/inc/libs/newsletter_functions.php b/inc/libs/newsletter_functions.php index dfc732a9dd..ee7663e7aa 100644 --- a/inc/libs/newsletter_functions.php +++ b/inc/libs/newsletter_functions.php @@ -153,23 +153,23 @@ function NL_INSERT_URLS ($text) { } // -function SEND_NEWSLETTER ($TO, $SUBJECT, $MSG, $MODE) { +function SEND_NEWSLETTER ($TO, $SUBJECT, $message, $MODE) { // Send mail away as HTML if (REQUEST_POST('auto_urls') == "Y") { // Automatically insert URLs into newsletter if ((EXT_IS_ACTIVE("html")) && ($MODE == "html")) { // Send HTML mail - SEND_EMAIL($TO, $SUBJECT, HTML_INSERT_URLS($MSG), "Y"); + SEND_EMAIL($TO, $SUBJECT, HTML_INSERT_URLS($message), "Y"); } else { // Send normal mail - SEND_EMAIL($TO, $SUBJECT, NL_INSERT_URLS($MSG), "N"); + SEND_EMAIL($TO, $SUBJECT, NL_INSERT_URLS($message), "N"); } } else { // Regular send-out if ((EXT_IS_ACTIVE("html")) && ($MODE == "html")) { - SEND_EMAIL($TO, $SUBJECT, $MSG, "Y"); + SEND_EMAIL($TO, $SUBJECT, $message, "Y"); } else { - SEND_EMAIL($TO, $SUBJECT, $MSG, "N"); + SEND_EMAIL($TO, $SUBJECT, $message, "N"); } } } diff --git a/inc/libs/sponsor_functions.php b/inc/libs/sponsor_functions.php index e40b25ad7f..e76834d86d 100644 --- a/inc/libs/sponsor_functions.php +++ b/inc/libs/sponsor_functions.php @@ -42,7 +42,7 @@ if (!defined('__SECURITY')) { } // -function SPONSOR_HANDLE_SPONSOR (&$POST, $NO_UPDATE=false, $MSGs=array(), $RET_STATUS=false) { +function SPONSOR_HANDLE_SPONSOR (&$POST, $NO_UPDATE=false, $messageArray=array(), $RET_STATUS=false) { // Init a lot variables $SAVE = true; $UPDATE = false; @@ -125,7 +125,7 @@ function SPONSOR_HANDLE_SPONSOR (&$POST, $NO_UPDATE=false, $MSGs=array(), $RET_S if ((empty($POST['force'])) || (!IS_ADMIN())) $POST['force'] = 0; // SQL and message string is empty by default - $sql = ""; $MSG = ""; + $sql = ""; $message = ""; // Update? if ($UPDATE) { @@ -140,7 +140,7 @@ function SPONSOR_HANDLE_SPONSOR (&$POST, $NO_UPDATE=false, $MSGs=array(), $RET_S $DATA['values'][] = bigintval(REQUEST_GET('id')); // Generate message - $MSG = SPONSOR_GET_MESSAGE(ADMIN_SPONSOR_UPDATED, "updated", $MSGs); + $message = SPONSOR_GET_MESSAGE(ADMIN_SPONSOR_UPDATED, "updated", $messageArray); $ret = "updated"; } elseif ((!$ALREADY) || (($POST['force'] == "1") && (IS_ADMIN()))) { // Add new sponsor, first add more data @@ -168,7 +168,7 @@ function SPONSOR_HANDLE_SPONSOR (&$POST, $NO_UPDATE=false, $MSGs=array(), $RET_S $sql = "INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_data` (".$KEYS.") VALUES ('".$VALUES."%s')"; // Generate message - $MSG = SPONSOR_GET_MESSAGE(getMessage('ADMIN_SPONSOR_ADDED'), "added", $MSGs); + $message = SPONSOR_GET_MESSAGE(getMessage('ADMIN_SPONSOR_ADDED'), "added", $messageArray); $ret = "added"; } elseif ((!$NO_UPDATE) && (IS_ADMIN())) { // Add all data as hidden data @@ -187,7 +187,7 @@ function SPONSOR_HANDLE_SPONSOR (&$POST, $NO_UPDATE=false, $MSGs=array(), $RET_S return; } else { // Already added! - $MSG = sprintf(getMessage('SPONSOR_ALREADY_FOUND', $POST['email'])); + $message = sprintf(getMessage('SPONSOR_ALREADY_FOUND', $POST['email'])); $ret = "already"; } @@ -198,12 +198,12 @@ function SPONSOR_HANDLE_SPONSOR (&$POST, $NO_UPDATE=false, $MSGs=array(), $RET_S // Output message if ((!$NO_UPDATE) && (IS_ADMIN())) { - LOAD_TEMPLATE("admin_settings_saved", false, $MSG); + LOAD_TEMPLATE("admin_settings_saved", false, $message); } } else { // Error found! - $MSG = SPONSOR_GET_MESSAGE(getMessage('SPONSOR_DATA_NOT_SAVED'), "failed", $MSGs); - LOAD_TEMPLATE("admin_settings_saved", false, $MSG); + $message = SPONSOR_GET_MESSAGE(getMessage('SPONSOR_DATA_NOT_SAVED'), "failed", $messageArray); + LOAD_TEMPLATE("admin_settings_saved", false, $message); } // Shall we return the status? @@ -382,7 +382,7 @@ function SPONSOR_SAVE_DATA ($POST, $content) { 'ok', 'pass1', 'pass2'); // Set default message ("not saved") - $MSG = getMessage('SPONSOR_ACCOUNT_DATA_NOT_SAVED'); + $message = getMessage('SPONSOR_ACCOUNT_DATA_NOT_SAVED'); // Check for submitted passwords if ((!empty($POST['pass1'])) && (!empty($POST['pass2']))) { @@ -443,11 +443,11 @@ function SPONSOR_SAVE_DATA ($POST, $content) { { case "account": // Change account data if ($EMAIL === true) { - $MSG = getMessage('SPONSOR_ACCOUNT_EMAIL_CHANGED'); + $message = getMessage('SPONSOR_ACCOUNT_EMAIL_CHANGED'); $templ = "admin_sponsor_change_email"; $subj = getMessage('ADMIN_SPONSOR_ACC_EMAIL_SUBJ'); } else { - $MSG = getMessage('SPONSOR_ACCOUNT_DATA_SAVED'); + $message = getMessage('SPONSOR_ACCOUNT_DATA_SAVED'); $templ = "admin_sponsor_change_data"; $subj = getMessage('ADMIN_SPONSOR_ACC_DATA_SUBJ'); } @@ -459,14 +459,14 @@ function SPONSOR_SAVE_DATA ($POST, $content) { $content['interval'] = CREATE_FANCY_TIME($content['warning_interval']); // Set message template and subject for admin - $MSG = getMessage('SPONSOR_SETTINGS_SAVED'); + $message = getMessage('SPONSOR_SETTINGS_SAVED'); $templ = "admin_sponsor_settings"; $subj = getMessage('ADMIN_SPONSOR_SETTINGS_SUBJ'); break; default: // Unknown sponsor what value! DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("Unknown sponsor module (what) %s detected.", $GLOBALS['what'])); - $MSG = sprintf(getMessage('SPONSOR_UNKNOWN_WHAT'), $GLOBALS['what']); + $message = sprintf(getMessage('SPONSOR_UNKNOWN_WHAT'), $GLOBALS['what']); $templ = ""; $subj = ""; break; } @@ -522,7 +522,7 @@ function SPONSOR_SAVE_DATA ($POST, $content) { } // END - if // Return final message - return $MSG; + return $message; } // diff --git a/inc/mails/beg_mails.php b/inc/mails/beg_mails.php index d40b73ec79..d005627783 100644 --- a/inc/mails/beg_mails.php +++ b/inc/mails/beg_mails.php @@ -113,7 +113,7 @@ if (!empty($sql)) { $SUBJECT = constant('BEG_RALLYE_'.strtoupper($MODE).'_NOTIFY'); // Load message body for bonus mails - $MSG = LOAD_EMAIL_TEMPLATE("beg_en_notify_body", "", "{PER}uid{PER}"); + $message = LOAD_EMAIL_TEMPLATE("beg_en_notify_body", "", "{PER}uid{PER}"); $RECEIVER = ""; $UIDs = array(); // Okay lets notify all users! @@ -131,8 +131,8 @@ LIMIT 1", $UIDs[] = $content['userid']; } else { // Send normal notification mail to the members - $MSG = LOAD_EMAIL_TEMPLATE("beg_".$MODE."_notify", array(), $content['userid']); - SEND_EMAIL($content['email'], $SUBJECT, $MSG); + $message = LOAD_EMAIL_TEMPLATE("beg_".$MODE."_notify", array(), $content['userid']); + SEND_EMAIL($content['email'], $SUBJECT, $message); } } // END - while @@ -145,7 +145,7 @@ LIMIT 1", $URL = "modules.php?module=index&what=login"; // Insert mail - ADD_BONUS_MAIL_TO_QUEUE($SUBJECT, $MSG, $RECEIVER, getConfig('beg_notify_bonus'), getConfig('beg_notify_wait'), $URL, 0, "normal", SQL_NUMROWS($result_main)); + ADD_BONUS_MAIL_TO_QUEUE($SUBJECT, $message, $RECEIVER, getConfig('beg_notify_bonus'), getConfig('beg_notify_wait'), $URL, 0, "normal", SQL_NUMROWS($result_main)); } // END - if } // END - if diff --git a/inc/mails/bonus_mails.php b/inc/mails/bonus_mails.php index 3e52f2df2b..97b9ef6755 100644 --- a/inc/mails/bonus_mails.php +++ b/inc/mails/bonus_mails.php @@ -89,7 +89,7 @@ if (!empty($sql)) { $SUBJECT = constant('BONUS_RALLYE_'.strtoupper($MODE).'_NOTIFY'); // Load message body for bonus mails - $MSG = LOAD_EMAIL_TEMPLATE("bonus_en_notify_body", "", "{PER}uid{PER}"); + $message = LOAD_EMAIL_TEMPLATE("bonus_en_notify_body", "", "{PER}uid{PER}"); $RECEIVER = ""; $UIDs = array(); // Check for accounts to be notified @@ -110,8 +110,8 @@ LIMIT 1", $UIDs[] = $content['userid']; } else { // Send normal notification mail to the members - $MSG = LOAD_EMAIL_TEMPLATE("bonus_".$MODE."_notify", array(), $content['userid']); - SEND_EMAIL($content['email'], $SUBJECT, $MSG); + $message = LOAD_EMAIL_TEMPLATE("bonus_".$MODE."_notify", array(), $content['userid']); + SEND_EMAIL($content['email'], $SUBJECT, $message); } } // END - while @@ -124,7 +124,7 @@ LIMIT 1", $URL = "modules.php?module=index&what=login"; // Insert mail - ADD_BONUS_MAIL_TO_QUEUE($SUBJECT, $MSG, $RECEIVER, getConfig('bonus_notify_points'), getConfig('bonus_notify_wait'), $URL, 0, "normal", SQL_NUMROWS($result_main)); + ADD_BONUS_MAIL_TO_QUEUE($SUBJECT, $message, $RECEIVER, getConfig('bonus_notify_points'), getConfig('bonus_notify_wait'), $URL, 0, "normal", SQL_NUMROWS($result_main)); } // END - if } // END - if diff --git a/inc/modules/admin.php b/inc/modules/admin.php index 42a9860dcb..2d9fc975f8 100644 --- a/inc/modules/admin.php +++ b/inc/modules/admin.php @@ -119,23 +119,23 @@ if (!isAdminRegistered()) { // Yet-another "Notice" fix if ((IS_FORM_SENT()) && (REQUEST_POST('ok') == "***")) { // No login entered? - if (!REQUEST_ISSET_POST(('login'))) $MSG1 = getMessage('ADMIN_NO_LOGIN'); + if (!REQUEST_ISSET_POST(('login'))) $loginMessage = getMessage('ADMIN_NO_LOGIN'); // An error comes back from registration? - if (!empty($ret)) $MSG1 = $ret; + if (!empty($ret)) $loginMessage = $ret; // No password entered? - if (!REQUEST_ISSET_POST(('pass'))) $MSG2 = getMessage('ADMIN_NO_PASS'); + if (!REQUEST_ISSET_POST(('pass'))) $passwdMessage = getMessage('ADMIN_NO_PASS'); // Or password too short? - if (strlen(REQUEST_POST('pass')) < 4) $MSG2 = getMessage('ADMIN_SHORT_PASS'); + if (strlen(REQUEST_POST('pass')) < 4) $passwdMessage = getMessage('ADMIN_SHORT_PASS'); // Output error messages - define('__MSG_LOGIN', LOAD_TEMPLATE("admin_login_msg", true, $MSG1)); - define('__MSG_PASS', LOAD_TEMPLATE("admin_login_msg", true, $MSG2)); + define('__MSG_LOGIN', LOAD_TEMPLATE("admin_login_msg", true, $loginMessage)); + define('__MSG_PASS', LOAD_TEMPLATE("admin_login_msg", true, $passwdMessage)); // Reset variables - $MSG1 = ""; $MSG2 = ""; + $loginMessage = ""; $passwdMessage = ""; } else { // Reset values to nothing define('__MSG_LOGIN', ""); @@ -251,6 +251,7 @@ if (!isAdminRegistered()) { } // END - if // Error detected? + // @TODO Rewrite all these constants if ($ret != "done") { if (REQUEST_ISSET_POST(('login'))) { define('__LOGIN_VALUE', REQUEST_POST('login')); @@ -260,30 +261,31 @@ if (!isAdminRegistered()) { if (IS_FORM_SENT()) { // Set messages to zero - $MSG1 = ""; $MSG2 = ""; + $loginMessage = ""; $passwdMessage = ""; // No login entered? - if (!REQUEST_ISSET_POST(('login'))) $MSG1 = getMessage('ADMIN_NO_LOGIN'); + if (!REQUEST_ISSET_POST(('login'))) $loginMessage = getMessage('ADMIN_NO_LOGIN'); // An error comes back from login? - if ((!empty($ret)) && (REQUEST_POST('ok') == "404")) $MSG1 = $ret; + if ((!empty($ret)) && (REQUEST_POST('ok') == "404")) $loginMessage = $ret; // No password entered? - if (!REQUEST_ISSET_POST(('pass'))) $MSG2 = getMessage('ADMIN_NO_PASS'); + if (!REQUEST_ISSET_POST(('pass'))) $passwdMessage = getMessage('ADMIN_NO_PASS'); // Or password too short? - if (strlen(REQUEST_POST('pass')) < 4) $MSG2 = getMessage('ADMIN_SHORT_PASS'); + if (strlen(REQUEST_POST('pass')) < 4) $passwdMessage = getMessage('ADMIN_SHORT_PASS'); // An error comes back from login? - if ((!empty($ret)) && (REQUEST_POST('ok') == "pass")) $MSG2 = $ret; + if ((!empty($ret)) && (REQUEST_POST('ok') == "pass")) $passwdMessage = $ret; // Load message template - define('__MSG_LOGIN', LOAD_TEMPLATE("admin_login_msg", true, $MSG1)); - define('__MSG_PASS' , LOAD_TEMPLATE("admin_login_msg", true, $MSG2)); + define('__MSG_LOGIN', LOAD_TEMPLATE("admin_login_msg", true, $loginMessage)); + define('__MSG_PASS' , LOAD_TEMPLATE("admin_login_msg", true, $passwdMessage)); // Reset variables - $MSG1 = ""; $MSG2 = ""; - } else { + unset($loginMessage); + unset($passwdMessage); + } else { // Set constants to empty for hiding them define('__MSG_LOGIN', ""); define('__MSG_PASS' , ""); diff --git a/inc/modules/admin/what-del_holiday.php b/inc/modules/admin/what-del_holiday.php index 07c0775ede..0ffaeabb93 100644 --- a/inc/modules/admin/what-del_holiday.php +++ b/inc/modules/admin/what-del_holiday.php @@ -90,7 +90,7 @@ WHERE id=%s LIMIT 1", array(bigintval($id)), __FILE__, __LINE__); LOAD_TEMPLATE("admin_settings_saved", false, sprintf(getMessage('HOLIDAY_ADMIN_MULTI_DEL'), $cnt)); } elseif (REQUEST_ISSET_GET(('uid'))) { // Set default message - $MSG = getMessage('HOLIDAY_ADMIN_SINGLE_404'); + $message = getMessage('HOLIDAY_ADMIN_SINGLE_404'); // Fetch data $result_load = SQL_QUERY_ESC("SELECT holiday_start AS start, holiday_end AS end @@ -109,14 +109,14 @@ WHERE userid=%s LIMIT 1", array(bigintval(REQUEST_GET('uid'))), __FILE__, __LINE SEND_EMAIL(REQUEST_GET('uid'), getMessage('HOLIDAY_ADMIN_REMOVED_SUBJ'), $msg); // Set message - $MSG = getMessage('HOLIDAY_ADMIN_SINGLE_DELETED'); + $message = getMessage('HOLIDAY_ADMIN_SINGLE_DELETED'); } // Free memory SQL_FREERESULT($result_load); // Output message - LOAD_TEMPLATE("admin_settings_saved", false, $MSG); + LOAD_TEMPLATE("admin_settings_saved", false, $message); } else { // Please call me over other scripts... ;) LOAD_TEMPLATE("admin_settings_saved", false, getMessage('HOLIDAY_NO_DIRECT_CALL')); diff --git a/inc/modules/admin/what-edit_sponsor.php b/inc/modules/admin/what-edit_sponsor.php index 61ff5406ad..09e1625750 100644 --- a/inc/modules/admin/what-edit_sponsor.php +++ b/inc/modules/admin/what-edit_sponsor.php @@ -124,10 +124,10 @@ if ((REQUEST_ISSET_GET(('id'))) && (REQUEST_ISSET_GET(('mode')))) { // Send email $msg = LOAD_EMAIL_TEMPLATE("sponsor_add_points", REQUEST_POST('reason'), true); SEND_EMAIL(__EMAIL, ADMIN_SPONSOR_ADD_POINTS_SUBJ, $msg); - $MSG = ADMIN_SPONSOR_POINTS_ADDED; + $message = ADMIN_SPONSOR_POINTS_ADDED; } else { // No points entered to add! - $MSG = ADMIN_SPONSPOR_NO_POINTS_TO_ADD; + $message = ADMIN_SPONSPOR_NO_POINTS_TO_ADD; } break; @@ -147,10 +147,10 @@ if ((REQUEST_ISSET_GET(('id'))) && (REQUEST_ISSET_GET(('mode')))) { // Send email $msg = LOAD_EMAIL_TEMPLATE("sponsor_sub_points", REQUEST_POST('reason'), true); SEND_EMAIL(__EMAIL, ADMIN_SPONSOR_SUB_POINTS_SUBJ, $msg); - $MSG = ADMIN_SPONSOR_POINTS_SUBTRACTED; + $message = ADMIN_SPONSOR_POINTS_SUBTRACTED; } else { // No points entered to add! - $MSG = ADMIN_SPONSPOR_NO_POINTS_TO_SUBTRACT; + $message = ADMIN_SPONSPOR_NO_POINTS_TO_SUBTRACT; } break; @@ -183,13 +183,13 @@ if ((REQUEST_ISSET_GET(('id'))) && (REQUEST_ISSET_GET(('mode')))) { default: // Unknown mode DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown mode %s detected.", REQUEST_GET('mode'))); - $MSG = sprintf(getMessage('ADMIN_SPONSOR_INVALID_MODE'), REQUEST_GET(('mode'))); + $message = sprintf(getMessage('ADMIN_SPONSOR_INVALID_MODE'), REQUEST_GET(('mode'))); break; } - if (!empty($MSG)) { + if (!empty($message)) { // Output message - LOAD_TEMPLATE("admin_settings_saved", false, $MSG); + LOAD_TEMPLATE("admin_settings_saved", false, $message); } // END - if } elseif (FILE_READABLE(sprintf("%stemplates/%s/html/admin/%s.tpl", constant('PATH'), GET_LANGUAGE(), $TPL))) { // Create mailto link diff --git a/inc/modules/admin/what-list_country.php b/inc/modules/admin/what-list_country.php index 2bcf66f4fa..2a151aa1e7 100644 --- a/inc/modules/admin/what-list_country.php +++ b/inc/modules/admin/what-list_country.php @@ -60,17 +60,17 @@ if ((REQUEST_ISSET_POST(('add'))) && (REQUEST_ISSET_POST(('code'))) && (REQUEST_ ), __FILE__, __LINE__); // Country added - $MSG = sprintf(getMessage('ADMIN_COUNTRY_ADDED'), strtoupper(REQUEST_POST('descr'))); + $message = sprintf(getMessage('ADMIN_COUNTRY_ADDED'), strtoupper(REQUEST_POST('descr'))); } else { // Free memory SQL_FREERESULT($result); // Does already exist - $MSG = sprintf(getMessage('ADMIN_COUNTRY_ALREADY'), strtoupper(REQUEST_POST('code'))); + $message = sprintf(getMessage('ADMIN_COUNTRY_ALREADY'), strtoupper(REQUEST_POST('code'))); } // Display message - LOAD_TEMPLATE("admin_settings_saved", false, $MSG); + LOAD_TEMPLATE("admin_settings_saved", false, $message); } elseif ((REQUEST_ISSET_POST('change')) && (REQUEST_ISSET_POST(('id')))) { // Change all status ADMIN_CHANGE_ACTIVATION_STATUS(REQUEST_POST('id'), "countries", "is_active"); @@ -144,7 +144,7 @@ if ((REQUEST_ISSET_POST(('add'))) && (REQUEST_ISSET_POST(('code'))) && (REQUEST_ } } else { // Shall we modify / remove entries now? - $MSG = ""; INIT_SQLS(); + $message = ""; INIT_SQLS(); if ((REQUEST_ISSET_POST(('modify'))) && (REQUEST_ISSET_POST(('id')))) { // Modify foreach (REQUEST_POST('id') as $id => $sel) { @@ -152,22 +152,22 @@ if ((REQUEST_ISSET_POST(('add'))) && (REQUEST_ISSET_POST(('code'))) && (REQUEST_ } // Create message - $MSG = getMessage('ADMIN_COUNTRIES_MODIFIED'); + $message = getMessage('ADMIN_COUNTRIES_MODIFIED'); } elseif ((REQUEST_ISSET_POST('remove')) && (REQUEST_ISSET_POST(('id')))) { // Remove $IDs = implode(",", array_keys(REQUEST_POST('id'))); ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_countries` WHERE id IN (".$IDs.") LIMIT ".count(REQUEST_POST('id')).""); // Create message - $MSG = getMessage('ADMIN_COUNTRIES_REMOVED'); + $message = getMessage('ADMIN_COUNTRIES_REMOVED'); } - if ((!empty($MSG)) && (COUNT_SQLS() > 0)) { + if ((!empty($message)) && (COUNT_SQLS() > 0)) { // Run SQL commands runFilterChain('run_sqls'); // Display message - LOAD_TEMPLATE("admin_settings_saved", false, $MSG); + LOAD_TEMPLATE("admin_settings_saved", false, $message); } // Load currenty setup country codes to list diff --git a/inc/modules/admin/what-list_rallyes.php b/inc/modules/admin/what-list_rallyes.php index 48852fddfe..d00f43c71c 100644 --- a/inc/modules/admin/what-list_rallyes.php +++ b/inc/modules/admin/what-list_rallyes.php @@ -46,7 +46,7 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) { ADD_DESCR("admin", __FILE__); if (!REQUEST_ISSET_GET(('sub'))) REQUEST_SET_GET('sub', ""); -$MSG = ""; +$message = ""; // Quick actions on a rallye if (REQUEST_ISSET_GET(('rallye'))) { @@ -115,10 +115,10 @@ if (REQUEST_ISSET_GET(('rallye'))) { runFilterChain('run_sqls'); // Output message - $MSG = getMessage('RALLYE_DELETED'); + $message = getMessage('RALLYE_DELETED'); } else { // No rallye selected to delete! - $MSG = getMessage('RALLYE_DELETE_NOTHING_SELECTED'); + $message = getMessage('RALLYE_DELETE_NOTHING_SELECTED'); } } elseif (REQUEST_ISSET_POST('change')) { // Change rallye @@ -162,7 +162,7 @@ WHERE id='".$id."' LIMIT 1", runFilterChain('run_sqls'); // Output message - $MSG = getMessage('RALLYE_CHANGED'); + $message = getMessage('RALLYE_CHANGED'); } } diff --git a/inc/modules/admin/what-list_sponsor_pay.php b/inc/modules/admin/what-list_sponsor_pay.php index 2e9fe8192a..72e052d3e3 100644 --- a/inc/modules/admin/what-list_sponsor_pay.php +++ b/inc/modules/admin/what-list_sponsor_pay.php @@ -45,7 +45,7 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) { // Add description as navigation point ADD_DESCR("admin", __FILE__); -$MSG = ""; +$message = ""; if (REQUEST_ISSET_POST(('add'))) { // Check input variables @@ -84,7 +84,7 @@ SET pay_name='%s', pay_rate='%s', pay_min_count='%s', pay_currency='%s' WHERE id } // Generate message - $MSG = getMessage('SPONSOR_PAY_ENTRIES_CHANGED'); + $message = getMessage('SPONSOR_PAY_ENTRIES_CHANGED'); } elseif (REQUEST_ISSET_POST('remove')) { // Remove entries here... foreach (REQUEST_POST('id') as $id => $sel) { @@ -94,12 +94,12 @@ SET pay_name='%s', pay_rate='%s', pay_min_count='%s', pay_currency='%s' WHERE id } // Generate message - $MSG = getMessage('SPONSOR_PAY_ENTRIES_REMOVED'); + $message = getMessage('SPONSOR_PAY_ENTRIES_REMOVED'); } - if (!empty($MSG)) { + if (!empty($message)) { // Output message - LOAD_TEMPLATE("admin_settings_saved", false, $MSG); + LOAD_TEMPLATE("admin_settings_saved", false, $message); } } @@ -118,17 +118,17 @@ if (REQUEST_ISSET_POST(('add'))) { ), __FILE__, __LINE__); // Payment type added! - $MSG = sprintf(getMessage('ADMIN_SPONSOR_PAYTYPE_ADDED'), REQUEST_POST('pay_name')); + $message = sprintf(getMessage('ADMIN_SPONSOR_PAYTYPE_ADDED'), REQUEST_POST('pay_name')); } else { // Free memory SQL_FREERESULT($result); // Entry does already exists - $MSG = sprintf(getMessage('ADMIN_SPONSOR_PAYTYPE_ALREADY'), REQUEST_POST('pay_name')); + $message = sprintf(getMessage('ADMIN_SPONSOR_PAYTYPE_ALREADY'), REQUEST_POST('pay_name')); } // Output message - LOAD_TEMPLATE("admin_settings_saved", false, $MSG); + LOAD_TEMPLATE("admin_settings_saved", false, $message); } elseif ((REQUEST_ISSET_POST('edit')) || (REQUEST_ISSET_POST('del'))) { // Load all data $OUT = ""; $SW = 2; diff --git a/inc/modules/admin/what-lock_sponsor.php b/inc/modules/admin/what-lock_sponsor.php index 4bf087bf05..2c25522331 100644 --- a/inc/modules/admin/what-lock_sponsor.php +++ b/inc/modules/admin/what-lock_sponsor.php @@ -44,7 +44,7 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) { // Add description as navigation point ADD_DESCR("admin", __FILE__); -$MSG = ""; +$message = ""; if (REQUEST_ISSET_GET(('id'))) { // Check for selected sponsor @@ -108,20 +108,20 @@ if (REQUEST_ISSET_GET(('id'))) { } } else { // Cannot change status on unconfirmed or pending accounts! - $MSG = getMessage('ADMIN_SPONSPOR_CANNOT_LOCK_PENDING_UNCINFIRMED_ACCOUNTS'); + $message = getMessage('ADMIN_SPONSPOR_CANNOT_LOCK_PENDING_UNCINFIRMED_ACCOUNTS'); } } else { // Sponsor not found! - $MSG = sprintf(getMessage('ADMIN_SPONSOR_404'), bigintval(REQUEST_GET('id'))); + $message = sprintf(getMessage('ADMIN_SPONSOR_404'), bigintval(REQUEST_GET('id'))); } } else { // Not called by what-list_sponsor.php - $MSG = getMessage('ADMIN_CALL_NOT_DIRECTLY'); + $message = getMessage('ADMIN_CALL_NOT_DIRECTLY'); } -if (!empty($MSG)) { +if (!empty($message)) { // Output message - LOAD_TEMPLATE("admin_settings_saved", false, $MSG); + LOAD_TEMPLATE("admin_settings_saved", false, $message); } // diff --git a/inc/modules/admin/what-lock_user.php b/inc/modules/admin/what-lock_user.php index b790d0224f..b2ad76d35d 100644 --- a/inc/modules/admin/what-lock_user.php +++ b/inc/modules/admin/what-lock_user.php @@ -81,7 +81,7 @@ if (REQUEST_ISSET_GET(('uid'))) { } // END - if // Prepare message - $MSG = sprintf(getMessage('USER_ACCOUNT_LOCKED'), REQUEST_GET('uid')); + $message = sprintf(getMessage('USER_ACCOUNT_LOCKED'), REQUEST_GET('uid')); $ACT = true; } elseif ((REQUEST_ISSET_POST(('unlock'))) && ($status == "LOCKED")) { // Ok, unlock the account! @@ -108,7 +108,7 @@ if (REQUEST_ISSET_GET(('uid'))) { } // END - if // Prepare message - $MSG = sprintf(getMessage('USER_ACCOUNT_UNLOCKED'), REQUEST_GET('uid')); + $message = sprintf(getMessage('USER_ACCOUNT_UNLOCKED'), REQUEST_GET('uid')); $ACT = true; } elseif (REQUEST_ISSET_POST('del')) { // Delete the account @@ -172,8 +172,8 @@ if (REQUEST_ISSET_GET(('uid'))) { LOAD_URL($URL); } elseif ($ACT) { // An action was performed... - if (!empty($MSG)) { - LOAD_TEMPLATE("admin_settings_saved", false, "
".$MSG."
"); + if (!empty($message)) { + LOAD_TEMPLATE("admin_settings_saved", false, "
".$message."
"); } else { LOAD_TEMPLATE("admin_settings_saved", false, "
".getMessage('ADMIN_USER_UPDATED')."
"); } diff --git a/inc/modules/admin/what-repair_amenu.php b/inc/modules/admin/what-repair_amenu.php index 5d7090d44e..bed468a7f6 100644 --- a/inc/modules/admin/what-repair_amenu.php +++ b/inc/modules/admin/what-repair_amenu.php @@ -87,13 +87,13 @@ CACHE_PURGE_ADMIN_MENU(); // Repair finished if ($REP > 0) { - $MSG = sprintf(getMessage('ADMIN_REPAIR_ENTRIES_FIXED'), $REP); + $message = sprintf(getMessage('ADMIN_REPAIR_ENTRIES_FIXED'), $REP); } else { - $MSG = getMessage('ADMIN_REPAIR_NOTHING_FIXED'); + $message = getMessage('ADMIN_REPAIR_NOTHING_FIXED'); } // Output message -LOAD_TEMPLATE("admin_settings_saved", false, $MSG); +LOAD_TEMPLATE("admin_settings_saved", false, $message); // ?> diff --git a/inc/modules/admin/what-repair_gmenu.php b/inc/modules/admin/what-repair_gmenu.php index da70ded30b..a91e6d740c 100644 --- a/inc/modules/admin/what-repair_gmenu.php +++ b/inc/modules/admin/what-repair_gmenu.php @@ -81,13 +81,13 @@ foreach ($ACTIONS as $act) { // Repair finished if ($REP > 0) { - $MSG = sprintf(getMessage('ADMIN_REPAIR_ENTRIES_FIXED'), $REP); + $message = sprintf(getMessage('ADMIN_REPAIR_ENTRIES_FIXED'), $REP); } else { - $MSG = getMessage('ADMIN_REPAIR_NOTHING_FIXED'); + $message = getMessage('ADMIN_REPAIR_NOTHING_FIXED'); } // Output message -LOAD_TEMPLATE("admin_settings_saved", false, $MSG); +LOAD_TEMPLATE("admin_settings_saved", false, $message); // ?> diff --git a/inc/modules/admin/what-repair_mmenu.php b/inc/modules/admin/what-repair_mmenu.php index 1515bacbb2..59092aeaad 100644 --- a/inc/modules/admin/what-repair_mmenu.php +++ b/inc/modules/admin/what-repair_mmenu.php @@ -84,13 +84,13 @@ foreach ($ACTIONS as $act) { // Repair finished if ($REP > 0) { - $MSG = sprintf(getMessage('ADMIN_REPAIR_ENTRIES_FIXED'), $REP); + $message = sprintf(getMessage('ADMIN_REPAIR_ENTRIES_FIXED'), $REP); } else { - $MSG = getMessage('ADMIN_REPAIR_NOTHING_FIXED'); + $message = getMessage('ADMIN_REPAIR_NOTHING_FIXED'); } // Output message -LOAD_TEMPLATE("admin_settings_saved", false, $MSG); +LOAD_TEMPLATE("admin_settings_saved", false, $message); // ?> diff --git a/inc/modules/admin/what-unlock_emails.php b/inc/modules/admin/what-unlock_emails.php index f9d2821b00..a55a9aab89 100644 --- a/inc/modules/admin/what-unlock_emails.php +++ b/inc/modules/admin/what-unlock_emails.php @@ -118,14 +118,14 @@ LIMIT 1", } // END - foreach // Set message - $MSG = ADMIN_MAILS_ACTIVATED; + $message = ADMIN_MAILS_ACTIVATED; } else { // Nothing checked! - $MSG = ADMIN_MAILS_NOTHING_CHECKED; + $message = ADMIN_MAILS_NOTHING_CHECKED; } // Mails unlocked for mail delivery - LOAD_TEMPLATE("admin_settings_saved", false, $MSG); + LOAD_TEMPLATE("admin_settings_saved", false, $message); } elseif (REQUEST_ISSET_POST(('reject'))) { if ($SEL > 0) { // Reject mail orders diff --git a/inc/modules/chk_login.php b/inc/modules/chk_login.php index 87d1548433..096b37a5e4 100644 --- a/inc/modules/chk_login.php +++ b/inc/modules/chk_login.php @@ -43,7 +43,7 @@ if (!defined('__SECURITY')) { } // Initial message part -$MSG = "{--VALIDATING_LOGIN--}"; +$message = "{--VALIDATING_LOGIN--}"; if (isUserIdSet() && (isSessionVariableSet('u_hash'))) { // Login failures are supported since 0.4.7 @@ -99,23 +99,23 @@ LIMIT 1", if (($bonus) && (REQUEST_GET('mode') == "bonus") && (EXT_IS_ACTIVE("bonus"))) { // Output message with added points - $MSG .= "
+ $message .= "
".sprintf(getMessage('BONUS_LOGIN_BONUS_ADDED'), TRANSLATE_COMMA(getConfig('login_bonus')))."
"; } elseif (EXT_IS_ACTIVE("bonus")) { // No login bonus added! - $MSG .= "
{--BONUS_LOGIN_BONUS_NOT_ADDED--}
"; + $message .= "
{--BONUS_LOGIN_BONUS_NOT_ADDED--}
"; } // Redirect to member area - $MSG .= LOAD_TEMPLATE("member_login_js", true); + $message .= LOAD_TEMPLATE("member_login_js", true); } else { // Login failed! - $MSG .= LOAD_TEMPLATE("login_failed_js", true); + $message .= LOAD_TEMPLATE("login_failed_js", true); } // Output final message -LOAD_TEMPLATE("admin_settings_saved", false, $MSG); +LOAD_TEMPLATE("admin_settings_saved", false, $message); // ?> diff --git a/inc/modules/guest/what-login.php b/inc/modules/guest/what-login.php index fecdc775e4..edec303945 100644 --- a/inc/modules/guest/what-login.php +++ b/inc/modules/guest/what-login.php @@ -108,50 +108,50 @@ if (REQUEST_ISSET_GET(('login'))) { // Login problems? if (!empty($ERROR)) { // Ok, which one now? - $MSG = " + $message = "   "; switch ($ERROR) { case getCode('WRONG_PASS'): - $MSG .= getMessage('LOGIN_WRONG_PASS'); + $message .= getMessage('LOGIN_WRONG_PASS'); break; case getCode('WRONG_ID'): - $MSG .= getMessage('LOGIN_WRONG_ID'); + $message .= getMessage('LOGIN_WRONG_ID'); break; case getCode('ID_LOCKED'): - $MSG .= getMessage('LOGIN_ID_LOCKED'); + $message .= getMessage('LOGIN_ID_LOCKED'); break; case getCode('ID_UNCONFIRMED'): - $MSG .= getMessage('LOGIN_ID_UNCONFIRMED'); + $message .= getMessage('LOGIN_ID_UNCONFIRMED'); break; case getCode('NO_COOKIES'): - $MSG .= getMessage('LOGIN_NO_COOKIES'); + $message .= getMessage('LOGIN_NO_COOKIES'); break; case getCode('EXTENSION_PROBLEM'): if (IS_ADMIN()) { - $MSG .= sprintf(getMessage('EXTENSION_PROBLEM_NOT_INSTALLED'), "nickname"); + $message .= sprintf(getMessage('EXTENSION_PROBLEM_NOT_INSTALLED'), "nickname"); } else { - $MSG .= getMessage('LOGIN_WRONG_ID'); + $message .= getMessage('LOGIN_WRONG_ID'); } break; default: DEBUG_LOG(__FILE__, __LINE__, sprintf("Unhandled error code %s detected.", $ERROR)); - $MSG .= getMessage('LOGIN_WRONG_ID'); + $message .= getMessage('LOGIN_WRONG_ID'); break; } - $MSG .= " + $message .= "   \n"; - define('LOGIN_FAILURE_MSG', $MSG); + define('LOGIN_FAILURE_MSG', $message); } else { // No problems, no output define('LOGIN_FAILURE_MSG', ""); diff --git a/inc/modules/guest/what-sponsor_login.php b/inc/modules/guest/what-sponsor_login.php index efb695ff10..f2b1e9e984 100644 --- a/inc/modules/guest/what-sponsor_login.php +++ b/inc/modules/guest/what-sponsor_login.php @@ -86,8 +86,8 @@ WHERE id='%s' AND hash='%s' AND `status`='UNCONFIRMED' LIMIT 1", // Check on success if (SQL_AFFECTEDROWS() == 1) { // Prepare mail and send it to the sponsor - $MSG = LOAD_EMAIL_TEMPLATE("sponsor_pending", $SPONSOR); - SEND_EMAIL($SPONSOR['email'], getMessage('SPONSOR_ACCOUNT_PENDING_SUBJ'), $MSG); + $message = LOAD_EMAIL_TEMPLATE("sponsor_pending", $SPONSOR); + SEND_EMAIL($SPONSOR['email'], getMessage('SPONSOR_ACCOUNT_PENDING_SUBJ'), $message); // Send email to admin SEND_ADMIN_NOTIFICATION(getMessage('ADMIN_NEW_SPONSOR'), "admin_sponsor_pending", $SPONSOR); diff --git a/inc/modules/guest/what-sponsor_reg.php b/inc/modules/guest/what-sponsor_reg.php index 059a382069..a6d0924daa 100644 --- a/inc/modules/guest/what-sponsor_reg.php +++ b/inc/modules/guest/what-sponsor_reg.php @@ -198,7 +198,7 @@ if (IS_FORM_SENT()) { if ((IS_FORM_SENT()) && (count($FORM_ERRORS) == 0)) { // Generate message array - $MSGs = array( + $messageArray = array( 'failed' => getMessage('SPONSOR_REGISTRATION_FAILED'), 'added' => getMessage('SPONSOR_REGISTRATION_COMPLETED'), ); @@ -219,7 +219,7 @@ WHERE id='%s' LIMIT 1", array(REQUEST_POST('pay_type')), __FILE__, __LINE__); REQUEST_POST('last_curr' , $curr); // Register sponsor but never ever update here! - $STATUS = SPONSOR_HANDLE_SPONSOR(REQUEST_POST_ARRAY(), true, $MSGs, true); + $STATUS = SPONSOR_HANDLE_SPONSOR(REQUEST_POST_ARRAY(), true, $messageArray, true); // Check the status of the registration process switch ($STATUS) @@ -238,7 +238,7 @@ WHERE id='%s' LIMIT 1", array(REQUEST_POST('pay_type')), __FILE__, __LINE__); define('__EMAIL' , REQUEST_POST('email')); define('__SURNAME' , REQUEST_POST('surname')); define('__FAMILY' , REQUEST_POST('family')); - define('__GENDER' , TRANSLATE_GENDER(REQUEST_POST('gender'))); + define('__GENDER' , TRANSLATE_GENDER(REQUEST_POST('gender'))); define('__TIMESTAMP', MAKE_DATETIME(time(), 0)); define('__PASSWORD' , REQUEST_POST('pass1')); @@ -250,10 +250,10 @@ WHERE id='%s' LIMIT 1", array(REQUEST_POST('pay_type')), __FILE__, __LINE__); SEND_ADMIN_NOTIFICATION(getMessage('ADMIN_NEW_SPONSOR'), "admin_sponsor_reg", $hash); // Output message: DONE - $MSG = $MSGs['added']; + $message = $messageArray['added']; } else { // Sponsor account not found??? - $MSG = sprintf(getMessage('SPONSOR_EMAIL_404'), REQUEST_POST('email')); + $message = sprintf(getMessage('SPONSOR_EMAIL_404'), REQUEST_POST('email')); } // Free memory @@ -264,16 +264,16 @@ WHERE id='%s' LIMIT 1", array(REQUEST_POST('pay_type')), __FILE__, __LINE__); DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown status %s detected.", $STATUS)); if (!IS_ADMIN()) { // Message for testing admin - $MSG = sprintf(getMessage('ADMIN_SPONSOR_UNKNOWN_STATUS'), $STATUS); + $message = sprintf(getMessage('ADMIN_SPONSOR_UNKNOWN_STATUS'), $STATUS); } else { // Message for the guest - $MSG = sprintf(getMessage('SPONSOR_UNKNOWN_STATUS'), $STATUS); + $message = sprintf(getMessage('SPONSOR_UNKNOWN_STATUS'), $STATUS); } break; } // Display message - LOAD_TEMPLATE("admin_settings_saved", false, $MSG); + LOAD_TEMPLATE("admin_settings_saved", false, $message); } else { // Check for payment types $result = SQL_QUERY("SELECT id, pay_name, pay_rate, pay_currency, pay_min_count diff --git a/inc/modules/member/what-order.php b/inc/modules/member/what-order.php index db7f6f0127..4fbc46614f 100644 --- a/inc/modules/member/what-order.php +++ b/inc/modules/member/what-order.php @@ -478,7 +478,7 @@ LIMIT 1", array(bigintval($ucat)), __FILE__, __LINE__); $typeS = array(); if (SQL_NUMROWS($result) > 0) { // Check for message ID in URL - $MSG = ""; + $message = ""; switch (REQUEST_GET('msg')) { case getCode('URL_TLOCK'): @@ -503,53 +503,53 @@ LIMIT 1", array(bigintval($ucat)), __FILE__, __LINE__); // Finally contruct the message // @TODO Rewrite this old lost code to a template - $MSG = "{--MEMBER_URL_TIME_LOCK--}
{--CONFIG_URL_TLOCK--} ".$STD." + $message = "{--MEMBER_URL_TIME_LOCK--}
{--CONFIG_URL_TLOCK--} ".$STD." {--_HOURS--}, ".$MIN." {--_MINUTES--} {--_AND--} ".$SEC." {--_SECONDS--}
{--MEMBER_LAST_TLOCK--}: ".$LORDER; break; case getCode('OVERLENGTH'): - $MSG = getMessage('MEMBER_TEXT_OVERLENGTH'); + $message = getMessage('MEMBER_TEXT_OVERLENGTH'); break; case getCode('URL_FOUND'): - $MSG = getMessage('MEMBER_TEXT_CONTAINS_URL'); + $message = getMessage('MEMBER_TEXT_CONTAINS_URL'); break; case getCode('SUBJ_URL'): - $MSG = getMessage('MEMBER_SUBJ_CONTAINS_URL'); + $message = getMessage('MEMBER_SUBJ_CONTAINS_URL'); break; case getCode('BLIST_URL'): - $MSG = "{--MEMBER_URL_BLACK_LISTED--}
\n{--MEMBER_BLIST_TIME--}: ".MAKE_DATETIME(REQUEST_GET('blist'), "0"); + $message = "{--MEMBER_URL_BLACK_LISTED--}
\n{--MEMBER_BLIST_TIME--}: ".MAKE_DATETIME(REQUEST_GET('blist'), "0"); break; case getCode('NO_RECS_LEFT'): - $MSG = getMessage('MEMBER_SELECTED_MORE_RECS'); + $message = getMessage('MEMBER_SELECTED_MORE_RECS'); break; case getCode('INVALID_TAGS'): - $MSG = getMessage('MEMBER_HTML_INVALID_TAGS'); + $message = getMessage('MEMBER_HTML_INVALID_TAGS'); break; case getCode('MORE_POINTS'): - $MSG = getMessage('MEMBER_MORE_POINTS_NEEDED'); + $message = getMessage('MEMBER_MORE_POINTS_NEEDED'); break; case getCode('MORE_RECEIVERS1'): - $MSG = getMessage('MEMBER_ENTER_MORE_RECEIVERS'); + $message = getMessage('MEMBER_ENTER_MORE_RECEIVERS'); break; case getCode('MORE_RECEIVERS2'): - $MSG = getMessage('MEMBER_NO_MORE_RECEIVERS_FOUND'); + $message = getMessage('MEMBER_NO_MORE_RECEIVERS_FOUND'); break; case getCode('MORE_RECEIVERS3'): - $MSG = sprintf(getMessage('MEMBER_ENTER_MORE_MIN_RECEIVERS'), getConfig('order_min')); + $message = sprintf(getMessage('MEMBER_ENTER_MORE_MIN_RECEIVERS'), getConfig('order_min')); break; case getCode('INVALID_URL'): - $MSG = getMessage('MEMBER_ENTER_INVALID_URL'); + $message = getMessage('MEMBER_ENTER_INVALID_URL'); break; case "": // When no error code is included in the URL we do not need to output an error message as well... @@ -557,13 +557,13 @@ LIMIT 1", array(bigintval($ucat)), __FILE__, __LINE__); default: DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown error code %s detected.", REQUEST_GET('msg'))); - $MSG = sprintf(getMessage('UNKNOWN_CODE'), REQUEST_GET('msg')); + $message = sprintf(getMessage('UNKNOWN_CODE'), REQUEST_GET('msg')); break; } - if (!empty($MSG)) { + if (!empty($message)) { // We got system message so we drop it out to the user - LOAD_TEMPLATE("admin_settings_saved", false, $MSG); + LOAD_TEMPLATE("admin_settings_saved", false, $message); } // END - if // Load all email types... diff --git a/inc/modules/sponsor/account.php b/inc/modules/sponsor/account.php index dea2bdb156..c0abe1d508 100644 --- a/inc/modules/sponsor/account.php +++ b/inc/modules/sponsor/account.php @@ -67,22 +67,22 @@ if (SQL_NUMROWS($result) == 1) { // Check passwords if (!REQUEST_ISSET_POST(('pass_old'))) { // No current password entered - $MSG = getMessage('SPONSOR_NO_CURRENT_PASSWORD_ENTERED'); + $message = getMessage('SPONSOR_NO_CURRENT_PASSWORD_ENTERED'); } elseif (md5(REQUEST_POST('pass_old')) != get_session('sponsorpass')) { // Entered password didn't match password in DB - $MSG = getMessage('SPONSOR_CURRENT_PASSWORD_DIDNOT_MATCH_DB'); + $message = getMessage('SPONSOR_CURRENT_PASSWORD_DIDNOT_MATCH_DB'); } elseif ((REQUEST_ISSET_POST(('pass1'))) && (REQUEST_ISSET_POST(('pass2'))) && (REQUEST_POST('pass1') != REQUEST_POST('pass2'))) { // Both new passwords did not match - $MSG = getMessage('SPONSOR_BOTH_NEW_PASSWORDS_DIDNOT_MATCH'); + $message = getMessage('SPONSOR_BOTH_NEW_PASSWORDS_DIDNOT_MATCH'); } elseif ((!REQUEST_ISSET_POST(('pass1'))) && (REQUEST_ISSET_POST(('pass2')))) { // No password one entered - $MSG = getMessage('SPONSOR_PASSWORD_ONE_EMPTY'); + $message = getMessage('SPONSOR_PASSWORD_ONE_EMPTY'); } elseif ((REQUEST_ISSET_POST(('pass1'))) && (!REQUEST_ISSET_POST(('pass2')))) { // No password two entered - $MSG = getMessage('SPONSOR_PASSWORD_TWO_EMPTY'); + $message = getMessage('SPONSOR_PASSWORD_TWO_EMPTY'); } elseif ((REQUEST_ISSET_POST(('pass1'))) && (strlen(REQUEST_POST('pass1')) < getConfig('pass_len'))) { // Too short password - $MSG = sprintf(getMessage('SPONSOR_PASSWORD_TOO_SHORT'), getConfig('pass_len')); + $message = sprintf(getMessage('SPONSOR_PASSWORD_TOO_SHORT'), getConfig('pass_len')); } else { // Default is we don't want to change password! $PASS_AND = ""; $PASS_DATA = ""; @@ -106,12 +106,12 @@ if (SQL_NUMROWS($result) == 1) { REQUEST_SET_POST('last_change', "UNIX_TIMESTAMP()"); // Save data - $MSG = SPONSOR_SAVE_DATA(REQUEST_POST_ARRAY(), $content); + $message = SPONSOR_SAVE_DATA(REQUEST_POST_ARRAY(), $content); } - if (!empty($MSG)) { + if (!empty($message)) { // Output message - $OUT = LOAD_TEMPLATE("admin_settings_saved", true, $MSG); + $OUT = LOAD_TEMPLATE("admin_settings_saved", true, $message); } else { // No message generated $OUT = LOAD_TEMPLATE("admin_settings_saved", true, getMessage('SPONSOR_NO_MESSAGE_GENERATED')); diff --git a/inc/modules/sponsor/settings.php b/inc/modules/sponsor/settings.php index 44f5705a4b..42b14bf0e4 100644 --- a/inc/modules/sponsor/settings.php +++ b/inc/modules/sponsor/settings.php @@ -62,10 +62,10 @@ if (SQL_NUMROWS($result) == 1) { // Check passwords if (!REQUEST_ISSET_POST(('password'))) { // No current password entered - $MSG = SPONSOR_NO_CURRENT_PASSWORD_ENTERED; + $message = SPONSOR_NO_CURRENT_PASSWORD_ENTERED; } elseif (md5(REQUEST_POST('password')) != get_session('sponsorpass')) { // Entered password didn't match password in DB - $MSG = SPONSOR_CURRENT_PASSWORD_DIDNOT_MATCH_DB; + $message = SPONSOR_CURRENT_PASSWORD_DIDNOT_MATCH_DB; } else { // Unsecure data which we don't want here $UNSAFE = array('company', 'position', 'tax_ident', 'gender', 'surname', 'family', @@ -81,12 +81,12 @@ if (SQL_NUMROWS($result) == 1) { REQUEST_SET_POST('last_change', "UNIX_TIMESTAMP()"); // Save data - $MSG = SPONSOR_SAVE_DATA(REQUEST_POST_ARRAY(), $content); + $message = SPONSOR_SAVE_DATA(REQUEST_POST_ARRAY(), $content); } - if (!empty($MSG)) { + if (!empty($message)) { // Output message - $OUT = LOAD_TEMPLATE("admin_settings_saved", true, $MSG); + $OUT = LOAD_TEMPLATE("admin_settings_saved", true, $message); } else { // No message generated $OUT = LOAD_TEMPLATE("admin_settings_saved", true, getMessage('SPONSOR_NO_MESSAGE_GENERATED')); diff --git a/inc/mysql-manager.php b/inc/mysql-manager.php index 603f367579..a7b6ef4768 100644 --- a/inc/mysql-manager.php +++ b/inc/mysql-manager.php @@ -1017,22 +1017,29 @@ function GET_PAY_POINTS ($pid, $lookFor = "price") { return $ret; } -// Remove a receiver's ID from $ARRAY and add a link for him to confirm -function REMOVE_RECEIVER (&$ARRAY, $key, $uid, $pool_id, $stats_id="", $bonus=false) { +// Remove a receiver's ID from $receivers and add a link for him to confirm +function REMOVE_RECEIVER (&$receivers, $key, $uid, $pool_id, $stats_id="", $bonus=false) { + // Default is not removed $ret = "failed"; + + // Is the userid valid? if ($uid > 0) { // Remove entry from array - unset($ARRAY[$key]); + unset($receivers[$key]); // Is there already a line for this user available? if ($stats_id > 0) { // Only when we got a real stats ID continue searching for the entry $type = "NORMAL"; $rowName = "stats_id"; if ($bonus) { $type = "BONUS"; $rowName = "bonus_id"; } + + // Try to look the entry up $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_user_links` WHERE %s='%s' AND userid=%s AND link_type='%s' LIMIT 1", array($rowName, $stats_id, bigintval($uid), $type), __FUNCTION__, __LINE__); + + // Was it *not* found? if (SQL_NUMROWS($result) == 0) { - // No, so we add one! + // So we add one! SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_user_links` (%s, userid, link_type) VALUES ('%s','%s','%s')", array($rowName, $stats_id, bigintval($uid), $type), __FUNCTION__, __LINE__); $ret = "done";