]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/sponsor/account.php
Heavy rewrite:
[mailer.git] / inc / modules / sponsor / account.php
index a2eeaeb420396f75bdc595f68bf143ef3a85f4f6..078d7f6e1f8dcb3322255551950213d3dd8e60bb 100644 (file)
@@ -40,7 +40,7 @@ if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
        require($INC);
 } elseif (!EXT_IS_ACTIVE('sponsor')) {
-       addFatalMessage(__FILE__, __LINE__, generateExtensionInactiveMessage('sponsor'));
+       addFatalMessage(__FILE__, __LINE__, generateExtensionInactiveNotInstalledMessage('sponsor'));
        return;
 } elseif (!IS_SPONSOR()) {
        // No sponsor!
@@ -49,13 +49,13 @@ if (!defined('__SECURITY')) {
 }
 
 // Data for the formular
-$result = SQL_QUERY_ESC("SELECT company, position, tax_ident,
-gender, surname, family, street_nr1, street_nr2, zip, city, country,
-phone, fax, cell, email, url,
-status, receive_warnings
+$result = SQL_QUERY_ESC("SELECT `company`, `position`, `tax_ident`,
+`gender`, `surname`, `family`, `street_nr1`, `street_nr2`, `zip`, `city`, `country`,
+`phone`, `fax`, `cell`, `email`, `url`,
+`status`, `receive_warnings`
 FROM `{!_MYSQL_PREFIX!}_sponsor_data`
-WHERE `id`='%s' AND password='%s' LIMIT 1",
-array(bigintval(getSession('sponsorid')), getSession('sponsorpass')), __FILE__, __LINE__);
+WHERE `id`='%s' AND `password`='%s' LIMIT 1",
+       array(bigintval(getSession('sponsorid')), getSession('sponsorpass')), __FILE__, __LINE__);
 
 // Entry found?
 if (SQL_NUMROWS($result) == 1) {
@@ -65,22 +65,22 @@ if (SQL_NUMROWS($result) == 1) {
                // Check if form was submitted or not
                if (isFormSent()) {
                        // Check passwords
-                       if (!REQUEST_ISSET_POST(('pass_old'))) {
+                       if (!REQUEST_ISSET_POST('pass_old')) {
                                // No current password entered
                                $message = getMessage('SPONSOR_NO_CURRENT_PASSWORD_ENTERED');
                        } elseif (md5(REQUEST_POST('pass_old')) != getSession('sponsorpass')) {
                                // Entered password didn't match password in DB
                                $message = getMessage('SPONSOR_CURRENT_PASSWORD_DIDNOT_MATCH_DB');
-                       } elseif ((REQUEST_ISSET_POST(('pass1'))) && (REQUEST_ISSET_POST(('pass2'))) && (REQUEST_POST('pass1') != REQUEST_POST('pass2'))) {
+                       } elseif ((REQUEST_ISSET_POST('pass1')) && (REQUEST_ISSET_POST('pass2')) && (REQUEST_POST('pass1') != REQUEST_POST('pass2'))) {
                                // Both new passwords did not match
                                $message = getMessage('SPONSOR_BOTH_NEW_PASSWORDS_DIDNOT_MATCH');
-                       } elseif ((!REQUEST_ISSET_POST(('pass1'))) && (REQUEST_ISSET_POST(('pass2')))) {
+                       } elseif ((!REQUEST_ISSET_POST('pass1')) && (REQUEST_ISSET_POST('pass2'))) {
                                // No password one entered
                                $message = getMessage('SPONSOR_PASSWORD_ONE_EMPTY');
-                       } elseif ((REQUEST_ISSET_POST(('pass1'))) && (!REQUEST_ISSET_POST(('pass2')))) {
+                       } elseif ((REQUEST_ISSET_POST('pass1')) && (!REQUEST_ISSET_POST('pass2'))) {
                                // No password two entered
                                $message = getMessage('SPONSOR_PASSWORD_TWO_EMPTY');
-                       } elseif ((REQUEST_ISSET_POST(('pass1'))) && (strlen(REQUEST_POST('pass1')) < getConfig('pass_len'))) {
+                       } elseif ((REQUEST_ISSET_POST('pass1')) && (strlen(REQUEST_POST('pass1')) < getConfig('pass_len'))) {
                                // Too short password
                                $message = sprintf(getMessage('SPONSOR_PASSWORD_TOO_SHORT'), getConfig('pass_len'));
                        } else {
@@ -88,7 +88,7 @@ if (SQL_NUMROWS($result) == 1) {
                                $PASS_AND = ''; $PASS_DATA = '';
 
                                // Check if we want to change password or not
-                               if ((REQUEST_POST('pass1') == REQUEST_POST('pass2')) && (REQUEST_ISSET_POST(('pass1'))) && (REQUEST_POST('pass1') != REQUEST_POST('pass_old'))) {
+                               if ((REQUEST_POST('pass1') == REQUEST_POST('pass2')) && (REQUEST_ISSET_POST('pass1')) && (REQUEST_POST('pass1') != REQUEST_POST('pass_old'))) {
                                        // Change current password
                                        $PASS_AND  = ", password='%s'";
                                        $PASS_DATA = md5(REQUEST_POST('pass1'));
@@ -120,19 +120,19 @@ if (SQL_NUMROWS($result) == 1) {
                        // Check for gender selection
                        switch ($content['gender'])
                        {
-                               case "M": // Male
+                               case 'M': // Male
                                        define('__GENDER_M', ' selected="selected"');
                                        define('__GENDER_F', '');
                                        define('__GENDER_C', '');
                                        break;
 
-                               case "F": // Female
+                               case 'F': // Female
                                        define('__GENDER_M', '');
                                        define('__GENDER_F', ' selected="selected"');
                                        define('__GENDER_C', '');
                                        break;
 
-                               case "C": // Company
+                               case 'C': // Company
                                        define('__GENDER_M', '');
                                        define('__GENDER_F', '');
                                        define('__GENDER_C', ' selected="selected"');
@@ -140,7 +140,7 @@ if (SQL_NUMROWS($result) == 1) {
                        }
 
                        // Output formular
-                       $OUT = LOAD_TEMPLATE("sponsor_account_form", true, $content);
+                       $OUT = LOAD_TEMPLATE('sponsor_account_form', true, $content);
                }
        } else {
                // Locked or so?