diff -r 0000000000000000000000000000000000000000 -r 1379d724abe28aa7f5cb799d70b4991c5b989baa engine/LICENSE.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/engine/LICENSE.txt Sun Aug 11 16:41:48 2013 -0500 @@ -0,0 +1,13 @@ +Copyright [2011] [Nathan Adams] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff -r 0000000000000000000000000000000000000000 -r 1379d724abe28aa7f5cb799d70b4991c5b989baa engine/centralacl.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/engine/centralacl.php Sun Aug 11 16:41:48 2013 -0500 @@ -0,0 +1,108 @@ +$val) + { + $getstr .= $key . " => " . $val . "\n"; + } + } catch (Exception $e) { + //pass + } + return $getstr; +} + +function poststr() +{ + $poststr = ""; + try { + foreach($_POST as $key=>$val) + { + $poststr .= $key . " => " . $val . "\n"; + } + } catch (Exception $e) { + + } + return $poststr; +} + +function logactivity() +{ + global $conn; + $referer = array_key_exists('HTTP_REFERER', $_SERVER) ? $_SERVER['HTTP_REFERER'] : ""; + $servername = array_key_exists('SERVER_NAME', $_SERVER) ? $_SERVER['SERVER_NAME'] : ""; + $useragent = array_key_exists('HTTP_USER_AGENT', $_SERVER) ? $_SERVER['HTTP_USER_AGENT'] : ""; + $q = "INSERT INTO activity (ip_addr,getdata,postdata,servername,referer,user_agent, datestamp) VALUES ('" . $_SERVER['REMOTE_ADDR'] . "',"; + $q .= "'" . getstr() . "','" . poststr() . "','" . $servername . "',"; + $q .= "'" . $referer . "','" . $useragent . "', " . time() . ")"; + $conn->query($q); +} + +if ($hostname) +{ + $hostnamearr = explode(".", $hostname); + $tld = implode(".",array_splice($hostnamearr, -3, 3)); +} else { + $outtext = "In order to access this site you must have a reverse PTR set for your IP address.
"; + $outtext .= "More information: http://en.wikipedia.org/wiki/PTR_Record.\n"; + $outtext .= "If you would like to be added to a whitelist please email $email\n"; + $conn->close(); + die($outtext); +} + +$nip = sprintf("%u", ip2long($IP)); + +//Is the IP on the blocklist? +$whitelistip_check = $conn->query("SELECT * FROM whitelistip WHERE ip_addr = $nip"); + +if ($whitelistip_check && $whitelistip_check->num_rows == 0) +{ + $blacklistip_check = $conn->query("SELECT * FROM blockedip where start_ip_addr <= $nip AND end_ip_addr >= $nip"); + if ($blacklistip_check && $blacklistip_check->num_rows == 0) + { + //Is the hostname on the whitelist? + $blacklistdomain_check = $conn->query("SELECT * FROM blockddomains WHERE domain LIKE '$tld'"); + if ($blacklistdomain_check && $blacklistdomain_check->num_rows > 0) + { + //log activity + logactivity(); + $outtext = "Your hostname has been banned from $place.
"; + $outtext .= "If you believe this to be in error please contact $email"; + $conn->close(); + die($outtext); + } + } else { + //log activity + logactivity(); + $outtext = "Your IP has been banned from $place.
"; + $outtext .= "If you believe this to be in error please contact $email"; + $conn->close(); + die($outtext); + } +} +$conn->close(); +?> \ No newline at end of file diff -r 0000000000000000000000000000000000000000 -r 1379d724abe28aa7f5cb799d70b4991c5b989baa engine/centralacl.sql --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/engine/centralacl.sql Sun Aug 11 16:41:48 2013 -0500 @@ -0,0 +1,72 @@ +/* +SQLyog Community v8.82 +MySQL - 5.5.8 : Database - centralacl +********************************************************************* +*/ + +/*!40101 SET NAMES utf8 */; + +/*!40101 SET SQL_MODE=''*/; + +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +CREATE DATABASE /*!32312 IF NOT EXISTS*/`centralacl` /*!40100 DEFAULT CHARACTER SET latin1 */; + +USE `centralacl`; + +/*Table structure for table `activity` */ + +DROP TABLE IF EXISTS `activity`; + +CREATE TABLE `activity` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `ip_addr` char(16) NOT NULL, + `getdata` text NOT NULL, + `postdata` text NOT NULL, + `servername` text, + `referer` text, + `user_agent` text, + `datestamp` INT(11) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +/*Table structure for table `blockeddomains` */ + +DROP TABLE IF EXISTS `blockeddomains`; + +CREATE TABLE `blockeddomains` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `domain` char(100) NOT NULL, + `date_added` int(11) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +/*Table structure for table `blockedip` */ + +DROP TABLE IF EXISTS `blockedip`; + +CREATE TABLE `blockedip` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `start_ip_addr` int(11) unsigned NOT NULL, + `end_ip_addr` int(11) unsigned NOT NULL, + `date_added` int(11) unsigned NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +/*Table structure for table `whitelistip` */ + +DROP TABLE IF EXISTS `whitelistip`; + +CREATE TABLE `whitelistip` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `ip_addr` int(11) unsigned NOT NULL, + `date_added` int(11) unsigned NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;