Possible further fix for #128
[mailer.git] / inc / modules / admin / what-edit_sponsor.php
index 64b052ff662f09f0f9c184c3c3c5cf8da517f7e7..d2b000d90d27c2feb59a3762b177d82677b77a92 100644 (file)
@@ -45,7 +45,7 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
 // Add description as navigation point
 ADD_DESCR('admin', __FILE__);
 
-if ((REQUEST_ISSET_GET('id')) && (REQUEST_ISSET_GET(('mode')))) {
+if ((REQUEST_ISSET_GET('id')) && (REQUEST_ISSET_GET('mode'))) {
        // Check for selected sponsor
        $result = SQL_QUERY_ESC("SELECT company, position, gender, surname, family, street_nr1, street_nr2, zip, city, country, phone, fax, cell, email, url, tax_ident, receive_warnings, warning_interval FROM `{!_MYSQL_PREFIX!}_sponsor_data` WHERE `id`='%s' LIMIT 1",
        array(bigintval(REQUEST_GET('id'))), __FILE__, __LINE__);
@@ -64,19 +64,19 @@ if ((REQUEST_ISSET_GET('id')) && (REQUEST_ISSET_GET(('mode')))) {
                //  Personal data
                switch ($DATA['gender'])
                {
-                       case "M":
+                       case 'M':
                                define('__GENDER_M', ' selected="selected"');
                                define('__GENDER_F', '');
                                define('__GENDER_C', '');
                                break;
 
-                       case "F":
+                       case 'F':
                                define('__GENDER_M', '');
                                define('__GENDER_F', ' selected="selected"');
                                define('__GENDER_C', '');
                                break;
 
-                       case "C":
+                       case 'C':
                                define('__GENDER_M', '');
                                define('__GENDER_F', '');
                                define('__GENDER_C', ' selected="selected"');
@@ -95,16 +95,17 @@ if ((REQUEST_ISSET_GET('id')) && (REQUEST_ISSET_GET(('mode')))) {
                define('__CELL'       , $DATA['cell']);
                define('__EMAIL'      , $DATA['email']);
                define('__URL'        , $DATA['url']);
+
                //  Warning because low points
-               define('__REC_WARNING', ADD_SELECTION('yn', $DATA['receive_warnings'], "receive_warning"));
-               define('__INTERVAL'   , createTimeSelections($DATA['warning_interval'], "warning_interval", "MWDh"));
+               define('__REC_WARNING', ADD_SELECTION('yn', $DATA['receive_warnings'], 'receive_warning'));
+               define('__INTERVAL'   , createTimeSelections($DATA['warning_interval'], 'warning_interval', 'MWDh'));
 
                // Init variables here
-               $TPL = sprintf("admin_edit_sponsor_%s", REQUEST_GET(('mode')));
+               $TPL = sprintf("admin_edit_sponsor_%s", REQUEST_GET('mode'));
                INIT_SQLS();
 
                // Sponsor was found
-               if ((IS_FORM_SENT()) || (REQUEST_ISSET_POST('edit'))) {
+               if ((isFormSent()) || (REQUEST_ISSET_POST('edit'))) {
                        // Perform action on mode
                        switch (REQUEST_GET('mode'))
                        {
@@ -156,10 +157,10 @@ if ((REQUEST_ISSET_GET('id')) && (REQUEST_ISSET_GET(('mode')))) {
 
                                case 'edit': // Edit sponsor account
                                        $PASS = true;
-                                       if ((REQUEST_POST('pass1') != REQUEST_POST('pass2')) || ((!REQUEST_ISSET_POST(('pass1'))) && (!REQUEST_ISSET_POST(('pass1'))))) {
+                                       if ((REQUEST_POST('pass1') != REQUEST_POST('pass2')) || ((!REQUEST_ISSET_POST('pass1')) && (!REQUEST_ISSET_POST('pass1')))) {
                                                // Remove passwords
-                                               REQUEST_UNSET_POST(('pass1'));
-                                               REQUEST_UNSET_POST(('pass2'));
+                                               REQUEST_UNSET_POST('pass1');
+                                               REQUEST_UNSET_POST('pass2');
                                                $PASS = false;
                                        }
 
@@ -183,7 +184,7 @@ if ((REQUEST_ISSET_GET('id')) && (REQUEST_ISSET_GET(('mode')))) {
 
                                default: // Unknown mode
                                        DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown mode %s detected.", REQUEST_GET('mode')));
-                                       $message = sprintf(getMessage('ADMIN_SPONSOR_INVALID_MODE'), REQUEST_GET(('mode')));
+                                       $message = sprintf(getMessage('ADMIN_SPONSOR_INVALID_MODE'), REQUEST_GET('mode'));
                                        break;
                        }
 
@@ -199,7 +200,7 @@ if ((REQUEST_ISSET_GET('id')) && (REQUEST_ISSET_GET(('mode')))) {
                        LOAD_TEMPLATE($TPL);
                } else {
                        // Template not found!
-                       LOAD_TEMPLATE('admin_settings_saved', false, sprintf(getMessage('ADMIN_SPONSOR_MODUS_TPL_404'), REQUEST_GET(('mode'))));
+                       LOAD_TEMPLATE('admin_settings_saved', false, sprintf(getMessage('ADMIN_SPONSOR_MODUS_TPL_404'), REQUEST_GET('mode')));
                }
        } else {
                // Sponsor not found!