]> git.mxchange.org Git - mailer.git/blobdiff - mailid_top.php
Removed debug die() call
[mailer.git] / mailid_top.php
index 5b54056787b89d8d2e59ba6be0cc61ba434f451f..c1d913a03b320d4de8926f570e906edae7a8649d 100644 (file)
  * $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) && (!isDirectPaymentAllowed())) {
+                                                                               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']  = 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, '<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';
        }