Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Checking bans for Arcturus 1.16.0

Status
Not open for further replies.
Newbie Spellweaver
Joined
Sep 15, 2013
Messages
33
Reaction score
5
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
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']);
                }    
        }
    }
I need something like the following:
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.
 
Status
Not open for further replies.
Back
Top