More misc fixes and rewrites (sorry, lame description)
[mailer.git] / inc / libs / sponsor_functions.php
index 06c389a..fb8ac7b 100644 (file)
@@ -120,7 +120,7 @@ function SPONSOR_HANDLE_SPONSOR (&$POST, $NO_UPDATE=false, $messageArray=array()
                }
 
                // Save sponsor?
-               if ($SAVE) {
+               if ($SAVE === true) {
                        // Default is no force even when a guest want to abuse this force switch
                        if ((empty($POST['force'])) || (!IS_ADMIN())) $POST['force'] = 0;
 
@@ -277,9 +277,9 @@ LIMIT 1",
        // Return status
        return $ret;
 }
+
 //
-function GENERATE_SPONSOR_MENU($current)
-{
+function GENERATE_SPONSOR_MENU ($current) {
        $OUT = '';
        $WHERE = " AND active='Y'";
        if (IS_ADMIN()) $WHERE = '';
@@ -449,26 +449,26 @@ function SPONSOR_SAVE_DATA ($POST, $content) {
        // Saving data was completed... ufff...
        switch (getWhat())
        {
-               case "account": // Change account data
+               case 'account': // Change account data
                        if ($EMAIL === true) {
                                $message   = getMessage('SPONSOR_ACCOUNT_EMAIL_CHANGED');
-                               $templ = "admin_sponsor_change_email";
+                               $templ = 'admin_sponsor_change_email';
                                $subj  = getMessage('ADMIN_SPONSOR_ACC_EMAIL_SUBJ');
                        } else {
                                $message   = getMessage('SPONSOR_ACCOUNT_DATA_SAVED');
-                               $templ = "admin_sponsor_change_data";
+                               $templ = 'admin_sponsor_change_data';
                                $subj  = getMessage('ADMIN_SPONSOR_ACC_DATA_SUBJ');
                        }
                        break;
 
-               case "settings": // Change settings
+               case 'settings': // Change settings
                        // Translate some data
                        $content['receive']  = translateYesNo($content['receive_warnings']);
                        $content['interval'] = createFancyTime($content['warning_interval']);
 
                        // Set message template and subject for admin
                        $message   = getMessage('SPONSOR_SETTINGS_SAVED');
-                       $templ = "admin_sponsor_settings";
+                       $templ = 'admin_sponsor_settings';
                        $subj  = getMessage('ADMIN_SPONSOR_SETTINGS_SUBJ');
                        break;
 
@@ -489,8 +489,8 @@ function SPONSOR_SAVE_DATA ($POST, $content) {
                        $DATA = $POST;
 
                        // Change some data
-                       if (isset($content['gender'])) $content['gender'] = translateGender($content['gender']);
-                       if (isset($DATA['gender']))    $DATA['gender']    = translateGender($DATA['gender']);
+                       if (isset($content['gender']))           $content['gender']   = translateGender($content['gender']);
+                       if (isset($DATA['gender']))              $DATA['gender']      = translateGender($DATA['gender']);
                        if (isset($content['receive_warnings'])) $DATA['receive']     = translateYesNo($POST['receive_warnings']);
                        if (isset($content['warning_interval'])) $DATA['interval']    = createFancyTime($POST['warning_interval']);
 
@@ -505,8 +505,8 @@ function SPONSOR_SAVE_DATA ($POST, $content) {
                                // First to old address
                                switch (getWhat())
                                {
-                                       case "account": // Change account data
-                                               $email_msg = LOAD_EMAIL_TEMPLATE("sponsor_change_data", $content);
+                                       case 'account': // Change account data
+                                               $email_msg = LOAD_EMAIL_TEMPLATE('sponsor_change_data', $content);
                                                sendEmail($content['email'], getMessage('SPONSOR_ACC_DATA_SUBJ'), $email_msg);
 
                                                if ($EMAIL === true) {
@@ -514,14 +514,14 @@ function SPONSOR_SAVE_DATA ($POST, $content) {
                                                        $content['hash'] = $HASH;
 
                                                        // Second mail goes to the new address
-                                                       $email_msg = LOAD_EMAIL_TEMPLATE("sponsor_change_email", $content);
+                                                       $email_msg = LOAD_EMAIL_TEMPLATE('sponsor_change_email', $content);
                                                        sendEmail($content['email'], getMessage('SPONSOR_ACC_EMAIL_SUBJ'), $email_msg);
                                                }
                                                break;
 
-                                       case "settings": // Change settings
+                                       case 'settings': // Change settings
                                                // Send email
-                                               $email_msg = LOAD_EMAIL_TEMPLATE("sponsor_settings", $content);
+                                               $email_msg = LOAD_EMAIL_TEMPLATE('sponsor_settings', $content);
                                                sendEmail($content['email'], getMessage('SPONSOR_SETTINGS_SUBJ'), $email_msg);
                                                break;
                                }