Hi DB.
I'm currently working on a cms with arcturus and i have a problem with my checktheban.php.
I use this:
and this
The problem that i have is, that even when i ban someone, its not only the account, but it seems to be the whole ip. I'm using arcturus. I hope someone can help.
Thx
I'm currently working on a cms with arcturus and i have a problem with my checktheban.php.
I use this:
PHP:
<?php
$userID = (isset($_SESSION['user']['id'])) ? $_SESSION['user']['id'] : 0;
$ip = (isset($_SERVER["HTTP_CF_CONNECTING_IP"]) && !empty($_SERVER["HTTP_CF_CONNECTING_IP"])) ? $_SERVER["HTTP_CF_CONNECTING_IP"] : $_SERVER["REMOTE_ADDR"];
$getBan = mysql_query("SELECT * FROM bans WHERE user_id = '{$userID}' OR ip = '{$ip}' ORDER BY ban_expire DESC LIMIT 1");
while($ban = mysql_fetch_array($getBan))
{
if($ban['ban_expire'] >= time())
{
if($ban['type'] == 'account') die(header('Location: /banned'));
die(header('Location: /ipbanned'));
}
}
?>
PHP:
final public function isBanned($value)
{
global $engine;
if($engine->num_rows("SELECT * FROM bans WHERE value = '" . $value . "' LIMIT 1") > 0)
{
return true;
}
return false;
}
final public function getReason($value)
{
global $engine;
return $engine->result("SELECT ban_reason FROM bans WHERE value = '" . $value . "' LIMIT 1");
}
final public function hasClones($ip)
{
global $engine;
if($engine->num_rows("SELECT * FROM users WHERE ip_register = '" . $_SERVER['REMOTE_ADDR'] . "'") == 2) {
return true;
}
return false;
}
Thx