'what','action','module' and 'output_mode' wrapped into functions (WARNUNG: Code...
[mailer.git] / inc / libs / sponsor_functions.php
index 531741c3e2ba9e664026a9074832c30fb069b45e..3c8a36d81185485082b6ba7ee0e07817189d7b59 100644 (file)
@@ -80,7 +80,7 @@ function SPONSOR_HANDLE_SPONSOR (&$POST, $NO_UPDATE=false, $messageArray=array()
                                                        // Is a sponsor alread in the db?
                                                        if (SQL_NUMROWS($result) == 1) {
                                                                // Yes, he is!
-                                                               if (($GLOBALS['what'] == 'add_sponsor') || ($NO_UPDATE)) {
+                                                               if ((getWhat() == 'add_sponsor') || ($NO_UPDATE)) {
                                                                        // Already found!
                                                                        $ALREADY = true;
                                                                } else {
@@ -146,7 +146,7 @@ function SPONSOR_HANDLE_SPONSOR (&$POST, $NO_UPDATE=false, $messageArray=array()
                                // Add new sponsor, first add more data
                                $DATA['keys'][] = "sponsor_created"; $DATA['values'][] = time();
                                $DATA['keys'][] = 'status';
-                               if ((!$NO_UPDATE) && (IS_ADMIN()) && ($GLOBALS['what'] == "add_sponsor")) {
+                               if ((!$NO_UPDATE) && (IS_ADMIN()) && (getWhat() == "add_sponsor")) {
                                        // Only allowed for admin
                                        $DATA['values'][] = 'PENDING';
                                } else {
@@ -439,7 +439,7 @@ function SPONSOR_SAVE_DATA ($POST, $content) {
        $DATA[] = getSession('sponsorpass');
 
        // Saving data was completed... ufff...
-       switch ($GLOBALS['what'])
+       switch (getWhat())
        {
                case "account": // Change account data
                        if ($EMAIL === true) {
@@ -465,8 +465,8 @@ function SPONSOR_SAVE_DATA ($POST, $content) {
                        break;
 
                default: // Unknown sponsor what value!
-                       DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("Unknown sponsor module (what) %s detected.", $GLOBALS['what']));
-                       $message = sprintf(getMessage('SPONSOR_UNKNOWN_WHAT'), $GLOBALS['what']);
+                       DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("Unknown sponsor module (what) %s detected.", getWhat()));
+                       $message = sprintf(getMessage('SPONSOR_UNKNOWN_WHAT'), getWhat());
                        $templ = ''; $subj = '';
                        break;
        }
@@ -495,7 +495,7 @@ function SPONSOR_SAVE_DATA ($POST, $content) {
                                // to the old address
 
                                // First to old address
-                               switch ($GLOBALS['what'])
+                               switch (getWhat())
                                {
                                        case "account": // Change account data
                                                $email_msg = LOAD_EMAIL_TEMPLATE("sponsor_change_data", $content);