Index: branches/stable/cgi-bin/checkcusts.pl
===================================================================
--- branches/stable/cgi-bin/checkcusts.pl	(revision 168)
+++ branches/stable/cgi-bin/checkcusts.pl	(revision 169)
@@ -7,5 +7,5 @@
 # Last update by $Author$
 ###
-# Copyright (C) 2004 Kris Deugau <kdeugau@vianet.ca>
+# Copyright (C) 2004,2005 Kris Deugau <kdeugau@vianet.ca>
 
 use DBI;
@@ -27,4 +27,10 @@
 ($dbh,$errstr) = connectDB("ipdb", "ipdb", "ipdbpwd");
 $IDH = DBI->connect ("DBI:Pg:host=newbilling;dbname=custids", "cidcheck", "c1dch4ck");
+
+$sth = $dbh->prepare("select distinct def_custid from alloctypes where listorder >=40");
+$sth->execute;
+while (@data = $sth->fetchrow_array) {
+  push @def_custids, $data[0];
+}
 $sth = $dbh->prepare("select cidr,custid from searchme where not (custid='6750400') ".
 	"and not (custid='STAFF') order by cidr");
@@ -35,9 +41,10 @@
 $count = $bad = 0;
 while (@data = $sth->fetchrow_array) {
-  $count++;
   $cidr = new NetAddr::IP $data[0];
-  if ($cidr->within($priv1) or $cidr->within($priv2) or $cidr->within($priv3)) {
+  if ($cidr->within($priv1) or $cidr->within($priv2) or $cidr->within($priv3) or
+	(grep /$data[1]/, @def_custids)) {
     # no-op.  we ignore these.
   } else {
+    $count++;
     $IDS->execute($data[1]);
     $hr = $IDS->fetchrow_hashref();
