- Timestamp:
- 02/22/05 14:25:58 (20 years ago)
- Location:
- trunk/cgi-bin
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cgi-bin/IPDB.pm
r157 r167 22 22 @ISA = qw(Exporter); 23 23 @EXPORT_OK = qw( 24 %disp_alloctypes %list_alloctypes @citylist @poplist @masterblocks24 %disp_alloctypes %list_alloctypes %def_custids @citylist @poplist @masterblocks 25 25 %allocated %free %routed %bigfree 26 26 &initIPDBGlobals &connectDB &finish &checkDBSanity &allocateBlock &deleteBlock … … 30 30 @EXPORT = (); # Export nothing by default. 31 31 %EXPORT_TAGS = ( ALL => [qw( 32 %disp_alloctypes %list_alloctypes @citylist @poplist @masterblocks33 %allocated %free %routed %bigfree32 %disp_alloctypes %list_alloctypes %def_custids @citylist @poplist 33 @masterblocks %allocated %free %routed %bigfree 34 34 &initIPDBGlobals &connectDB &finish &checkDBSanity &allocateBlock 35 35 &deleteBlock &mailNotify … … 42 42 our %disp_alloctypes; 43 43 our %list_alloctypes; 44 our %def_custids; 44 45 our @citylist; 45 46 our @poplist; … … 58 59 59 60 # Initialize alloctypes hashes 60 $sth = $dbh->prepare("select type,listname,dispname,listorder from alloctypes order by listorder");61 $sth = $dbh->prepare("select type,listname,dispname,listorder,def_custid from alloctypes order by listorder"); 61 62 $sth->execute; 62 63 while (my @data = $sth->fetchrow_array) { 63 64 $disp_alloctypes{$data[0]} = $data[2]; 65 $def_custids{$data[0]} = $data[4]; 64 66 if ($data[3] < 900) { 65 67 $list_alloctypes{$data[0]} = $data[1]; -
trunk/cgi-bin/consistency-check.pl
r142 r167 16 16 ($dbh,$errstr) = connectDB_My; 17 17 18 # Schlep up the masters 19 $sth = $dbh->prepare("select * from masterblocks order by cidr"); 20 $sth->execute; 21 for ($i=0; @data = $sth->fetchrow_array; $i++) { 22 $masterblocks[$i] = new NetAddr::IP $data[0]; 23 } 18 # May as well. We need a number of globals. 19 initIPDBGlobals($dbh); 24 20 25 21 print "First check: All blocks must be within one of the master blocks\n"; … … 55 51 # Next: free blocks 56 52 print "Checking freeblocks: "; 57 $sth = $dbh->prepare("select cidr from freeblocks ");53 $sth = $dbh->prepare("select cidr from freeblocks order by cidr"); 58 54 $sth->execute; 59 55 FREEBLOCK: while (@data = $sth->fetchrow_array) { … … 139 135 print "done $master.\n"; 140 136 } 137 138 print "Done checking block alignment.\n\nChecking for correctness on 'defined' CustIDs:\n"; 139 # New check: Make sure "defined" CustIDs are correct. 140 $sth = $dbh->prepare("select cidr,type,custid from allocations where not type='cn' order by cidr"); 141 $sth->execute; 142 while (@data = $sth->fetchrow_array) { 143 print "$data[0] ($disp_alloctypes{$data[1]}) has incorrect CustID $data[2]\n" 144 if $data[2] ne $def_custids{$data[1]}; 145 } 146 147 print "Done CustID correctness check.\n"; -
trunk/cgi-bin/main.cgi
r166 r167 998 998 print "<!-- [ In validateInput(). Insert customer ID cross-check here. ] -->\n"; 999 999 } else { 1000 # All non-customer allocations MUST be entered with "our" customer ID. 1001 # I have Defined this as 6750400 for consistency. 1002 $webvar{custid} = "6750400"; 1000 # New! Improved! And now Loaded From The Database!! 1001 $webvar{custid} = $def_custids{$webvar{alloctype}}; 1003 1002 } 1004 1003
Note:
See TracChangeset
for help on using the changeset viewer.