]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/guest/what-sponsor_login.php
Floater added, admin_header.tpl added, EL code improved:
[mailer.git] / inc / modules / guest / what-sponsor_login.php
index af26e823b616dfe82dda1a6ef4f55006e012caca..215d31782bf4ecbfa808b7f417e48787407cab21 100644 (file)
@@ -14,8 +14,6 @@
  * $Date::                                                            $ *
  * $Tag:: 0.2.1-FINAL                                                 $ *
  * $Author::                                                          $ *
- * Needs to be in all Files and every File needs "svn propset           *
- * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
  * Copyright (c) 2009, 2010 by Mailer Developer Team                    *
@@ -157,9 +155,15 @@ LIMIT 1",
 
        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",
+               $result = SQL_QUERY_ESC("SELECT
+       `id`, `hash`, `status`, `remote_addr`, `gender`, `surname`, `family`,
+       UNIX_TIMESTAMP(`sponsor_created`) AS `sponsor_created`
+FROM
+       `{?_MYSQL_PREFIX?}_sponsor_data`
+WHERE
+       `email`='%s' AND
+       (`status`='UNCONFIRMED' OR `status`='EMAIL')
+LIMIT 1",
                array(postRequestParameter('email')), __FILE__, __LINE__);
 
                // Entry found?
@@ -203,7 +207,8 @@ 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`
+       `id`, `hash`, `remote_addr`, `gender`, `surname`, `family`,
+       UNIX_TIMESTAMP(`sponsor_created`) AS `sponsor_created`
 FROM
        `{?_MYSQL_PREFIX?}_sponsor_data`
 WHERE
@@ -218,12 +223,9 @@ LIMIT 1",
                        // Unconfirmed sponsor account found so let's load the requested data
                        $DATA = SQL_FETCHARRAY($result);
 
-                       // Translate some data
-                       $DATA['gender']          = translateGender($DATA['gender']);
-                       $DATA['sponsor_created'] = generateDateTime($DATA['sponsor_created']);
-
-                       // Generate password
+                       // Generate password/translate some data
                        $DATA['password']        = generatePassword();
+                       $DATA['sponsor_created'] = generateDateTime($DATA['sponsor_created']);
 
                        // Prepare email and send it to the sponsor
                        $message_sponsor = loadEmailTemplate('sponsor_lost', $DATA);
@@ -273,7 +275,7 @@ LIMIT 1",
                if ($status == 'CONFIRMED') {
                        // Is confirmed so both is fine and we can continue with login procedure
                        $login = ((setSession('sponsor_id'  , bigintval(postRequestParameter('sponsor_id')))) &&
-                       (setSession('sponsorpass', md5(postRequestParameter('password'))           ))
+                       (setSession('sponsor_pass', md5(postRequestParameter('password'))           ))
                        );
 
                        if ($login === true) {
@@ -281,7 +283,7 @@ LIMIT 1",
                                redirectToUrl('modules.php?module=sponsor');
                        } else {
                                // Cookie setup failed!
-                               loadTemplate('admin_settings_saved', false, '{--SPONSPOR_COOKIE_SETUP_FAILED--}');
+                               loadTemplate('admin_settings_saved', false, '{--SPONSOR_COOKIE_SETUP_FAILED--}');
 
                                // Login formular and other links
                                loadTemplate('guest_sponsor_login');