• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

[RevCMS] Arcturus Banned

Custom Title Activated
Loyal Member
Joined
Jun 27, 2009
Messages
1,571
Reaction score
170
Hey!!

so time is getting closer for me to release and it this is hopefully the last thing that needs to be coded is the bans for my CMS I've edited everything pertaining to bans. I've been testing it with my Test Account but it can still login to the CMS.

banned.php

PHP:
<?php
session_destroy();
?>
<title>{hotelName}: Banned</title>
<?php
	
	if($_SESSION['user']['id']){

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

	$usernameban = $row['username'];

	}
	$getuserinfo= mysql_query("SELECT * FROM bans WHERE value='{$usernameban}'");
		while($row = mysql_fetch_array($getuserinfo)){

	$username2 = $row['value'];
	$bantype = $row['type'];
	$reason = $row['ban_reason'];
	$expire = $row['ban_expire'];
	
	echo '<center>';
	echo "Username: " . $username2;
	echo '<br /><br />';
	echo "Reason: " . $reason;
	echo '<br /><br />';
	echo "Type: " . $bantype;
	echo '<br /><br />';
	
	$getuserinfo2= mysql_query("SELECT * FROM bans WHERE value='{$usernameban}'");
		while($row = mysql_fetch_array($getuserinfo2)){
		$expire = $row['ban_expire'];
		if($expire < time()){ 
		
		header('Location: me');
		exit;
	} 
		else	
		{

		}
	}
                        // Now we convert the Unix timestamp to a humanley readable time
                                $date = date("l d F Y H:i:s", $expire);
                                echo "Ban expires on: " . $date;
}
}
?></center></td>
  </tr>
</table>

checkBan.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['username'];

$ipban = $row['ip_current'];


}



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

$getuserinfoip= mysql_query("SELECT * FROM bans WHERE value='{$ipban}' AND ban_expire > UNIX_TIMESTAMP() ORDER BY 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;
 }
 }
 }
 


?>
class.core.php (Ban Function)
PHP:
 final public function getBans()
        {
                global $engine;
                return $engine->result("SELECT count(id) from bans");
        }
 
Junior Spellweaver
Joined
May 15, 2014
Messages
165
Reaction score
34
May I ask why your else statement is blank on banned.php

Skickat från min FRD-L09 via Tapatalk
 
Upvote 0
Back
Top