X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=mailid_top.php;h=2f04e4caeb8f6b28a1aeff0cfd810be59f03ec73;hp=b0300fda886334cabddb8f9abc21232bf44feccf;hb=588b84a642e12330ec299600a73be309da297068;hpb=19188207e6802b82a134b340408cfa34b9b3a80f diff --git a/mailid_top.php b/mailid_top.php index b0300fda88..2f04e4caeb 100644 --- a/mailid_top.php +++ b/mailid_top.php @@ -14,11 +14,9 @@ * $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 * + * Copyright (c) 2009 - 2011 by Mailer Developer Team * * For more information visit: http://www.mxchange.org * * * * This program is free software; you can redistribute it and/or modify * @@ -50,8 +48,9 @@ $GLOBALS['output_mode'] = -1; // Load the required file(s) require('inc/config-global.php'); -// Set content type +// Set content type and HTTP status setContentType('text/html'); +setHttpStatus('404 NOT FOUND'); // Is the extension mailid active? redirectOnUninstalledExtension('mailid'); @@ -67,16 +66,19 @@ $code = '0'; $mode = ''; // Secure all data -if (isGetRequestParameterSet('userid')) $userId = bigintval(getRequestParameter('userid')); -if (isGetRequestParameterSet('mailid')) $mailId = bigintval(getRequestParameter('mailid')); -if (isGetRequestParameterSet('bonusid')) $bonusId = bigintval(getRequestParameter('bonusid')); -if (isGetRequestParameterSet('code')) $code = bigintval(getRequestParameter('code')); -if (isGetRequestParameterSet('mode')) $mode = getRequestParameter('mode'); +if (isGetRequestParameterSet('userid')) $userId = bigintval(getRequestParameter('userid')); +if (isGetRequestParameterSet('mailid')) $mailId = bigintval(getRequestParameter('mailid')); +if (isGetRequestParameterSet('bonusid')) $bonusId = bigintval(getRequestParameter('bonusid')); +if (isGetRequestParameterSet('code')) $code = bigintval(getRequestParameter('code')); +if (isGetRequestParameterSet('mode')) $mode = getRequestParameter('mode'); -// 01 1 12 2 2 21 1 22 10 +// 01 2 21 12 2 2 21 1 2210 if ((isValidUserId($userId)) && (($mailId > 0) || ($bonusId > 0)) && (!ifFatalErrorsDetected())) { - // No image? Then output header - if ($mode != 'img') loadIncludeOnce('inc/header.php'); + // No image? + if ($mode != 'img') { + // ... then output header + loadIncludeOnce('inc/header.php'); + } // END - fi // Maybe he wants to confirm an email? if ($mailId > 0) { @@ -175,7 +177,7 @@ if ((isValidUserId($userId)) && (($mailId > 0) || ($bonusId > 0)) && (!ifFatalEr $img_code = '0'; if (!empty($code)) { // Generate code - $img_code = generateRandomCode(getConfig('code_length'), $code, $userId, $urlId); + $img_code = generateRandomCode(getCodeLength(), $code, $userId, $urlId); } // END - if // @TODO Rewrite this to a filter @@ -239,11 +241,14 @@ if ((isValidUserId($userId)) && (($mailId > 0) || ($bonusId > 0)) && (!ifFatalEr // Right code entered? if (bigintval(postRequestParameter('gfx_check')) == $img_code) { + // Set HTTP status to okay + setHttpStatus('200 OK'); + // Add points over referal system is the default $template = 'mailid_points_done'; // Right code entered add points and remove entry - if ((getUserData('ref_payout') > 0) && (!isDirectPaymentEnabled())) { + if (ifUserPointsLocked($userId)) { // Don't add points over the referal system $template = 'mailid_points_locked'; } // END - if @@ -262,13 +267,19 @@ if ((isValidUserId($userId)) && (($mailId > 0) || ($bonusId > 0)) && (!ifFatalEr // Is an active-rallye running and this is not a notification mail? if ((isBonusRallyeActive()) && ($notify != 'Y')) { // Shall I exclude the webmaster's own userid from the active-rallye? - if ((((getBonusUserId() == $userId) && (getConfig('bonus_include_own') == 'Y')) || (getBonusUserId() != $userId)) && (getConfig('def_refid') != $userId)) { + if ((((getBonusUserid() == $userId) && (getConfig('bonus_include_own') == 'Y')) || (getBonusUserid() != $userId)) && (getDefRefid() != $userId)) { // Add points and remember ranking are done in this function.... addTurboBonus($urlId, $userId, $type); // Set template to mailid_points_done2 which contains a link to the ranking list $template = 'mailid_points_done2'; - if ($locked) $template = 'mailid_points_locked2'; + + // Different template if user has some mails to confirm + if (ifUserPointsLocked($userId)) { + $template = 'mailid_points_locked2'; + } // END - if + + // Assign more data for the template $content['userid'] = $userId; $content['type'] = $type; $content['data'] = $urlId; @@ -277,7 +288,10 @@ if ((isValidUserId($userId)) && (($mailId > 0) || ($bonusId > 0)) && (!ifFatalEr } // END - if // Load total points - $content['total'] = getTotalPoints($userId); + $content['total_points'] = getTotalPoints($userId); + + // Add payment points + $content['points'] = $payment; // Load template loadTemplate($template, false, $content); @@ -306,7 +320,7 @@ if ((isValidUserId($userId)) && (($mailId > 0) || ($bonusId > 0)) && (!ifFatalEr $content['type'] = $type; $content['data'] = $urlId; $content['banner'] = loadTemplate('mailid_banner', true); - if (getConfig('code_length') > 0) { + if (getCodeLength() > 0) { // Generate Code $content['image'] = generateCaptchaCode($code, $type, $urlId, $userId); $templ = 'mailid_enter_code'; @@ -344,30 +358,30 @@ if ((isValidUserId($userId)) && (($mailId > 0) || ($bonusId > 0)) && (!ifFatalEr break; } // END - switch } else { - loadTemplate('admin_settings_saved', false, '
{--MAIL_ALREADY_CONFIRMED--} (6)
'); + loadTemplate('admin_settings_unsaved', false, '{--MAIL_ALREADY_CONFIRMED--} (6)'); $mode = 'failed'; } } else { - loadTemplate('admin_settings_saved', false, '
{--MAIL_ALREADY_CONFIRMED--} (5)
'); + loadTemplate('admin_settings_unsaved', false, '{--MAIL_ALREADY_CONFIRMED--} (5)'); $mode = 'failed'; } } else { - loadTemplate('admin_settings_saved', false, '
{--MAIL_ALREADY_CONFIRMED--} (4)
'); + loadTemplate('admin_settings_unsaved', false, '{--MAIL_ALREADY_CONFIRMED--} (4)'); $mode = 'failed'; } } else { - loadTemplate('admin_settings_saved', false, '
{--MAIL_ALREADY_CONFIRMED--} (3)
'); + loadTemplate('admin_settings_unsaved', false, '{--MAIL_ALREADY_CONFIRMED--} (3)'); $mode = 'failed'; } } else { - loadTemplate('admin_settings_saved', false, '
{--MAIL_ALREADY_CONFIRMED--} (2)
'); + loadTemplate('admin_settings_unsaved', false, '{--MAIL_ALREADY_CONFIRMED--} (2)'); $mode = 'failed'; } // Free result SQL_FREERESULT($result_mailid); } else { - loadTemplate('admin_settings_saved', false, '
{--MAIL_ALREADY_CONFIRMED--} (1)
'); + loadTemplate('admin_settings_unsaved', false, '{--MAIL_ALREADY_CONFIRMED--} (1)'); $mode = 'failed'; }