includes/sessions.php
branch1.1.7-maintenance
changeset 1317 6012710ae538
parent 1176 5c98b9f181f0
equal deleted inserted replaced
1257:7365c9bf2106 1317:6012710ae538
  1778       if ( ENANO_DBLAYER == 'MYSQL' )
  1778       if ( ENANO_DBLAYER == 'MYSQL' )
  1779       {
  1779       {
  1780         $sql = "SELECT $col_reason, ban_value, ban_type, is_regex FROM " . table_prefix . "banlist WHERE \n"
  1780         $sql = "SELECT $col_reason, ban_value, ban_type, is_regex FROM " . table_prefix . "banlist WHERE \n"
  1781               . "    ( ban_type = " . BAN_IP    . " AND is_regex = 0 ) OR \n"
  1781               . "    ( ban_type = " . BAN_IP    . " AND is_regex = 0 ) OR \n"
  1782               . "    ( ban_type = " . BAN_IP    . " AND is_regex = 1 AND '{$_SERVER['REMOTE_ADDR']}' REGEXP ban_value ) OR \n"
  1782               . "    ( ban_type = " . BAN_IP    . " AND is_regex = 1 AND '{$_SERVER['REMOTE_ADDR']}' REGEXP ban_value ) OR \n"
  1783               . "    ( ban_type = " . BAN_USER  . " AND is_regex = 0 AND ban_value = '{$this->username}' ) OR \n"
  1783               . "    ( ban_type = " . BAN_USER  . " AND is_regex = 0 AND ban_value = '" . $db->escape($this->username) . "' ) OR \n"
  1784               . "    ( ban_type = " . BAN_USER  . " AND is_regex = 1 AND '{$this->username}' REGEXP ban_value ) OR \n"
  1784               . "    ( ban_type = " . BAN_USER  . " AND is_regex = 1 AND '" . $db->escape($this->username) . "' REGEXP ban_value ) OR \n"
  1785               . "    ( ban_type = " . BAN_EMAIL . " AND is_regex = 0 AND ban_value = '{$this->email}' ) OR \n"
  1785               . "    ( ban_type = " . BAN_EMAIL . " AND is_regex = 0 AND ban_value = '" . $db->escape($this->email) . "' ) OR \n"
  1786               . "    ( ban_type = " . BAN_EMAIL . " AND is_regex = 1 AND '{$this->email}' REGEXP ban_value ) \n"
  1786               . "    ( ban_type = " . BAN_EMAIL . " AND is_regex = 1 AND '" . $db->escape($this->email) . "' REGEXP ban_value ) \n"
  1787               . "  ORDER BY ban_type ASC;";
  1787               . "  ORDER BY ban_type ASC;";
  1788       }
  1788       }
  1789       else if ( ENANO_DBLAYER == 'PGSQL' )
  1789       else if ( ENANO_DBLAYER == 'PGSQL' )
  1790       {
  1790       {
  1791         $sql = "SELECT $col_reason, ban_value, ban_type, is_regex FROM " . table_prefix . "banlist WHERE \n"
  1791         $sql = "SELECT $col_reason, ban_value, ban_type, is_regex FROM " . table_prefix . "banlist WHERE \n"
  1792               . "    ( ban_type = " . BAN_IP    . " AND is_regex = 0 ) OR \n"
  1792               . "    ( ban_type = " . BAN_IP    . " AND is_regex = 0 ) OR \n"
  1793               . "    ( ban_type = " . BAN_IP    . " AND is_regex = 1 AND '{$_SERVER['REMOTE_ADDR']}' ~ ban_value ) OR \n"
  1793               . "    ( ban_type = " . BAN_IP    . " AND is_regex = 1 AND '{$_SERVER['REMOTE_ADDR']}' ~ ban_value ) OR \n"
  1794               . "    ( ban_type = " . BAN_USER  . " AND is_regex = 0 AND ban_value = '{$this->username}' ) OR \n"
  1794               . "    ( ban_type = " . BAN_USER  . " AND is_regex = 0 AND ban_value = '" . $db->escape($this->username) . "' ) OR \n"
  1795               . "    ( ban_type = " . BAN_USER  . " AND is_regex = 1 AND '{$this->username}' ~ ban_value ) OR \n"
  1795               . "    ( ban_type = " . BAN_USER  . " AND is_regex = 1 AND '" . $db->escape($this->username) . "' ~ ban_value ) OR \n"
  1796               . "    ( ban_type = " . BAN_EMAIL . " AND is_regex = 0 AND ban_value = '{$this->email}' ) OR \n"
  1796               . "    ( ban_type = " . BAN_EMAIL . " AND is_regex = 0 AND ban_value = '" . $db->escape($this->email) . "' ) OR \n"
  1797               . "    ( ban_type = " . BAN_EMAIL . " AND is_regex = 1 AND '{$this->email}' ~ ban_value ) \n"
  1797               . "    ( ban_type = " . BAN_EMAIL . " AND is_regex = 1 AND '" . $db->escape($this->email) . "' ~ ban_value ) \n"
  1798               . "  ORDER BY ban_type ASC;";
  1798               . "  ORDER BY ban_type ASC;";
  1799       }
  1799       }
  1800       $q = $this->sql($sql);
  1800       $q = $this->sql($sql);
  1801       if ( $db->numrows() > 0 )
  1801       if ( $db->numrows() > 0 )
  1802       {
  1802       {