}
// Send mail out to an email address
-function SEND_EMAIL($TO, $SUBJECT, $MSG, $HTML = "N", $FROM = "") {
- //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):TO={$TO},SUBJECT={$SUBJECT}<br />\n";
+function SEND_EMAIL($toEmail, $subject, $message, $HTML = "N", $mailHeader = "") {
+ //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):TO={$toEmail},SUBJECT={$subject}<br />\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__."(<font color=\"#0000aa\">".__LINE__."</font>):numRows=".SQL_NUMROWS($result_email)."<br />\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__."(<font color=\"#0000aa\">".__LINE__."</font>):TO={$TO}<br />\n";
+ //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):TO={$toEmail}<br />\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!)
if (isDebugModeEnabled()) {
// In debug mode we want to display the mail instead of sending it away so we can debug this part
print("<pre>
-".htmlentities(trim($FROM))."
-To : ".$TO."
-Subject : ".$SUBJECT."
-Message : ".$MSG."
+".htmlentities(trim($mailHeader))."
+To : ".$toEmail."
+Subject : ".$subject."
+Message : ".$message."
</pre>\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);
}
}
/*
* 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
} 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);
}
}
//
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));
} // 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)) {
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);
}
}
return COMPILE_CODE(str_replace("\n", "<br />\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);
}
}
//
}
//
-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");
}
}
}
}
//
-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;
if ((empty($POST['force'])) || (!IS_ADMIN())) $POST['force'] = 0;
// SQL and message string is empty by default
- $sql = ""; $MSG = "";
+ $sql = ""; $message = "";
// Update?
if ($UPDATE) {
$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
$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
return;
} else {
// Already added!
- $MSG = sprintf(getMessage('SPONSOR_ALREADY_FOUND', $POST['email']));
+ $message = sprintf(getMessage('SPONSOR_ALREADY_FOUND', $POST['email']));
$ret = "already";
}
// 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?
'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']))) {
{
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');
}
$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;
}
} // END - if
// Return final message
- return $MSG;
+ return $message;
}
//
$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!
$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
$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
$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
$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
$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
// 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', "");
} // END - if
// Error detected?
+ // @TODO Rewrite all these constants
if ($ret != "done") {
if (REQUEST_ISSET_POST(('login'))) {
define('__LOGIN_VALUE', REQUEST_POST('login'));
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' , "");
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
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'));
// 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;
// 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;
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
), __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");
}
} 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) {
}
// 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
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'))) {
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
runFilterChain('run_sqls');
// Output message
- $MSG = getMessage('RALLYE_CHANGED');
+ $message = getMessage('RALLYE_CHANGED');
}
}
// Add description as navigation point
ADD_DESCR("admin", __FILE__);
-$MSG = "";
+$message = "";
if (REQUEST_ISSET_POST(('add'))) {
// Check input variables
}
// 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) {
}
// 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);
}
}
), __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;
// Add description as navigation point
ADD_DESCR("admin", __FILE__);
-$MSG = "";
+$message = "";
if (REQUEST_ISSET_GET(('id'))) {
// Check for selected sponsor
}
} 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);
}
//
} // 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!
} // 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
LOAD_URL($URL);
} elseif ($ACT) {
// An action was performed...
- if (!empty($MSG)) {
- LOAD_TEMPLATE("admin_settings_saved", false, "<div class=\"admin_green\">".$MSG."</div>");
+ if (!empty($message)) {
+ LOAD_TEMPLATE("admin_settings_saved", false, "<div class=\"admin_green\">".$message."</div>");
} else {
LOAD_TEMPLATE("admin_settings_saved", false, "<div class=\"admin_green\">".getMessage('ADMIN_USER_UPDATED')."</div>");
}
// 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);
//
?>
// 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);
//
?>
// 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);
//
?>
} // 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
}
// Initial message part
-$MSG = "<strong>{--VALIDATING_LOGIN--}</strong>";
+$message = "<strong>{--VALIDATING_LOGIN--}</strong>";
if (isUserIdSet() && (isSessionVariableSet('u_hash'))) {
// Login failures are supported since 0.4.7
if (($bonus) && (REQUEST_GET('mode') == "bonus") && (EXT_IS_ACTIVE("bonus"))) {
// Output message with added points
- $MSG .= "<div class=\"tiny\">
+ $message .= "<div class=\"tiny\">
".sprintf(getMessage('BONUS_LOGIN_BONUS_ADDED'), TRANSLATE_COMMA(getConfig('login_bonus')))."
</div>";
} elseif (EXT_IS_ACTIVE("bonus")) {
// No login bonus added!
- $MSG .= "<div class=\"member_failed\">{--BONUS_LOGIN_BONUS_NOT_ADDED--}</div>";
+ $message .= "<div class=\"member_failed\">{--BONUS_LOGIN_BONUS_NOT_ADDED--}</div>";
}
// 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);
//
?>
// Login problems?
if (!empty($ERROR)) {
// Ok, which one now?
- $MSG = "<tr>
+ $message = "<tr>
<td width=\"10\" class=\"seperator\"> </td>
<td colspan=\"7\" align=\"center\">
<span class=\"guest_failed\">";
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 .= "</span>
+ $message .= "</span>
</td>
<td width=\"10\" class=\"seperator\"> </td>
</tr>\n";
- define('LOGIN_FAILURE_MSG', $MSG);
+ define('LOGIN_FAILURE_MSG', $message);
} else {
// No problems, no output
define('LOGIN_FAILURE_MSG', "");
// 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);
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'),
);
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)
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'));
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
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
$typeS = array();
if (SQL_NUMROWS($result) > 0) {
// Check for message ID in URL
- $MSG = "";
+ $message = "";
switch (REQUEST_GET('msg'))
{
case getCode('URL_TLOCK'):
// Finally contruct the message
// @TODO Rewrite this old lost code to a template
- $MSG = "{--MEMBER_URL_TIME_LOCK--}<br />{--CONFIG_URL_TLOCK--} ".$STD."
+ $message = "{--MEMBER_URL_TIME_LOCK--}<br />{--CONFIG_URL_TLOCK--} ".$STD."
{--_HOURS--}, ".$MIN." {--_MINUTES--} {--_AND--} ".$SEC." {--_SECONDS--}<br />
{--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--}<br />\n{--MEMBER_BLIST_TIME--}: ".MAKE_DATETIME(REQUEST_GET('blist'), "0");
+ $message = "{--MEMBER_URL_BLACK_LISTED--}<br />\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...
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...
// 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 = "";
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'));
// 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',
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'));
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";