* $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 *
// 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');
$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) {
$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
// 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) && (!isDirectPaymentAllowed())) {
+ if (ifUserPointsLocked($userId)) {
// Don't add points over the referal system
$template = 'mailid_points_locked';
} // END - if
// 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;
} // 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);
$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';
break;
} // END - switch
} else {
- loadTemplate('admin_settings_saved', false, '<div class="member_failed">{--MAIL_ALREADY_CONFIRMED--} (6)</div>');
+ loadTemplate('admin_settings_unsaved', false, '{--MAIL_ALREADY_CONFIRMED--} (6)');
$mode = 'failed';
}
} else {
- loadTemplate('admin_settings_saved', false, '<div class="member_failed">{--MAIL_ALREADY_CONFIRMED--} (5)</div>');
+ loadTemplate('admin_settings_unsaved', false, '{--MAIL_ALREADY_CONFIRMED--} (5)');
$mode = 'failed';
}
} else {
- loadTemplate('admin_settings_saved', false, '<div class="member_failed">{--MAIL_ALREADY_CONFIRMED--} (4)</div>');
+ loadTemplate('admin_settings_unsaved', false, '{--MAIL_ALREADY_CONFIRMED--} (4)');
$mode = 'failed';
}
} else {
- loadTemplate('admin_settings_saved', false, '<div class="member_failed">{--MAIL_ALREADY_CONFIRMED--} (3)</div>');
+ loadTemplate('admin_settings_unsaved', false, '{--MAIL_ALREADY_CONFIRMED--} (3)');
$mode = 'failed';
}
} else {
- loadTemplate('admin_settings_saved', false, '<div class="member_failed">{--MAIL_ALREADY_CONFIRMED--} (2)</div>');
+ loadTemplate('admin_settings_unsaved', false, '{--MAIL_ALREADY_CONFIRMED--} (2)');
$mode = 'failed';
}
// Free result
SQL_FREERESULT($result_mailid);
} else {
- loadTemplate('admin_settings_saved', false, '<div class="member_failed">{--MAIL_ALREADY_CONFIRMED--} (1)</div>');
+ loadTemplate('admin_settings_unsaved', false, '{--MAIL_ALREADY_CONFIRMED--} (1)');
$mode = 'failed';
}