X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Flibs%2Fsponsor_functions.php;h=c4d10ecb2fef5ede6e41ef79fd8ba8641aba0cae;hb=9b06a0b9b72fbdaf5bf638df82ae37c56a5654cb;hp=eb9aad248ebdc74551fe2ff141176c2e4bcd426f;hpb=0f3a135204757cc8750262871c8e62c42300acb4;p=mailer.git diff --git a/inc/libs/sponsor_functions.php b/inc/libs/sponsor_functions.php index eb9aad248e..c4d10ecb2f 100644 --- a/inc/libs/sponsor_functions.php +++ b/inc/libs/sponsor_functions.php @@ -135,7 +135,7 @@ function handleSponsorRequest ($postData, $update=false, $messageArray = array() // Remove last ", " from SQL string $sql = substr($sql, 0, -2)." WHERE `id`=%s LIMIT 1"; - $DATA['values'][] = bigintval(getRequestParameter('id')); + $DATA['values'][] = bigintval(getRequestElement('id')); // Generate message $message = getMessageFromIndexedArray('{--ADMIN_SPONSOR_UPDATED--}', 'updated', $messageArray); @@ -217,7 +217,7 @@ function handleSponsorRequest ($postData, $update=false, $messageArray = array() } // Translate the account status -function sponsorTranslateUserStatus ($status) { +function translateSponsorStatus ($status) { // Construct constant name $constantName = sprintf("ACCOUNT_STATUS_%s", $status); @@ -535,7 +535,8 @@ function generateSponsorEmailLink ($email, $mod = 'admin') { FROM `{?_MYSQL_PREFIX?}_sponsor_data` WHERE - `email`='%s'" . $locked." + '%s' REGEXP `email` + " . $locked . " LIMIT 1", array($email), __FUNCTION__, __LINE__); if (SQL_NUMROWS($result) == 1) { @@ -565,8 +566,8 @@ function doProcessSponsorFormRequest ($messageArray = array()) { switch ($status) { case 'added': // Sponsor successfully added with account status = UNCONFIRMED! // Check for his id number - $result = SQL_QUERY_ESC("SELECT `id`,`hash` FROM `{?_MYSQL_PREFIX?}_sponsor_data` WHERE `email`='%s' LIMIT 1", - array(postRequestParameter('email')), __FUNCTION__, __LINE__); + $result = SQL_QUERY_ESC("SELECT `id`,`hash` FROM `{?_MYSQL_PREFIX?}_sponsor_data` WHERE '%s' REGEXP `email` LIMIT 1", + array(postRequestElement('email')), __FUNCTION__, __LINE__); if (SQL_NUMROWS($result) == 1) { // id found so let's load it for the confirmation email list($id, $hash) = SQL_FETCHROW($result); @@ -574,15 +575,15 @@ function doProcessSponsorFormRequest ($messageArray = array()) { // Prepare data for the email template $content['id'] = $id; $content['hash'] = $hash; - $content['email'] = postRequestParameter('email'); - $content['surname'] = postRequestParameter('surname'); - $content['family'] = postRequestParameter('family'); + $content['email'] = postRequestElement('email'); + $content['surname'] = postRequestElement('surname'); + $content['family'] = postRequestElement('family'); $content['timestamp'] = generateDateTime(time(), 0); - $content['password'] = postRequestParameter('pass1'); + $content['password'] = postRequestElement('pass1'); // Generate email and send it to the new sponsor $message = loadEmailTemplate('sponsor_confirm', $content, $id); - sendEmail(postRequestParameter('email'), '{--SPONSOR_PLEASE_CONFIRM_SUBJECT--}', $message); + sendEmail(postRequestElement('email'), '{--SPONSOR_PLEASE_CONFIRM_SUBJECT--}', $message); // Send mail to admin sendAdminNotification('{--ADMIN_NEW_SPONSOR--}', 'admin_sponsor_reg', $content); @@ -591,7 +592,7 @@ function doProcessSponsorFormRequest ($messageArray = array()) { $message = $messageArray['added']; } else { // Sponsor account not found??? - $message = '{%message,SPONSOR_EMAIL_404=' . postRequestParameter('email') . '%}'; + $message = '{%message,SPONSOR_EMAIL_404=' . postRequestElement('email') . '%}'; } // Free memory