-require ("inc/config.php");
-
-if (defined('mxchange_installed') && (mxchange_installed))
-{
- // Is the extension active
- if (!EXT_IS_ACTIVE("mailid", true)) {
- // Is not activated/installed yet!
- ADD_FATAL(sprintf(EXTENSION_PROBLEM_NOT_INSTALLED, "mailid"));
+require('inc/config-global.php');
+
+// Set content type
+setContentType('text/html');
+
+// Is the extension active?
+redirectOnUninstalledExtension('mailid');
+
+// Init
+$url_userid = 0;
+$url_bid = 0;
+$url_mid = 0;
+
+// Secure all data
+if (isGetRequestElementSet('userid')) $url_userid = bigintval(getRequestElement('userid'));
+if (isGetRequestElementSet('mailid')) $url_mid = bigintval(getRequestElement('mailid'));
+if (isGetRequestElementSet('bonusid')) $url_bid = bigintval(getRequestElement('bonusid'));
+
+// 01 1 12 2 2 21 1 22 10
+if (($url_userid) > 0 && (($url_mid > 0) || ($url_bid > 0)) && (getTotalFatalErrors() == 0)) {
+ // Init result
+ $result_link = false;
+
+ // Maybe he wants to confirm an email?
+ if ($url_mid > 0) {
+ // Normal-Mails
+ $result_link = SQL_QUERY_ESC("SELECT `link_type` FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `stats_id`=%s AND `userid`=%s LIMIT 1",
+ array($url_mid, $url_userid), __FILE__, __LINE__);
+ $type = 'mailid'; $urlId = $url_mid;
+ } elseif ($url_bid > 0) {
+ // Bonus-Mail
+ $result_link = SQL_QUERY_ESC("SELECT `link_type` FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `bonus_id`=%s AND `userid`=%s LIMIT 1",
+ array($url_bid, $url_userid), __FILE__, __LINE__);
+ $type = 'bonusid'; $urlId = $url_bid;
+ } else {
+ // Problem: No ID entered
+ redirectToUrl('index.php');