]> git.mxchange.org Git - mailer.git/commitdiff
A lot variables renamed from all upper-case to hungarian notation
authorRoland Häder <roland@mxchange.org>
Mon, 9 Mar 2009 08:29:22 +0000 (08:29 +0000)
committerRoland Häder <roland@mxchange.org>
Mon, 9 Mar 2009 08:29:22 +0000 (08:29 +0000)
27 files changed:
inc/functions.php
inc/libs/admins_functions.php
inc/libs/html_mail_functions.php
inc/libs/newsletter_functions.php
inc/libs/sponsor_functions.php
inc/mails/beg_mails.php
inc/mails/bonus_mails.php
inc/modules/admin.php
inc/modules/admin/what-del_holiday.php
inc/modules/admin/what-edit_sponsor.php
inc/modules/admin/what-list_country.php
inc/modules/admin/what-list_rallyes.php
inc/modules/admin/what-list_sponsor_pay.php
inc/modules/admin/what-lock_sponsor.php
inc/modules/admin/what-lock_user.php
inc/modules/admin/what-repair_amenu.php
inc/modules/admin/what-repair_gmenu.php
inc/modules/admin/what-repair_mmenu.php
inc/modules/admin/what-unlock_emails.php
inc/modules/chk_login.php
inc/modules/guest/what-login.php
inc/modules/guest/what-sponsor_login.php
inc/modules/guest/what-sponsor_reg.php
inc/modules/member/what-order.php
inc/modules/sponsor/account.php
inc/modules/sponsor/settings.php
inc/mysql-manager.php

index 28748b0e569b1c1118ecf8c35d5d86e92110b472..1dc08094e8e433784ba375824ae1c59a4305fd48 100644 (file)
@@ -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__."(<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!)
@@ -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("<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);
        }
 }
 
@@ -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)) {
index 67a2a21a5df1a4dc6f5b657f54679f87838fe010..eed4dec9580c5467114785265dbc3a9d0d837c2b 100644 (file)
@@ -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);
                }
        }
 
index 488c7652940af614c840a50099cf4ae4c162dd41..7f607f7e2f1a97e8dd4075cd74ff54368ca1e65a 100644 (file)
@@ -156,13 +156,13 @@ function HTML_INSERT_URLS ($text) {
        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);
        }
 }
 //
index dfc732a9ddabe281773dd73ef9997fcf94a3840e..ee7663e7aa6c9cc43ed782c17c369daf05f93123 100644 (file)
@@ -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");
                }
        }
 }
index e40b25ad7f747ab19401de026475b5199fd42eb4..e76834d86d5dbcc8d0b2a7571922247e19d5d1cc 100644 (file)
@@ -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;
 }
 
 //
index d40b73ec795ec8620cebc63f83a22a6d2112a364..d005627783ffb2ac817c54623b9b877e58967c32 100644 (file)
@@ -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&amp;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
 
index 3e52f2df2bc97dd694a678931ff56b33f1ca5721..97b9ef67554ef186818dbd46e67386d93da743fe 100644 (file)
@@ -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&amp;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
 
index 42a9860dcbb5c8358a052c86755c04d28ec14427..2d9fc975f8dfa6aac2bed2b9ab384878aedf7db7 100644 (file)
@@ -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' , "");
index 07c0775ede6e2cfef19619dc8f4f25385cca20eb..0ffaeabb931f10504027e9ec5b427bed79239f4f 100644 (file)
@@ -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'));
index 61ff5406ad6d62b2361c8e86c50cee8a407e2203..09e16257504c32388e9d384657a37dbe4ff2ed64 100644 (file)
@@ -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
index 2bcf66f4fae218e6c00dc900dc97a4cd3d2539db..2a151aa1e7351357f8e4ff4c5efcc217dc3a7a29 100644 (file)
@@ -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
index 48852fddfe852543cbf6741c2e005c8fe8f2d759..d00f43c71cfadcbf95ff8c16cb7991ee837fa896 100644 (file)
@@ -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');
        }
 }
 
index 2e9fe8192a65e8c692d0227259ad2ba61814cbec..72e052d3e3eef5084aca002c96f686b10b637183 100644 (file)
@@ -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;
index 4bf087bf05a3ecbc4674314e16f042209fa57569..2c25522331a7a75bbd1797a6dd5e4058edaf30e5 100644 (file)
@@ -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);
 }
 
 //
index b790d0224f2d52648ff17a86334a88b4e16cb5e6..b2ad76d35de0d65c37002f6226f321ea75e81c68 100644 (file)
@@ -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, "<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>");
                        }
index 5d7090d44e30589e2cc556cb4a77fe9e01f15e96..bed468a7f6b30d0a4c051d634c11e410ce2c00d6 100644 (file)
@@ -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);
 
 //
 ?>
index da70ded30b7d02bd1f81b232e9782ec3575998bc..a91e6d740c47f003c2e03e67ea7fba272a5487ba 100644 (file)
@@ -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);
 
 //
 ?>
index 1515bacbb2706fa015c87769d762e8c5b23de9e1..59092aeaade6a36d57f444705dd3a3d913cb5270 100644 (file)
@@ -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);
 
 //
 ?>
index f9d2821b001c49584eb1ce4351562d87d532931d..a55a9aab893ded6bc7f0e33fd5b3fcc9c86d0f8f 100644 (file)
@@ -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
index 87d15484331124f0d6d9eae62d9a063d2e5f0bbc..096b37a5e431ca9f5c3cf05c3a64f3a8287c01d4 100644 (file)
@@ -43,7 +43,7 @@ if (!defined('__SECURITY')) {
 }
 
 // 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
@@ -99,23 +99,23 @@ LIMIT 1",
 
        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);
 
 //
 ?>
index fecdc775e40f54e8c1ce0370dc9a260918143cda..edec3039458ff90de570d56d82bbaaab1053412a 100644 (file)
@@ -108,50 +108,50 @@ if (REQUEST_ISSET_GET(('login'))) {
 // Login problems?
 if (!empty($ERROR)) {
        // Ok, which one now?
-       $MSG = "<tr>
+       $message = "<tr>
   <td width=\"10\" class=\"seperator\">&nbsp;</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\">&nbsp;</td>
 </tr>\n";
-               define('LOGIN_FAILURE_MSG', $MSG);
+               define('LOGIN_FAILURE_MSG', $message);
 } else {
        // No problems, no output
        define('LOGIN_FAILURE_MSG', "");
index efb695ff1049ffbd718eb148d3030a6cea62b408..f2b1e9e9849c7bcf1e69dc7ae92ece4f364e2557 100644 (file)
@@ -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);
index 059a38206946eec84dbc2799153f807a0575ac2c..a6d0924daade924b938137d9a04bee3503645a0a 100644 (file)
@@ -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
index db7f6f012767f3c2a6fc6522b6b462ac4d6cbc7c..4fbc46614ff813da476fbef9e14fb62022466a49 100644 (file)
@@ -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--}<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...
@@ -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...
index dea2bdb1565b24c5879bbd61f111816157437db6..c0abe1d508ae320ff5d68fc91ceb3d6cdf203ae9 100644 (file)
@@ -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'));
index 44f5705a4b5cbf8e86824057cddc921a95f2e186..42b14bf0e445869c26c43a25d30657edd2461373 100644 (file)
@@ -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'));
index 603f367579698c10d7bda073c49a3a78cd6581fb..a7b6ef4768fe3d6e7df1bbaa10fdae2bbb562674 100644 (file)
@@ -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";