]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/sponsor/settings.php
A lot double-quotes rewritten to single-quotes, global fix for getMessage() calls
[mailer.git] / inc / modules / sponsor / settings.php
index 44f5705a4b5cbf8e86824057cddc921a95f2e186..ea4c4e4fd66e7686eb023add0c1f7aecd927fb00 100644 (file)
 
 // Some security stuff...
 if (!defined('__SECURITY')) {
-       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
        require($INC);
-} elseif ((!EXT_IS_ACTIVE("sponsor"))
-       addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "sponsor");
+} elseif ((!EXT_IS_ACTIVE('sponsor'))
+       addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), 'sponsor'));
        return;
 } elseif (!IS_SPONSOR()) {
        // No sponsor!
@@ -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,27 +81,27 @@ 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'));
+                               $OUT = LOAD_TEMPLATE('admin_settings_saved', true, getMessage('SPONSOR_NO_MESSAGE_GENERATED'));
                        }
                } else {
                        // Make yes/no selection
                        switch ($content['receive_warnings']) {
-                               case "Y":
-                                       define('__YES', " checked=\"checked\"");
-                                       define('__NO', "");
+                               case 'Y':
+                                       define('__YES', ' chkecked="checked"');
+                                       define('__NO', '');
                                        break;
 
-                               case "N":
-                                       define('__YES', "");
-                                       define('__NO', " checked=\"checked\"");
+                               case 'N':
+                                       define('__YES', '');
+                                       define('__NO', ' chkecked="checked"');
                                        break;
                        }
 
@@ -114,11 +114,11 @@ if (SQL_NUMROWS($result) == 1) {
        } else {
                // Locked or so?
                $STATUS = SPONSOR_TRANSLATE_STATUS($content['status']);
-               $OUT = LOAD_TEMPLATE("admin_settings_saved", true, sprintf(getMessage('SPONSOR_ACCOUNT_FAILED'), $STATUS));
+               $OUT = LOAD_TEMPLATE('admin_settings_saved', true, sprintf(getMessage('SPONSOR_ACCOUNT_FAILED'), $STATUS));
        }
 } else {
        // Sponsor account not found!
-       $OUT = LOAD_TEMPLATE("admin_settings_saved", true, sprintf(getMessage('SPONSOR_ACCOUNT_404'), get_session('sponsorid')));
+       $OUT = LOAD_TEMPLATE('admin_settings_saved', true, sprintf(getMessage('SPONSOR_ACCOUNT_404'), get_session('sponsorid')));
 }
 
 // Free memory