]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/guest/what-sponsor_login.php
Fixed handling of float values, ext-surfbar continued:
[mailer.git] / inc / modules / guest / what-sponsor_login.php
index 82a49d2b5525f730c27eec1dffc9613e6c98e651..5fccf754029cf8967e7b8952cf0312e10dbfa634 100644 (file)
@@ -16,7 +16,7 @@
  * $Author::                                                          $ *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009 - 2011 by Mailer Developer Team                   *
+ * Copyright (c) 2009 - 2012 by Mailer Developer Team                   *
  * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -37,7 +37,7 @@
 
 // Some security stuff...
 if (!defined('__SECURITY')) {
-       die();
+       exit();
 } // END - if
 
 // Add description as navigation point
@@ -52,9 +52,9 @@ if ((!isExtensionActive('sponsor'))) {
 }
 
 $mode = '';
-if (isGetRequestElementSet('mode')) {
+if (isGetRequestElementSet('do')) {
        // A "special" mode of the login system was requested
-       switch (getRequestElement('mode')) {
+       switch (getRequestElement('do')) {
                case 'activate' : $mode = 'activate';  break; // Activation link requested
                case 'lost_pass': $mode = 'lost_pass'; break; // Request new password
        } // END - switch
@@ -64,10 +64,10 @@ if (isGetRequestElementSet('mode')) {
 if (isGetRequestElementSet('hash')) {
        // Lookup sponsor
        $result = SQL_QUERY_ESC("SELECT
-       `id`,`status`,`gender`,`surname`,`family`,
-       `company`,`position`,`tax_ident`,
-       `street_nr1`,`street_nr2`,`country`,`zip`,`city`,`email`,`phone`,`fax`,`cell`,
-       `points_amount` AS `points`,`last_payment`,`last_currency`
+       `id`, `status`, `gender`, `surname`, `family`,
+       `company`, `position`, `tax_ident`,
+       `street_nr1`, `street_nr2`, `country`, `zip`, `city`, `email`, `phone`, `fax`, `cell`,
+       `points_amount` AS `points`, `last_payment`, `last_currency`
 FROM
        `{?_MYSQL_PREFIX?}_sponsor_data`
 WHERE
@@ -148,15 +148,21 @@ LIMIT 1",
        SQL_FREERESULT($result);
 } elseif ($mode == 'activate') {
        // Send activation link again
-       if (isFormSent()) {
+       if (isFormSent('login')) {
                // Check submitted data
-               if (!isPostRequestElementSet('email')) unsetPostRequestElement('ok');
+               if (!isPostRequestElementSet('email')) unsetPostRequestElement('login');
        }
 
-       if (isFormSent()) {
+       if (isFormSent('login')) {
                // Check email
                $result = SQL_QUERY_ESC("SELECT
-       `id`,`hash`,`status`,`remote_addr`,`gender`,`surname`,`family`,
+       `id`,
+       `hash`,
+       `status`,
+       `remote_addr`,
+       `gender`,
+       `surname`,
+       `family`,
        UNIX_TIMESTAMP(`sponsor_created`) AS `sponsor_created`
 FROM
        `{?_MYSQL_PREFIX?}_sponsor_data`
@@ -199,15 +205,20 @@ LIMIT 1",
        }
 } elseif ($mode == 'lost_pass') {
        // Send new password
-       if (isFormSent()) {
+       if (isFormSent('login')) {
                // Check submitted data
-               if (!isPostRequestElementSet('email')) unsetPostRequestElement('ok');
+               if (!isPostRequestElementSet('email')) unsetPostRequestElement('login');
        } // END - if
 
-       if (isFormSent()) {
+       if (isFormSent('login')) {
                // Check email
                $result = SQL_QUERY_ESC("SELECT
-       `id`,`hash`,`remote_addr`,`gender`,`surname`,`family`,
+       `id`,
+       `hash`,
+       `remote_addr`,
+       `gender`,
+       `surname`,
+       `family`,
        UNIX_TIMESTAMP(`sponsor_created`) AS `sponsor_created`
 FROM
        `{?_MYSQL_PREFIX?}_sponsor_data`
@@ -254,7 +265,7 @@ LIMIT 1",
                // Load form
                loadTemplate('guest_sponsor_lost');
        }
-} elseif (isFormSent()) {
+} elseif (isFormSent('login')) {
        // Check status and login data ...
        $result = SQL_QUERY_ESC("SELECT
        `status`
@@ -278,7 +289,7 @@ LIMIT 1",
                        (setSession('sponsor_pass', md5(postRequestElement('password'))           ))
                        );
 
-                       if ($login === true) {
+                       if ($login === TRUE) {
                                // Cookie setup successfull so we can forward to sponsor area
                                redirectToUrl('modules.php?module=sponsor');
                        } else {