6.5/EMPS.php
/**
     * Add the current remote IP address to the black list (or update the timestamps if it already exists)
     *
     *
     */
Add the current remote IP address to the black list (or update the timestamps if it already exists)
Add the current remote IP address to the black list ( or update the timestamps if it already exists )
public function add_to_blacklist()
    {
        $term = 180 * 24 * 60 * 60;
        $ip = $_SERVER['REMOTE_ADDR'];
        $row = $this->db->get_row("e_blacklist", "ip = '" . $ip . "'");
        $ur = array();
        $ur['edt'] = time() + $term;
        $ur['adt'] = time();
        if ($row) {
            $update = ['SET' => $ur];
            $this->db->sql_update_row("e_blacklist", $update, "id = " . $row['id']);
        } else {
            $ur['ip'] = $ip;
            $update = ['SET' => $ur];
            $this->db->sql_insert_row("e_blacklist", $update);
        }
        $this->service_blacklist();
    }
public function add_to_blacklist ( ) { $ term = 180 * 24 * 60 * 60 ; $ ip = $ _SERVER [ 'REMOTE_ADDR' ] ; $ row = $ this -> db -> get_row ( " e_blacklist " , " ip = ' " . $ ip . " ' " ) ; $ ur = array ( ) ; $ ur [ 'edt' ] = time ( ) + $ term ; $ ur [ 'adt' ] = time ( ) ; if ( $ row ) { $ update = [ 'SET' => $ ur ] ; $ this -> db -> sql_update_row ( " e_blacklist " , $ update , " id =  " . $ row [ 'id' ] ) ; } else { $ ur [ 'ip' ] = $ ip ; $ update = [ 'SET' => $ ur ] ; $ this -> db -> sql_insert_row ( " e_blacklist " , $ update ) ; } $ this -> service_blacklist ( ) ; }
Add the current remote IP address to the black list (or update the timestamps if it already exists)
Add the current remote IP address to the black list ( or update the timestamps if it already exists )