Fixed bug in proxyban
git-svn-id: http://kusabax.cultnet.net/svn/repo/stable@181 73d99b7e-4f53-4972-b7b7-2ecd3c4d89ee
This commit is contained in:
1 parent
5bb2edf96e
commit
b49defe6b2
3 files changed
+12
-5
No files matched your search
@@ -72,7 +72,14 @@ class Bans {
|
||||
/* Add a ip/ip range ban */
|
||||
function BanUser($ip, $modname, $globalban, $duration, $boards, $reason, $staffnote, $appealat=0, $type=0, $allowread=1, $proxyban=false) {
|
||||
global $tc_db;
|
||||
|
||||
|
||||
if ($proxyban) {
|
||||
$check = $tc_db->GetOne("SELECT COUNT(*) FROM `".KU_DBPREFIX."banlist` WHERE `type` = '".$type."' AND `ipmd5` = '".md5($ip)."'");
|
||||
if ($check[0] > 0) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if ($duration>0) {
|
||||
$ban_globalban = '0';
|
||||
} else {
|
||||
@@ -84,7 +91,7 @@ class Bans {
|
||||
$ban_until = '0';
|
||||
}
|
||||
|
||||
$tc_db->Execute("INSERT INTO `".KU_DBPREFIX."banlist` ( `ip` , `ipmd5` , `type` , `allowread` , `globalban` , `boards` , `by` , `at` , `until` , `reason`, `staffnote`, `appealat` ) VALUES ( ".$tc_db->qstr(md5_encrypt($ip, KU_RANDOMSEED))." , '".md5($ip)."' , '".$type."' , '".$allowread."' , '".$globalban."' , '".$boards."' , '".$modname."' , '".time()."' , ".$tc_db->qstr($ban_until)." , ".$reason." , ".$staffnote.", ".$appealat." ) ");
|
||||
$tc_db->Execute("INSERT INTO `".KU_DBPREFIX."banlist` ( `ip` , `ipmd5` , `type` , `allowread` , `globalban` , `boards` , `by` , `at` , `until` , `reason`, `staffnote`, `appealat` ) VALUES ( ".$tc_db->qstr(md5_encrypt($ip, KU_RANDOMSEED))." , ".$tc_db->qstr(md5($ip))." , ".intval($type)." , ".intval($allowread)." , ".intval($globalban)." , ".$tc_db->qstr($boards)." , ".$tc_db->qstr($modname)."' , ".time()." , ".intval($ban_until)." , ".$tc_db->qstr($reason)." , ".$tc_db->qstr($staffnote).", ".intval($appealat)." ) ");
|
||||
|
||||
if (!$proxyban && $type == 1) {
|
||||
$this->UpdateHtaccess();
|
||||
|
||||
Reference in new issue
Block a user