- Major change in LOAD_EMAIL_TEMPLATE(). The deprecated switch() block has
[mailer.git] / inc / modules / guest / what-sponsor_login.php
index 09f1ff10951f80858241ca35840db405078f0a0c..6da3f8aa85afe0833ce4d9f7e9767bc284bf103e 100644 (file)
@@ -55,7 +55,7 @@ if (!empty($_GET['mode']))
 if (!empty($_GET['hash']))
 {
        // Lookup sponsor
-       $result = SQL_QUERY_ESC("SELECT id, status, salut, surname, family,
+       $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_pay AS pay, last_curr AS curr
@@ -67,8 +67,8 @@ LIMIT 1", array($_GET['hash']), __FILE__, __LINE__);
                // Sponsor found, load his data...
                $SPONSOR = SQL_FETCHARRAY($result);
 
-               // Translate salut and comma
-               $SPONSOR['salut']  = TRANSLATE_SEX($SPONSOR['salut']);
+               // Translate gender and comma
+               $SPONSOR['gender']  = TRANSLATE_GENDER($SPONSOR['gender']);
                $SPONSOR['points'] = TRANSLATE_COMMA($SPONSOR['points']);
                $SPONSOR['pay']    = TRANSLATE_COMMA($SPONSOR['pay']);
 
@@ -136,26 +136,26 @@ WHERE id='%s' AND hash='%s' AND status='EMAIL' LIMIT 1",
  elseif ($MODE == "activate")
 {
        // Send activation link again
-       if (isset($HTTP_POST_VARS['ok']))
+       if (isset($_POST['ok']))
        {
                // Check submitted data
-               if (empty($HTTP_POST_VARS['email'])) unset($HTTP_POST_VARS['ok']);
+               if (empty($_POST['email'])) unset($_POST['ok']);
        }
 
-       if (isset($HTTP_POST_VARS['ok']))
+       if (isset($_POST['ok']))
        {
                // Check email
-               $result = SQL_QUERY_ESC("SELECT id, hash, status, remote_addr, salut, surname, family, sponsor_created
+               $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($HTTP_POST_VARS['email']), __FILE__, __LINE__);
+ array($_POST['email']), __FILE__, __LINE__);
                if (SQL_NUMROWS($result) == 1)
                {
                        // Unconfirmed sponsor account found so let's load the requested data
                        $SPONSOR = SQL_FETCHARRAY($result);
 
                        // Translate some data
-                       $SPONSOR['salut']           = TRANSLATE_SEX($SPONSOR['salut']);
+                       $SPONSOR['gender']           = TRANSLATE_GENDER($SPONSOR['gender']);
                        $SPONSOR['sponsor_created'] = MAKE_DATETIME($SPONSOR['sponsor_created']);
 
                        // Prepare email and send it to the sponsor
@@ -169,7 +169,7 @@ WHERE email='%s' AND (status='UNCONFIRMED' OR status='EMAIL') LIMIT 1",
                                // Confirmed email address
                                $msg_sponsor = LOAD_EMAIL_TEMPLATE("sponsor_email", $SPONSOR);
                        }
-                       SEND_EMAIL($HTTP_POST_VARS['email'], SPONSOR_ACTIVATION_LINK_SUBJ, $msg_sponsor);
+                       SEND_EMAIL($_POST['email'], SPONSOR_ACTIVATION_LINK_SUBJ, $msg_sponsor);
 
                        // Output message
                        LOAD_TEMPLATE("admin_settings_saved", false, SPONSOR_ACTIVATION_LINK_SENT);
@@ -192,26 +192,26 @@ WHERE email='%s' AND (status='UNCONFIRMED' OR status='EMAIL') LIMIT 1",
  elseif ($MODE == "lost_pass")
 {
        // Send new password
-       if (isset($HTTP_POST_VARS['ok']))
+       if (isset($_POST['ok']))
        {
                // Check submitted data
-               if (empty($HTTP_POST_VARS['email'])) unset($HTTP_POST_VARS['ok']);
+               if (empty($_POST['email'])) unset($_POST['ok']);
        }
 
-       if (isset($HTTP_POST_VARS['ok']))
+       if (isset($_POST['ok']))
        {
                // Check email
-               $result = SQL_QUERY_ESC("SELECT id, hash, remote_addr, salut, 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",
- array($HTTP_POST_VARS['email'], bigintval($HTTP_POST_VARS['id'])), __FILE__, __LINE__);
+ array($_POST['email'], bigintval($_POST['id'])), __FILE__, __LINE__);
                if (SQL_NUMROWS($result) == 1)
                {
                        // Unconfirmed sponsor account found so let's load the requested data
                        $SPONSOR = SQL_FETCHARRAY($result);
 
                        // Translate some data
-                       $SPONSOR['salut']           = TRANSLATE_SEX($SPONSOR['salut']);
+                       $SPONSOR['gender']           = TRANSLATE_GENDER($SPONSOR['gender']);
                        $SPONSOR['sponsor_created'] = MAKE_DATETIME($SPONSOR['sponsor_created']);
 
                        // Generate password
@@ -219,7 +219,7 @@ WHERE email='%s' AND id='%s' AND status='CONFIRMED' LIMIT 1",
 
                        // Prepare email and send it to the sponsor
                        $msg_sponsor = LOAD_EMAIL_TEMPLATE("sponsor_lost", $SPONSOR);
-                       SEND_EMAIL($HTTP_POST_VARS['email'], SPONSOR_LOST_PASSWORD_SUBJ, $msg_sponsor);
+                       SEND_EMAIL($_POST['email'], SPONSOR_LOST_PASSWORD_SUBJ, $msg_sponsor);
 
                        // Update password
                        $result_update = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_sponsor_data SET password='%s'
@@ -244,12 +244,12 @@ WHERE id='%s' LIMIT 1",
                LOAD_TEMPLATE("guest_sponsor_lost");
        }
 }
- elseif (isset($HTTP_POST_VARS['ok']))
+ elseif (isset($_POST['ok']))
 {
        // 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($HTTP_POST_VARS['sponsorid']), md5($HTTP_POST_VARS['pass'])), __FILE__, __LINE__);
+ array(bigintval($_POST['sponsorid']), md5($_POST['pass'])), __FILE__, __LINE__);
        if (SQL_NUMROWS($result) == 1)
        {
                // Okay, first login data check passed, now has he/she an approved (CONFIRMED) account?
@@ -261,8 +261,8 @@ WHERE id='%s' AND password='%s' LIMIT 1",
                        $life = (time() + $CONFIG['online_timeout']);
 
                        // Is confirmed so both is fine and we can continue with login procedure
-                       $login = ((setcookie("sponsorid"  , bigintval($HTTP_POST_VARS['sponsorid']), $life, COOKIE_PATH)) &&
-                                 (setcookie("sponsorpass", md5($HTTP_POST_VARS['pass'])           , $life, COOKIE_PATH)));
+                       $login = ((setcookie("sponsorid"  , bigintval($_POST['sponsorid']), $life, COOKIE_PATH)) &&
+                                 (setcookie("sponsorpass", md5($_POST['pass'])           , $life, COOKIE_PATH)));
 
                        if ($login)
                        {