Hello,
I want to update the class.auth.php for checking bans. I used Mercury emulator earlier. In that database, you had the value table which can include a username or an IP.
Now, Arcturus works with a user_id, which only can include a user ID. For the IP checking I use the table IP; that seems to work. But there is no table to use for username check.
So, I need something that converts usernames to user IDs.
I currently have the following
I need something like the following:
But when I add something like that, I get 'Resource id #45' as user ID.
Hope you can help. Thanks in advance for the assistance.
I want to update the class.auth.php for checking bans. I used Mercury emulator earlier. In that database, you had the value table which can include a username or an IP.
Now, Arcturus works with a user_id, which only can include a user ID. For the IP checking I use the table IP; that seems to work. But there is no table to use for username check.
So, I need something that converts usernames to user IDs.
I currently have the following
PHP:
private function isBan($username){
global $config ;
$data = $this->_db->query("SELECT * FROM bans WHERE user_id = '".$username."' OR ip ='".$_SERVER['REMOTE_ADDR']."' LIMIT 1",true,false);
if($data){
if(time() > $data['expire']){
$req = $this->_db->query('DELETE FROM bans WHERE id='.safe($data['id'],'SQL'));
return false ;
}
else{
$this->logout();
redirection($config->url_site.'/index.php?ban='.$data['id']);
}
}
}
PHP:
SELECT id FROM users WHERE mail = '".$username."'
But when I add something like that, I get 'Resource id #45' as user ID.
Hope you can help. Thanks in advance for the assistance.