From: Roland Häder Date: Sat, 20 Sep 2008 23:06:00 +0000 (+0000) Subject: Fixes for beg link, inactive extensions X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=commitdiff_plain;h=9cb3095b94feae69d53a847696c017ebda809212 Fixes for beg link, inactive extensions --- diff --git a/beg.php b/beg.php index fa82cafebe..a7564ce67c 100644 --- 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&msg=".$msg."&ext=beg"); } else { // No userid entered LOAD_URL("modules.php?module=index"); diff --git a/inc/databases.php b/inc/databases.php index 543d67bf9d..b44d79b9ab 100644 --- a/inc/databases.php +++ b/inc/databases.php @@ -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); diff --git a/inc/modules/index.php b/inc/modules/index.php index bbd6072b98..191ca68d94 100644 --- a/inc/modules/index.php +++ b/inc/modules/index.php @@ -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; diff --git a/mailid.php b/mailid.php index 97f943890e..d530bb2a3b 100644 --- a/mailid.php +++ b/mailid.php @@ -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&msg=".CODE_EXTENSION_PROBLEM); + LOAD_URL("modules.php?module=index&msg=".CODE_EXTENSION_PROBLEM."&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&msg=".CODE_EXTENSION_PROBLEM); + LOAD_URL("modules.php?module=index&msg=".CODE_EXTENSION_PROBLEM."&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&msg=".$msg."&ext=mailid"); break; case "REJECT": // Redirect to rejection page diff --git a/surfbar.php b/surfbar.php index 96c2f9137f..57372bdd69 100644 --- a/surfbar.php +++ b/surfbar.php @@ -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."&ext=surfbar"); } // Is there a check value?