]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/guest/what-sponsor_login.php
Complete rewrite and debug message surpressed:
[mailer.git] / inc / modules / guest / what-sponsor_login.php
index 192a4b4b225e377422114efeed6c33b35c22c502..2d2d5485d4b5a2489d254c6342b9a2b98f4cfd8b 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__, sprintf(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), 'sponsor'));
+       addFatalMessage(__FILE__, __LINE__, generateExtensionInactiveNotInstalledMessage('sponsor'));
        return;
 }
 
@@ -58,7 +58,7 @@ if (REQUEST_ISSET_GET(('mode'))) {
 } // END - if
 
 // Check if hash for confirmation of email address is given...
-if (REQUEST_ISSET_GET(('hash'))) {
+if (REQUEST_ISSET_GET('hash')) {
        // Lookup sponsor
        $result = SQL_QUERY_ESC("SELECT id, status, gender, surname, family,
 company, position, tax_ident,
@@ -81,7 +81,7 @@ LIMIT 1", array(REQUEST_GET('hash')), __FILE__, __LINE__);
                        // Set account to pending
                        SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_sponsor_data` SET `status`='PENDING'
 WHERE `id`='%s' AND hash='%s' AND `status`='UNCONFIRMED' LIMIT 1",
-                               array(bigintval($SPONSOR['id']), REQUEST_GET('hash')), __FILE__, __LINE__);
+                       array(bigintval($SPONSOR['id']), REQUEST_GET('hash')), __FILE__, __LINE__);
 
                        // Check on success
                        if (SQL_AFFECTEDROWS() == 1) {
@@ -102,9 +102,9 @@ WHERE `id`='%s' AND hash='%s' AND `status`='UNCONFIRMED' LIMIT 1",
                        // Changed email adress need to be confirmed
                        SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_sponsor_data` SET `status`='CONFIRMED'
 WHERE `id`='%s' AND hash='%s' AND `status`='EMAIL' LIMIT 1",
-                               array(bigintval($SPONSOR['id']), REQUEST_GET('hash')), __FILE__, __LINE__);
+                       array(bigintval($SPONSOR['id']), REQUEST_GET('hash')), __FILE__, __LINE__);
 
-                       // Check on success 
+                       // Check on success
                        if (SQL_AFFECTEDROWS() == 1) {
                                // Sponsor account is unlocked again
                                LOAD_TEMPLATE('admin_settings_saved', false, getMessage('SPONSOR_ACCOUNT_IS_CONFIRMED_AGAIN'));
@@ -125,17 +125,17 @@ WHERE `id`='%s' AND hash='%s' AND `status`='EMAIL' LIMIT 1",
        SQL_FREERESULT($result);
 } elseif ($mode == 'activate') {
        // Send activation link again
-       if (IS_FORM_SENT()) {
+       if (isFormSent()) {
                // Check submitted data
-               if (!REQUEST_ISSET_POST(('email'))) REQUEST_UNSET_POST('ok');
+               if (!REQUEST_ISSET_POST('email')) REQUEST_UNSET_POST('ok');
        }
 
-       if (IS_FORM_SENT()) {
+       if (isFormSent()) {
                // Check email
                $result = SQL_QUERY_ESC("SELECT id, hash, status, remote_addr, gender, surname, family, sponsor_created
 FROM `{!_MYSQL_PREFIX!}_sponsor_data`
 WHERE email='%s' AND (`status`='UNCONFIRMED' OR `status`='EMAIL') LIMIT 1",
-                       array(REQUEST_POST('email')), __FILE__, __LINE__);
+               array(REQUEST_POST('email')), __FILE__, __LINE__);
 
                // Entry found?
                if (SQL_NUMROWS($result) == 1) {
@@ -171,17 +171,17 @@ WHERE email='%s' AND (`status`='UNCONFIRMED' OR `status`='EMAIL') LIMIT 1",
        }
 } elseif ($mode == 'lost_pass') {
        // Send new password
-       if (IS_FORM_SENT()) {
+       if (isFormSent()) {
                // Check submitted data
-               if (!REQUEST_ISSET_POST(('email'))) REQUEST_UNSET_POST('ok');
+               if (!REQUEST_ISSET_POST('email')) REQUEST_UNSET_POST('ok');
        } // END - if
 
-       if (IS_FORM_SENT()) {
+       if (isFormSent()) {
                // Check email
                $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",
-                       array(REQUEST_POST('email'), bigintval(REQUEST_POST('id'))), __FILE__, __LINE__);
+               array(REQUEST_POST('email'), bigintval(REQUEST_POST('id'))), __FILE__, __LINE__);
 
                // Entry found?
                if (SQL_NUMROWS($result) == 1) {
@@ -202,7 +202,7 @@ WHERE email='%s' AND id='%s' AND `status`='CONFIRMED' LIMIT 1",
                        // Update password
                        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($SPONSOR['password']), bigintval($SPONSOR['id'])), __FILE__, __LINE__);
 
                        // Output message
                        LOAD_TEMPLATE('admin_settings_saved', false, getMessage('SPONSOR_LOST_PASSWORD_SENT'));
@@ -217,11 +217,11 @@ WHERE `id`='%s' LIMIT 1",
                // Load form
                LOAD_TEMPLATE('guest_sponsor_lost');
        }
-} elseif (IS_FORM_SENT()) {
+} elseif (isFormSent()) {
        // Check status and login data ...
        $result = SQL_QUERY_ESC("SELECT status FROM `{!_MYSQL_PREFIX!}_sponsor_data`
 WHERE `id`='%s' AND password='%s' LIMIT 1",
-               array(bigintval(REQUEST_POST('sponsorid')), md5(REQUEST_POST('pass'))), __FILE__, __LINE__);
+       array(bigintval(REQUEST_POST('sponsorid')), md5(REQUEST_POST('pass'))), __FILE__, __LINE__);
 
        if (SQL_NUMROWS($result) == 1) {
                // Okay, first login data check passed, now has he/she an approved (CONFIRMED) account?
@@ -229,7 +229,7 @@ WHERE `id`='%s' AND password='%s' LIMIT 1",
                if ($status == 'CONFIRMED') {
                        // Is confirmed so both is fine and we can continue with login procedure
                        $login = ((setSession('sponsorid'  , bigintval(REQUEST_POST('sponsorid')))) &&
-                                 (setSession('sponsorpass', md5(REQUEST_POST('pass'))           ))
+                       (setSession('sponsorpass', md5(REQUEST_POST('pass'))           ))
                        );
 
                        if ($login === true) {