]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/guest/what-sponsor_login.php
Huge rewrite:
[mailer.git] / inc / modules / guest / what-sponsor_login.php
index fdbcf0ca11e346e64d787ef0b60a48851f463aab..ab53bbc8ec63c6b735916bb08c97f28992430bab 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;
 }
 
@@ -48,7 +48,7 @@ if (!defined('__SECURITY')) {
 ADD_DESCR('guest', __FILE__);
 
 $mode = '';
-if (REQUEST_ISSET_GET(('mode'))) {
+if (REQUEST_ISSET_GET('mode')) {
        // A "special" mode of the login system was requested
        switch (REQUEST_GET('mode'))
        {
@@ -149,12 +149,12 @@ WHERE email='%s' AND (`status`='UNCONFIRMED' OR `status`='EMAIL') LIMIT 1",
                        // Prepare email and send it to the sponsor
                        if ($SPONSOR['status'] == 'UNCONFIRMED') {
                                // Unconfirmed accounts
-                               $msg_sponsor = LOAD_EMAIL_TEMPLATE('sponsor_activate', $SPONSOR);
+                               $message_sponsor = LOAD_EMAIL_TEMPLATE('sponsor_activate', $SPONSOR);
                        } else {
                                // Confirmed email address
-                               $msg_sponsor = LOAD_EMAIL_TEMPLATE('sponsor_email', $SPONSOR);
+                               $message_sponsor = LOAD_EMAIL_TEMPLATE('sponsor_email', $SPONSOR);
                        }
-                       sendEmail(REQUEST_POST('email'), getMessage('SPONSOR_ACTIVATION_LINK_SUBJ'), $msg_sponsor);
+                       sendEmail(REQUEST_POST('email'), getMessage('SPONSOR_ACTIVATION_LINK_SUBJ'), $message_sponsor);
 
                        // Output message
                        LOAD_TEMPLATE('admin_settings_saved', false, getMessage('SPONSOR_ACTIVATION_LINK_SENT'));
@@ -178,31 +178,31 @@ WHERE email='%s' AND (`status`='UNCONFIRMED' OR `status`='EMAIL') LIMIT 1",
 
        if (isFormSent()) {
                // Check email
-               $result = SQL_QUERY_ESC("SELECT id, hash, remote_addr, gender, surname, family, sponsor_created
+               $result = SQL_QUERY_ESC("SELECT `id`, `hash`, `remote_addr`, `gender`, `surname`, `family`, `sponsor_created`
 FROM `{!_MYSQL_PREFIX!}_sponsor_data`
-WHERE email='%s' AND id='%s' AND `status`='CONFIRMED' LIMIT 1",
+WHERE `email`='%s' AND `id`='%s' AND `status`='CONFIRMED' LIMIT 1",
                array(REQUEST_POST('email'), bigintval(REQUEST_POST('id'))), __FILE__, __LINE__);
 
                // Entry found?
                if (SQL_NUMROWS($result) == 1) {
                        // Unconfirmed sponsor account found so let's load the requested data
-                       $SPONSOR = SQL_FETCHARRAY($result);
+                       $DATA = SQL_FETCHARRAY($result);
 
                        // Translate some data
-                       $SPONSOR['gender']           = translateGender($SPONSOR['gender']);
-                       $SPONSOR['sponsor_created'] = generateDateTime($SPONSOR['sponsor_created']);
+                       $DATA['gender']           = translateGender($DATA['gender']);
+                       $DATA['sponsor_created'] = generateDateTime($DATA['sponsor_created']);
 
                        // Generate password
-                       $SPONSOR['password']        = generatePassword();
+                       $DATA['password']        = generatePassword();
 
                        // Prepare email and send it to the sponsor
-                       $msg_sponsor = LOAD_EMAIL_TEMPLATE('sponsor_lost', $SPONSOR);
-                       sendEmail(REQUEST_POST('email'), getMessage('SPONSOR_LOST_PASSWORD_SUBJ'), $msg_sponsor);
+                       $message_sponsor = LOAD_EMAIL_TEMPLATE('sponsor_lost', $DATA);
+                       sendEmail(REQUEST_POST('email'), getMessage('SPONSOR_LOST_PASSWORD_SUBJ'), $message_sponsor);
 
                        // Update password
-                       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_sponsor_data` SET password='%s'
+                       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_sponsor_data` SET `password`='%s'
 WHERE `id`='%s' LIMIT 1",
-                       array(md5($SPONSOR['password']), bigintval($SPONSOR['id'])), __FILE__, __LINE__);
+                               array(md5($DATA['password']), bigintval($DATA['id'])), __FILE__, __LINE__);
 
                        // Output message
                        LOAD_TEMPLATE('admin_settings_saved', false, getMessage('SPONSOR_LOST_PASSWORD_SENT'));