Some global variables rewritten, a lot more language constants rewritten to getMessage()
[mailer.git] / mailid_top.php
index 71983620c52892289f18ed8e81b6ee6b1754a5b5..dda1814a29108bda32a5c04d11f5f4663cfc2c77 100644 (file)
  * -------------------------------------------------------------------- *
  * Kurzbeschreibung  : Bestaetigung von Mails                           *
  * -------------------------------------------------------------------- *
- *                                                                      *
+ * $Revision::                                                        $ *
+ * $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 - 2008 by Roland Haeder                           *
  * For more information visit: http://www.mxchange.org                  *
 require("inc/libs/security_functions.php");
 
 // Init "action" and "what"
-global $what, $action;
-$GLOBALS['what'] = ""; $GLOBALS['action'] = "";
+$GLOBALS['what'] = "";
+$GLOBALS['action'] = "";
 
 // Tell everyone we are in this module
-$GLOBALS['module'] = "mailid";  $CSS = 0;
+$GLOBALS['module'] = "mailid"; 
+$GLOBALS['output_mode'] = 0;
 
 // Load the required file(s)
 require("inc/config.php");
 
-if (isBooleanConstantAndTrue('mxchange_installed')) {
+if (isInstalled()) {
        // Is the extension active
        if (!EXT_IS_ACTIVE("mailid", true)) {
                // Is not activated/installed yet!
-               addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "mailid");
+               addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "mailid");
        } // END - if
 
        // Secure all data
        $url_uid = 0; $url_bid = 0; $url_mid = 0; $code = 0; $mode = "";
-       if (!empty($_GET['uid']))     $url_uid = bigintval($_GET['uid']);
-       if (!empty($_GET['mailid']))  $url_mid = bigintval($_GET['mailid']);
-       if (!empty($_GET['bonusid'])) $url_bid = bigintval($_GET['bonusid']);
-       if (!empty($_GET['code']))    $code    = bigintval($_GET['code']);
-       if (!empty($_GET['mode']))    $mode    = $_GET['mode'];
+       if (REQUEST_ISSET_GET(('uid')))     $url_uid = bigintval(REQUEST_GET('uid'));
+       if (REQUEST_ISSET_GET(('mailid')))  $url_mid = bigintval(REQUEST_GET('mailid'));
+       if (REQUEST_ISSET_GET(('bonusid'))) $url_bid = bigintval(REQUEST_GET('bonusid'));
+       if (REQUEST_ISSET_GET(('code')))    $code    = bigintval(REQUEST_GET('code'));
+       if (REQUEST_ISSET_GET(('mode')))    $mode    = REQUEST_GET('mode');
 
        // 01        1        12            2    2            21    1                   22     10
        if (($url_uid) > 0 && (($url_mid > 0) || ($url_bid > 0)) && (getTotalFatalErrors() == 0)) {
@@ -68,11 +74,11 @@ if (isBooleanConstantAndTrue('mxchange_installed')) {
                if ($url_mid > 0) {
                        $result = SQL_QUERY_ESC("SELECT id, link_type FROM `{!_MYSQL_PREFIX!}_user_links` WHERE stats_id=%s AND userid=%s LIMIT 1",
                         array($url_mid, $url_uid), __FILE__, __LINE__);
-                       $type = "mailid"; $DATA = $url_mid;
+                       $type = "mailid"; $urlId = $url_mid;
                } elseif ($url_bid > 0)         {
                        $result = SQL_QUERY_ESC("SELECT id, link_type FROM `{!_MYSQL_PREFIX!}_user_links` WHERE bonus_id=%s AND userid=%s LIMIT 1",
                         array($url_bid, $url_uid), __FILE__, __LINE__);
-                       $type = "bonusid"; $DATA = $url_bid;
+                       $type = "bonusid"; $urlId = $url_bid;
                }
 
                if (SQL_NUMROWS($result) == 1) {
@@ -133,7 +139,7 @@ if (isBooleanConstantAndTrue('mxchange_installed')) {
                                                                list($pay) = SQL_FETCHROW($result);
                                                                $time      = GET_PAY_POINTS($pay, "time");
                                                                $payment   = GET_PAY_POINTS($pay, "payment");
-                                                               $VALID     = true;
+                                                               $isValid   = true;
                                                        } // END - if
 
                                                        // Free memory...
@@ -147,7 +153,7 @@ if (isBooleanConstantAndTrue('mxchange_installed')) {
                                                        // Entry found?
                                                        if (SQL_NUMROWS($result) == 1) {
                                                                list($time, $payment) = SQL_FETCHROW($result);
-                                                               $VALID = true;
+                                                               $isValid = true;
                                                        }
 
                                                        // Free memory...
@@ -156,12 +162,12 @@ if (isBooleanConstantAndTrue('mxchange_installed')) {
                                                }
 
                                                // Is this entry valid?
-                                               if ($VALID) {
+                                               if ($isValid) {
                                                        if (($time == "0") && ($payment > 0)) $time = "1";
                                                        if (($time > 0) && ($payment > 0)) {
                                                                if (!empty($code)) {
                                                                        // Generate code
-                                                                       $img_code = GEN_RANDOM_CODE(getConfig('code_length'), $code, $url_uid, $DATA);
+                                                                       $img_code = generateRandomCodde(getConfig('code_length'), $code, $url_uid, $urlId);
                                                                } // END - if
 
                                                                switch ($mode) {
@@ -220,7 +226,7 @@ if (isBooleanConstantAndTrue('mxchange_installed')) {
                                                                        USER_STATS_INSERT_RECORD($url_uid, $type, $stats_data);
 
                                                                        // Right code entered?
-                                                                       if (bigintval($_POST['gfx_check']) == $img_code) {
+                                                                       if (bigintval(REQUEST_POST('gfx_check')) == $img_code) {
                                                                                // Add points over referal system is the default
                                                                                $locked = false;
                                                                                $template = "mailid_points_done";
@@ -247,14 +253,14 @@ if (isBooleanConstantAndTrue('mxchange_installed')) {
                                                                                                // Shall I exclude the webmaster's own userid from the active-rallye?
                                                                                                if ((((getConfig('bonus_uid') == $url_uid) && (getConfig('bonus_include_own') == "Y")) || (getConfig('bonus_uid') != $url_uid)) && (getConfig('def_refid') != $url_uid)) {
                                                                                                        // Add points and remember ranking are done in this function....
-                                                                                                       BONUS_ADD_TURBO_POINTS($DATA, $url_uid, $type);
+                                                                                                       BONUS_ADD_TURBO_POINTS($urlId, $url_uid, $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";
                                                                                                        define('_UID_VALUE' , $url_uid);
                                                                                                        define('_TYPE_VALUE', $type);
-                                                                                                       define('_DATA_VALUE', TRANSLATE_COMMA($DATA));
+                                                                                                       define('_DATA_VALUE', TRANSLATE_COMMA($urlId));
                                                                                                } // END - if
                                                                                        } // END - if
                                                                                } // END - if
@@ -291,11 +297,11 @@ if (isBooleanConstantAndTrue('mxchange_installed')) {
                                                                                define('_CODE_VALUE', $code);
                                                                                define('_UID_VALUE' , $url_uid );
                                                                                define('_TYPE_VALUE', $type);
-                                                                               define('_DATA_VALUE', $DATA);
+                                                                               define('_DATA_VALUE', $urlId);
                                                                                define('_TEMPLATE_BANNER', LOAD_TEMPLATE("mailid_banner", true));
                                                                                if (getConfig('code_length') > 0) {
                                                                                        // Generate Code
-                                                                                       define('_IMAGE_CODE', IMG_CODE($code, $type, $DATA, $url_uid));
+                                                                                       define('_IMAGE_CODE', IMG_CODE($code, $type, $urlId, $url_uid));
                                                                                        $templ = "mailid_enter_code";
                                                                                } else {
                                                                                        // Disabled code
@@ -315,7 +321,7 @@ if (isBooleanConstantAndTrue('mxchange_installed')) {
                                                                        define('_TIM2_VALUE', strlen($time));
                                                                        define('_UID_VALUE' , $url_uid );
                                                                        define('_TYPE_VALUE', $type);
-                                                                       define('_DATA_VALUE', $DATA);
+                                                                       define('_DATA_VALUE', $urlId);
                                                                        define('_RAND_VALUE', mt_rand(0, 99999));
                                                                        define('_TEMPLATE_BANNER', LOAD_TEMPLATE("mailid_banner", true));
 
@@ -357,4 +363,7 @@ if (isBooleanConstantAndTrue('mxchange_installed')) {
 }
 
 // Really all done here... ;-)
+shutdown();
+
+//
 ?>