summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSavetheinternet <savetheinternet@n0v4.com>2011-02-17 20:32:11 +1100
committerSavetheinternet <savetheinternet@n0v4.com>2011-02-17 20:32:11 +1100
commit384996b58ac9fd9ed9cb0ca29f7febe0349a20a8 (patch)
tree1135412174b82b4f3840f42bd3d3752ead32aa65
parent5170cd7aa896d8ebc1f1882cb7645cb30d958c15 (diff)
IPv6 support
-rw-r--r--inc/functions.php7
-rw-r--r--install.sql8
2 files changed, 11 insertions, 4 deletions
diff --git a/inc/functions.php b/inc/functions.php
index eccdc4ee..14733ec8 100644
--- a/inc/functions.php
+++ b/inc/functions.php
@@ -668,7 +668,14 @@
return false;
}
+ function isIPv6() {
+ return strstr($_SERVER['RETMOTE_ADDR'], ':') !== false;
+ }
+
function isTor() {
+ if(isIPv6())
+ return false; // Tor does not support IPv6
+
return gethostbyname(
ReverseIPOctets($_SERVER['REMOTE_ADDR']) . '.' . $_SERVER['SERVER_PORT'] . '.' . ReverseIPOctets($_SERVER['SERVER_ADDR']) . '.ip-port.exitlist.torproject.org'
) == '127.0.0.2';
diff --git a/install.sql b/install.sql
index fc834712..fe676017 100644
--- a/install.sql
+++ b/install.sql
@@ -20,7 +20,7 @@ SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
--
CREATE TABLE IF NOT EXISTS `bans` (
- `ip` varchar(15) NOT NULL,
+ `45` varchar(15) NOT NULL,
`mod` int(11) NOT NULL COMMENT 'which mod made the ban',
`set` int(11) NOT NULL,
`expires` int(11) DEFAULT NULL,
@@ -63,7 +63,7 @@ INSERT INTO `boards` (`id`, `uri`, `title`, `subtitle`) VALUES
CREATE TABLE IF NOT EXISTS `modlogs` (
`mod` int(11) NOT NULL,
- `ip` varchar(15) NOT NULL,
+ `ip` varchar(45) NOT NULL,
`time` int(11) NOT NULL,
`text` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@@ -102,7 +102,7 @@ INSERT INTO `mods` (`id`, `username`, `password`, `type`) VALUES
--
CREATE TABLE IF NOT EXISTS `mutes` (
- `ip` varchar(15) NOT NULL,
+ `ip` varchar(45) NOT NULL,
`time` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
@@ -137,7 +137,7 @@ CREATE TABLE IF NOT EXISTS `posts_b` (
`filename` varchar(30) DEFAULT NULL,
`filehash` varchar(32) DEFAULT NULL,
`password` varchar(20) DEFAULT NULL,
- `ip` varchar(15) NOT NULL,
+ `ip` varchar(45) NOT NULL,
`sticky` int(1) NOT NULL,
`locked` int(1) NOT NULL,
UNIQUE KEY `id` (`id`)