|
From: <il...@sc...> - 2006-08-28 21:58:17
|
Update of /cvsroot/meshdb/www/db2 In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv25428 Modified Files: submit.php config-local.php-dist Log Message: Added support for checking submissions against DNS blacklists. Index: submit.php =================================================================== RCS file: /cvsroot/meshdb/www/db2/submit.php,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- submit.php 16 Feb 2005 11:17:33 -0000 1.16 +++ submit.php 28 Aug 2006 21:58:09 -0000 1.17 @@ -5,6 +5,12 @@ if ($READONLY) die("database has been marked read only"); +/* DNS blacklists. */ +$rev = implode('.', array_reverse(explode('.', $_SERVER["REMOTE_ADDR"]))); +foreach ($DNSBLS as $dnsbl) + if (checkdnsrr($rev . "." . $dnsbl . ".", "A")) + die("access denied"); + /* Looks up the mail-on-update related information that's currently * stored for this node so we can send mail (if desired) after we've * made the changes. */ Index: config-local.php-dist =================================================================== RCS file: /cvsroot/meshdb/www/db2/config-local.php-dist,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- config-local.php-dist 27 Nov 2003 04:52:28 -0000 1.4 +++ config-local.php-dist 28 Aug 2006 21:58:09 -0000 1.5 @@ -9,7 +9,7 @@ */ global $MYSQLHOST, $MYSQLUSER, $MYSQLPASS, $MYSQLDB; - global $READONLY, $OURPROXY, $DBADMIN; + global $READONLY, $OURPROXY, $DBADMIN, $DNSBLS; global $ZONE, $SHIFTFILE, $ALTFILE; $MYSQLHOST = "host"; /* MySQL hostname */ @@ -20,6 +20,11 @@ $OURPROXY = "proxy"; /* an HTTP proxy host available to us */ $DBADMIN = "db...@br..."; /* Address of a human administrator */ + $DNSBLS = array(); /* DNS blacklist query domains */ + /* $DNSBLS[] = "http.dnsbl.sorbs.net"; */ + /* $DNSBLS[] = "sbl-xbl.spamhaus.org"; */ + /* etc */ + $ZONE = 56; /* UTM zone (56 for Brisbane) */ $SHIFTFILE = "lib/QLD_0900.gsb";/* Shift file */ $ALTFILE = "lib/alt.desc"; /* Altitude file */ |