Checking bans for Arcturus 1.16.0

Results 1 to 2 of 2
  1. #1
    Enthusiast Haplo is offline
    MemberRank
    Sep 2013 Join Date
    NederlandLocation
    34Posts

    Support Checking bans for Arcturus 1.16.0

    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 Code:
        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 Code:
    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.


  2. #2
    Enthusiast Haplo is offline
    MemberRank
    Sep 2013 Join Date
    NederlandLocation
    34Posts

    Re: Checking bans for Arcturus 1.16.0

    Solved. Changed username to uid on the bottom of the file.



Advertisement