X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=mailid.php;h=cebf439e9ad3179ee521c8f9f41906ee15bd650e;hp=e14fcc9c1d356b7a4a6623afc1a87cd454f4eb7f;hb=e444c97372c3c0e04e0707f1c2255c2f2efe37d5;hpb=57e61ecfebf491ac44d8c2dfccfc7244d930f614 diff --git a/mailid.php b/mailid.php index e14fcc9c1d..cebf439e9a 100644 --- a/mailid.php +++ b/mailid.php @@ -10,13 +10,8 @@ * -------------------------------------------------------------------- * * Kurzbeschreibung : Bestaetigung von Mails * * -------------------------------------------------------------------- * - * $Revision:: $ * - * $Date:: $ * - * $Tag:: 0.2.1-FINAL $ * - * $Author:: $ * - * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * - * Copyright (c) 2009 - 2012 by Mailer Developer Team * + * Copyright (c) 2009 - 2016 by Mailer Developer Team * * For more information visit: http://mxchange.org * * * * This program is free software; you can redistribute it and/or modify * @@ -48,17 +43,17 @@ $GLOBALS['__output_mode'] = '0'; // Disable copyright footer which would be to large for the upper frame $GLOBALS['__copyright_enabled'] = 'N'; -// Load the required file(s) -require('inc/config-global.php'); +// Initialize application +require('inc/init.php'); // Set content type and HTTP status setContentType('text/html'); setHttpStatus('404 Not Found'); -// Is the extension mailid active? +// Is ext-mailid active? redirectOnUninstalledExtension('mailid'); -// Is the extension other active? +// Is ext-other active? redirectOnUninstalledExtension('other'); // Init data @@ -80,30 +75,30 @@ if (isGetRequestElementSet('type')) $data['type'] = getRequestElement('type' // @TODO Improve check on $data['type'], empty() is not very much ... if ((isValidId($data['userid'])) && (isValidId($data['id'])) && (!empty($data['type'])) && (!ifFatalErrorsDetected())) { - // No image? - if ($data['do'] != 'img') { - // ... then output header - loadIncludeOnce('inc/header.php'); - } // END - fi - // Is 'do' still "frames"? if ($data['do'] == 'frames') { // This is a frameset module $GLOBALS['frameset_mode'] = TRUE; } // END - if - // Init result for below SQL_NUMROWS() function + // No image? + if ($data['do'] != 'img') { + // ... then output header + loadPageHeader(); + } // END - fi + + // Init result for below sqlNumRows() function $result_main = FALSE; // Maybe he wants to confirm an email? switch ($data['type']) { case 'normal': - $result_main = SQL_QUERY_ESC("SELECT `id` AS `link_id`, `link_type` FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `stats_id`=%s AND `userid`=%s LIMIT 1", + $result_main = sqlQueryEscaped("SELECT `id` AS `link_id`, `link_type` FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `stats_id`=%s AND `userid`=%s LIMIT 1", array($data['id'], $data['userid']), __FILE__, __LINE__); break; case 'bonus': - $result_main = SQL_QUERY_ESC("SELECT `id` AS `link_id`, `link_type` FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `bonus_id`=%s AND `userid`=%s LIMIT 1", + $result_main = sqlQueryEscaped("SELECT `id` AS `link_id`, `link_type` FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `bonus_id`=%s AND `userid`=%s LIMIT 1", array($data['id'], $data['userid']), __FILE__, __LINE__); break; @@ -113,9 +108,9 @@ if ((isValidId($data['userid'])) && (isValidId($data['id'])) && (!empty($data['t } // END - switch // Is an entry found? - if (SQL_NUMROWS($result_main) == 1) { + if (sqlNumRows($result_main) == 1) { // Is the stats id valid? - $data = merge_array($data, SQL_FETCHARRAY($result_main)); + $data = merge_array($data, sqlFetchArray($result_main)); // Init result here with invalid to avoid possible missing variable $result_mailid = FALSE; @@ -123,12 +118,12 @@ if ((isValidId($data['userid'])) && (isValidId($data['id'])) && (!empty($data['t // @TODO Rewrite this to a filter/function switch ($data['link_type']) { case 'NORMAL': - $result_mailid = SQL_QUERY_ESC("SELECT `pool_id`, `userid` AS `sender` FROM `{?_MYSQL_PREFIX?}_user_stats` WHERE `id`=%s LIMIT 1", + $result_mailid = sqlQueryEscaped("SELECT `pool_id`, `userid` AS `sender`, `url` FROM `{?_MYSQL_PREFIX?}_user_stats` WHERE `id`=%s LIMIT 1", array($data['id']), __FILE__, __LINE__); break; case 'BONUS': - $result_mailid = SQL_QUERY_ESC("SELECT `id` AS `pool_id`, `is_notify` FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `id`=%s LIMIT 1", + $result_mailid = sqlQueryEscaped("SELECT `id` AS `pool_id`, `is_notify`, `url` FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `id`=%s LIMIT 1", array($data['id']), __FILE__, __LINE__); break; @@ -138,9 +133,9 @@ if ((isValidId($data['userid'])) && (isValidId($data['id'])) && (!empty($data['t } // END - switch // Entry found? - if (SQL_NUMROWS($result_mailid) == 1) { + if (sqlNumRows($result_mailid) == 1) { // Load data - $data = merge_array($data, SQL_FETCHARRAY($result_mailid)); + $data = merge_array($data, sqlFetchArray($result_mailid)); // Correct notification switch in non-bonus mails if ((!isset($data['is_notify'])) || (!in_array($data['is_notify'], array('Y', 'N')))) { @@ -160,33 +155,33 @@ if ((isValidId($data['userid'])) && (isValidId($data['id'])) && (!empty($data['t // @TODO Rewrite this to a filter switch ($data['link_type']) { case 'NORMAL': - $result = SQL_QUERY_ESC("SELECT `payment_id` FROM `{?_MYSQL_PREFIX?}_user_stats` WHERE `pool_id`=%s LIMIT 1", + $result = sqlQueryEscaped("SELECT `payment_id` FROM `{?_MYSQL_PREFIX?}_user_stats` WHERE `pool_id`=%s LIMIT 1", array(bigintval($data['pool_id'])), __FILE__, __LINE__); // Entry found? - if (SQL_NUMROWS($result) == 1) { - $data = merge_array($data, SQL_FETCHARRAY($result)); + if (sqlNumRows($result) == 1) { + $data = merge_array($data, sqlFetchArray($result)); $data['time'] = getPaymentTime($data['payment_id']); $data['payment'] = getPaymentPayment($data['payment_id']); $isValid = TRUE; } // END - if // Free memory... - SQL_FREERESULT($result); + sqlFreeResult($result); break; case 'BONUS': - $result = SQL_QUERY_ESC("SELECT `time`, `points` AS `payment` FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `id`=%s LIMIT 1", + $result = sqlQueryEscaped("SELECT `time`, `points` AS `payment` FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `id`=%s LIMIT 1", array(bigintval($data['pool_id'])), __FILE__, __LINE__); // Entry found? - if (SQL_NUMROWS($result) == 1) { - $data = merge_array($data, SQL_FETCHARRAY($result)); + if (sqlNumRows($result) == 1) { + $data = merge_array($data, sqlFetchArray($result)); $isValid = TRUE; } // END - if // Free memory... - SQL_FREERESULT($result); + sqlFreeResult($result); break; default: // Unknown type @@ -234,14 +229,14 @@ if ((isValidId($data['userid'])) && (isValidId($data['id'])) && (!empty($data['t } // Free result - SQL_FREERESULT($result_mailid); + sqlFreeResult($result_mailid); } else { $data['error_code'] = getCode('ALREADY_CONFIRMED'); $data['do'] = 'failed'; } // Free result - SQL_FREERESULT($result_main); + sqlFreeResult($result_main); } else { // Not all variables are set $data['error_code'] = getCode('ERROR_MAILID'); @@ -254,7 +249,7 @@ handleMailIdErrorCode($data['error_code']); // Insert footer if no image if ($data['do'] != 'img') { // Write footer - loadIncludeOnce('inc/footer.php'); + loadPageFooter(); } // END - if // Really all done here... ;-)