Fixes for beg link, inactive extensions
authorRoland Häder <roland@mxchange.org>
Sat, 20 Sep 2008 23:06:00 +0000 (23:06 +0000)
committerRoland Häder <roland@mxchange.org>
Sat, 20 Sep 2008 23:06:00 +0000 (23:06 +0000)
beg.php
inc/databases.php
inc/modules/index.php
mailid.php
surfbar.php

diff --git a/beg.php b/beg.php
index fa82caf..a7564ce 100644 (file)
--- a/beg.php
+++ b/beg.php
@@ -56,7 +56,7 @@ if (defined('mxchange_installed') && (isBooleanConstantAndTrue('mxchange_install
                $uid = 0;
 
                // Validate if it is not a number
-               if (bigintval($_GET['uid']) !== "".$_GET['uid']."") {
+               if ("".bigintval($_GET['uid'])."" !== "".$_GET['uid']."") {
                        if (EXT_IS_ACTIVE("nickname")) {
                                // Maybe we have found a nickname?
                                $result = SQL_QUERY_ESC("SELECT userid, beg_clicks, ref_payout, status, last_online FROM "._MYSQL_PREFIX."_user_data WHERE nickname='%s' LIMIT 1",
@@ -78,7 +78,7 @@ if (defined('mxchange_installed') && (isBooleanConstantAndTrue('mxchange_install
                if (IS_MEMBER()) {
                        // Logged in user detected!
                        $login = true;
-               }
+               } // END - if
 
                // Check if account was found
                if ((SQL_NUMROWS($result) == 1) && ($result != false)) {
@@ -89,12 +89,12 @@ if (defined('mxchange_installed') && (isBooleanConstantAndTrue('mxchange_install
                                $uid = bigintval($uid);
 
                                // Calculate beg points
-                               srand((double)microtime() * 10000000000 / time());
+                               mt_srand((double)microtime() * 10000000000 / time());
 
                                // Multiply configured values with 100000 and divide with 100000 so we can also handle small values
                                // If we need more number behind the decimal dot then we just need to increase all these three
                                // numbers matching to the numbers behind the decimal dot. Simple! ;-)
-                               $points = rand(($_CONFIG['beg_points'] * 100000), ($_CONFIG['beg_points_max'] * 100000)) / 100000;
+                               $points = mt_rand(($_CONFIG['beg_points'] * 100000), ($_CONFIG['beg_points_max'] * 100000)) / 100000;
 
                                // Set nickname / userid for the template(s
                                define('__BEG_UID'   , $_GET['uid']);
@@ -201,8 +201,7 @@ if (defined('mxchange_installed') && (isBooleanConstantAndTrue('mxchange_install
                }
 
                // Reload to index module
-               die("-".$msg."-");
-               if ((!empty($msg)) && (!empty($msg))) LOAD_URL("modules.php?module=index&msg=".$msg);
+               if ((!empty($msg)) && (!empty($msg))) LOAD_URL("modules.php?module=index&amp;msg=".$msg."&amp;ext=beg");
        } else {
                // No userid entered
                LOAD_URL("modules.php?module=index");
index 543d67b..b44d79b 100644 (file)
@@ -113,7 +113,7 @@ define('USAGE_BASE', "usage");
 define('SERVER_URL', "http://www.mxchange.org");
 
 // This current patch level
-define('CURR_SVN_REVISION', "372");
+define('CURR_SVN_REVISION', "373");
 
 // Take a prime number which is long (if you know a longer one please try it out!)
 define('_PRIME', 591623);
index bbd6072..191ca68 100644 (file)
@@ -57,8 +57,20 @@ if (!empty($_GET['msg'])) {
                case CODE_USER_404         : $msg = USER_NOT_FOUND; break;
                case CODE_STATS_404        : $msg = MAIL_STATS_404; break;
                case CODE_ALREADY_CONFIRMED: $msg = MAIL_ALREADY_CONFIRMED; break;
-               case CODE_ERROR_MAILID     : if (EXT_IS_ACTIVE("mailid", true)) { $msg = ERROR_CONFIRMING_MAIL; } else { $msg = sprintf(EXTENSION_PROBLEM_NOT_INSTALLED, "mailid"); } break;
-               case CODE_EXTENSION_PROBLEM: $msg = sprintf(EXTENSION_PROBLEM_EXT_INACTIVE, "mailid"); break;
+
+               case CODE_ERROR_MAILID:
+                       if (EXT_IS_ACTIVE($ext, true)) { $msg = ERROR_CONFIRMING_MAIL; } else { $msg = sprintf(EXTENSION_PROBLEM_NOT_INSTALLED, "mailid"); }
+                       break;
+
+               case CODE_EXTENSION_PROBLEM:
+                       // Default extension is "unknown"
+                       $ext = "unknown";
+
+                       // Is extension given?
+                       if (!empty($_GET['ext'])) $ext = SQL_ESCAPE($_GET['ext']);
+                       $msg = sprintf(EXTENSION_PROBLEM_EXT_INACTIVE, $ext);
+                       break;
+
                case CODE_COOKIES_DISABLED : $msg = LOGIN_NO_COOKIES; break;
                case CODE_BEG_SAME_AS_OWN  : $msg = BEG_SAME_UID_AS_OWN; break;
                case CODE_LOGIN_FAILED     : $msg = LOGIN_FAILED_GENERAL; break;
index 97f9438..d530bb2 100644 (file)
@@ -49,7 +49,7 @@ if (defined('mxchange_installed') && (isBooleanConstantAndTrue('mxchange_install
        // Is the extension active
        if (!EXT_IS_ACTIVE("mailid", true)) {
                // Is not activated/installed yet!
-               LOAD_URL("modules.php?module=index&amp;msg=".CODE_EXTENSION_PROBLEM);
+               LOAD_URL("modules.php?module=index&amp;msg=".CODE_EXTENSION_PROBLEM."&amp;ext=mailid");
        } // END - if
 
        // Init
@@ -99,7 +99,7 @@ if (defined('mxchange_installed') && (isBooleanConstantAndTrue('mxchange_install
                                // Is the bonus extension active?
                                if (!EXT_IS_ACTIVE("bonus")) {
                                        // Abort here
-                                       LOAD_URL("modules.php?module=index&amp;msg=".CODE_EXTENSION_PROBLEM);
+                                       LOAD_URL("modules.php?module=index&amp;msg=".CODE_EXTENSION_PROBLEM."&amp;ext=mailid");
                                } // END - if
 
                                // Bonus-Mails
@@ -200,7 +200,7 @@ if (defined('mxchange_installed') && (isBooleanConstantAndTrue('mxchange_install
        if (!empty($msg)) {
                switch ($_CONFIG['mailid_error_redirect']) {
                        case "INDEX": // Redirect to index page
-                               LOAD_URL("modules.php?module=index&msg=".$msg);
+                               LOAD_URL("modules.php?module=index&amp;msg=".$msg."&amp;ext=mailid");
                                break;
 
                        case "REJECT": // Redirect to rejection page
index 96c2f91..57372bd 100644 (file)
@@ -57,7 +57,7 @@ if (defined('mxchange_installed') && (isBooleanConstantAndTrue('mxchange_install
                LOAD_URL(URL."/modules.php?module=index");
        } elseif (!EXT_IS_ACTIVE("surfbar")) {
                // Surfbar deactivated
-               LOAD_URL(URL."/modules.php?module=login&msg=".CODE_EXTENSION_PROBLEM);
+               LOAD_URL(URL."/modules.php?module=login&msg=".CODE_EXTENSION_PROBLEM."&amp;ext=surfbar");
        }
 
        // Is there a check value?