Fix bug where invite tree would break because the wrong query id was used

Unset  because it's re-used later

Remove cache lock from ip_bans
This commit is contained in:
What.CD 2011-05-29 08:00:05 +00:00
parent 80422131d6
commit 65229141f1
2 changed files with 4 additions and 11 deletions

View File

@ -391,16 +391,9 @@ function site_ban_ip($IP) {
$IP = ip2unsigned($IP);
$IPBans = $Cache->get_value('ip_bans');
if(!is_array($IPBans)) {
//Cache lock!
$Lock = $Cache->get_value('ip_bans_lock');
if($Lock && substr($_SERVER['REQUEST_URI'], 0, 29) != '/torrents.php?action=download') {
?><script type="script/javascript">setTimeout('window.location="http://<?=NONSSL_SITE_URL?><?=$_SERVER['REQUEST_URI']?>"', 5)</script><?
} else {
$Cache->cache_value('ip_bans_lock', '1', 10);
$DB->query("SELECT ID, FromIP, ToIP FROM ip_bans");
$IPBans = $DB->to_array(0, MYSQLI_NUM);
$Cache->cache_value('ip_bans', $IPBans, 0);
}
$DB->query("SELECT ID, FromIP, ToIP FROM ip_bans");
$IPBans = $DB->to_array(0, MYSQLI_NUM);
$Cache->cache_value('ip_bans', $IPBans, 0);
}
foreach($IPBans as $Index => $IPBan) {
list($ID, $FromIP, $ToIP) = $IPBan;

View File

@ -41,7 +41,7 @@
$ForumID = $ThreadInfo['ForumID'];
// Make sure they're allowed to look at the page
if($Forums[$ForumID]['MinClassRead'] > $LoggedUser['Class'] || (isset($LoggedUser['CustomForums'][$ForumID]) && $LoggedUser['CustomForums'][$ForumID] == 0)) {
if(!check_forumperm($ForumID)) {
error(403);
}