X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fguest%2Fwhat-sponsor_login.php;h=ab53bbc8ec63c6b735916bb08c97f28992430bab;hb=36c3c8b749a88ce05ad0fda81e00047f9cb5433f;hp=40ecd01c95b3347afbb118c90a7eb78c9d0c31c6;hpb=5b8d588fdbfa375fa859ca80a9b9e1735a13300e;p=mailer.git diff --git a/inc/modules/guest/what-sponsor_login.php b/inc/modules/guest/what-sponsor_login.php index 40ecd01c95..ab53bbc8ec 100644 --- a/inc/modules/guest/what-sponsor_login.php +++ b/inc/modules/guest/what-sponsor_login.php @@ -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; } @@ -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')) { @@ -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, @@ -125,12 +125,12 @@ 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 (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` @@ -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')); @@ -171,38 +171,38 @@ 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'); } // END - if - if (IS_FORM_SENT()) { + 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')); @@ -217,7 +217,7 @@ 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",