includes/sessions.php
changeset 1314 29b14c220a78
parent 1292 0e2e476e90e8
child 1352 d97cf005f674
equal deleted inserted replaced
1313:da50b017af94 1314:29b14c220a78
  1788 			if ( ENANO_DBLAYER == 'MYSQL' )
  1788 			if ( ENANO_DBLAYER == 'MYSQL' )
  1789 			{
  1789 			{
  1790 				$sql = "SELECT $col_reason, ban_value, ban_type, is_regex FROM " . table_prefix . "banlist WHERE \n"
  1790 				$sql = "SELECT $col_reason, ban_value, ban_type, is_regex FROM " . table_prefix . "banlist WHERE \n"
  1791 							. "    ( ban_type = " . BAN_IP    . " AND is_regex = 0 ) OR \n"
  1791 							. "    ( ban_type = " . BAN_IP    . " AND is_regex = 0 ) OR \n"
  1792 							. "    ( ban_type = " . BAN_IP    . " AND is_regex = 1 AND '{$_SERVER['REMOTE_ADDR']}' REGEXP ban_value ) OR \n"
  1792 							. "    ( ban_type = " . BAN_IP    . " AND is_regex = 1 AND '{$_SERVER['REMOTE_ADDR']}' REGEXP ban_value ) OR \n"
  1793 							. "    ( ban_type = " . BAN_USER  . " AND is_regex = 0 AND ban_value = '{$this->username}' ) OR \n"
  1793 							. "    ( ban_type = " . BAN_USER  . " AND is_regex = 0 AND ban_value = '" . $db->escape($this->username) . "' ) OR \n"
  1794 							. "    ( ban_type = " . BAN_USER  . " AND is_regex = 1 AND '{$this->username}' REGEXP ban_value ) OR \n"
  1794 							. "    ( ban_type = " . BAN_USER  . " AND is_regex = 1 AND '" . $db->escape($this->username) . "' REGEXP ban_value ) OR \n"
  1795 							. "    ( ban_type = " . BAN_EMAIL . " AND is_regex = 0 AND ban_value = '{$this->email}' ) OR \n"
  1795 							. "    ( ban_type = " . BAN_EMAIL . " AND is_regex = 0 AND ban_value = '" . $db->escape($this->email) . "' ) OR \n"
  1796 							. "    ( ban_type = " . BAN_EMAIL . " AND is_regex = 1 AND '{$this->email}' REGEXP ban_value ) \n"
  1796 							. "    ( ban_type = " . BAN_EMAIL . " AND is_regex = 1 AND '" . $db->escape($this->email) . "' REGEXP ban_value ) \n"
  1797 							. "  ORDER BY ban_type ASC;";
  1797 							. "  ORDER BY ban_type ASC;";
  1798 			}
  1798 			}
  1799 			else if ( ENANO_DBLAYER == 'PGSQL' )
  1799 			else if ( ENANO_DBLAYER == 'PGSQL' )
  1800 			{
  1800 			{
  1801 				$sql = "SELECT $col_reason, ban_value, ban_type, is_regex FROM " . table_prefix . "banlist WHERE \n"
  1801 				$sql = "SELECT $col_reason, ban_value, ban_type, is_regex FROM " . table_prefix . "banlist WHERE \n"
  1802 							. "    ( ban_type = " . BAN_IP    . " AND is_regex = 0 ) OR \n"
  1802 							. "    ( ban_type = " . BAN_IP    . " AND is_regex = 0 ) OR \n"
  1803 							. "    ( ban_type = " . BAN_IP    . " AND is_regex = 1 AND '{$_SERVER['REMOTE_ADDR']}' ~ ban_value ) OR \n"
  1803 							. "    ( ban_type = " . BAN_IP    . " AND is_regex = 1 AND '{$_SERVER['REMOTE_ADDR']}' ~ ban_value ) OR \n"
  1804 							. "    ( ban_type = " . BAN_USER  . " AND is_regex = 0 AND ban_value = '{$this->username}' ) OR \n"
  1804 							. "    ( ban_type = " . BAN_USER  . " AND is_regex = 0 AND ban_value = '" . $db->escape($this->username) . "' ) OR \n"
  1805 							. "    ( ban_type = " . BAN_USER  . " AND is_regex = 1 AND '{$this->username}' ~ ban_value ) OR \n"
  1805 							. "    ( ban_type = " . BAN_USER  . " AND is_regex = 1 AND '" . $db->escape($this->username) . "' ~ ban_value ) OR \n"
  1806 							. "    ( ban_type = " . BAN_EMAIL . " AND is_regex = 0 AND ban_value = '{$this->email}' ) OR \n"
  1806 							. "    ( ban_type = " . BAN_EMAIL . " AND is_regex = 0 AND ban_value = '" . $db->escape($this->email) . "' ) OR \n"
  1807 							. "    ( ban_type = " . BAN_EMAIL . " AND is_regex = 1 AND '{$this->email}' ~ ban_value ) \n"
  1807 							. "    ( ban_type = " . BAN_EMAIL . " AND is_regex = 1 AND '" . $db->escape($this->email) . "' ~ ban_value ) \n"
  1808 							. "  ORDER BY ban_type ASC;";
  1808 							. "  ORDER BY ban_type ASC;";
  1809 			}
  1809 			}
  1810 			$q = $this->sql($sql);
  1810 			$q = $this->sql($sql);
  1811 			if ( $db->numrows() > 0 )
  1811 			if ( $db->numrows() > 0 )
  1812 			{
  1812 			{