RevCMS Ban Function

Detox

Member
Jul 24, 2010
365
24
Hey Dev Again,
I've been editing RevCMS for Arcturus... But because of the banning function is different than what it used to be, I'm trying to re-code it.

class.user.php
PHP:
final public function isBanned($type)
    {
        global $engine;
         if($engine->num_rows("SELECT * FROM bans WHERE type = '" . $type . "' LIMIT 1") > 0)
        {
                if($engine->num_rows("SELECT * FROM bans WHERE ip = '" . $type . "' LIMIT 1") > 0)
                {
                      return true;
                }
         }
            
        return false;
    }

checktheban.php
PHP:
<?php

if($_SESSION['user']['id']){

$getuserinfo = mysql_query("SELECT * FROM users WHERE id='".$_SESSION['user']['id']."'");
while($row = mysql_fetch_array($getuserinfo))
{
$usernameban = $row['user_id'];
$ipban = $row['ip'];

}

$getuserinfo= mysql_query("SELECT * FROM bans WHERE user_id='{$usernameban}' AND ban_expire > UNIX_TIMESTAMP() ORDER BY ban_expire DESC LIMIT 1");
$getuserinfoip= mysql_query("SELECT * FROM bans WHERE ip='{$ipban}' AND ban_expire > UNIX_TIMESTAMP() ORDER BY ban_expire DESC LIMIT 1");

while($row = mysql_fetch_array($getuserinfo))
{

$expire = $row['ban_expire'];

 if($expire <= time()){
 
 }
 else
 {
header('Location: /banned');
exit;
 }
 }

 while($row = mysql_fetch_array($getuserinfoip)){

$expire = $row['ban_expire'];

 if($expire <= time()){
 
 }
 else
 {
header('Location: /ipbanned');
exit;
 }
 }
 }
 
?>

Arcturus Ban Structure.
11c9v11.jpg

Please I need assistance.
 

Users who are viewing this thread

Top