Changeset 168 for branches/stable
- Timestamp:
- 02/22/05 14:30:36 (20 years ago)
- Location:
- branches/stable/cgi-bin
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/cgi-bin/IPDB.pm
r159 r168 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]; -
branches/stable/cgi-bin/consistency-check.pl
r158 r168 14 14 15 15 ($dbh,$errstr) = connectDB_My; 16 17 # Schlep up the masters 18 $sth = $dbh->prepare("select * from masterblocks order by cidr"); 19 $sth->execute; 20 for ($i=0; @data = $sth->fetchrow_array; $i++) { 21 $masterblocks[$i] = new NetAddr::IP $data[0]; 22 } 16 # May as well. We need a number of globals. 17 initIPDBGlobals($dbh); 23 18 24 19 print "First check: All blocks must be within one of the master blocks\n"; … … 54 49 # Next: free blocks 55 50 print "Checking freeblocks: "; 56 $sth = $dbh->prepare("select cidr from freeblocks ");51 $sth = $dbh->prepare("select cidr from freeblocks order by cidr"); 57 52 $sth->execute; 58 53 FREEBLOCK: while (@data = $sth->fetchrow_array) { … … 138 133 print "done $master.\n"; 139 134 } 135 136 print "Done checking block alignment.\n\nChecking for correctness on 'defined' CustIDs:\n"; 137 # New check: Make sure "defined" CustIDs are correct. 138 $sth = $dbh->prepare("select cidr,type,custid from allocations where not type='cn' order by cidr"); 139 $sth->execute; 140 while (@data = $sth->fetchrow_array) { 141 print "$data[0] ($disp_alloctypes{$data[1]}) has incorrect CustID $data[2]\n" 142 if $data[2] ne $def_custids{$data[1]}; 143 } 144 145 print "Done CustID correctness check.\n"; -
branches/stable/cgi-bin/main.cgi
r165 r168 1013 1013 # print "<!-- [ In validateInput(). Insert customer ID cross-check here. ] -->\n"; 1014 1014 } else { 1015 # All non-customer allocations MUST be entered with "our" customer ID. 1016 # I have Defined this as 6750400 for consistency. 1017 # STAFF is also acceptable. 1015 # New! Improved! And now Loaded From The Database!! 1018 1016 if ((!$webvar{custid}) || ($webvar{custid} ne 'STAFF')) { 1019 $webvar{custid} = "6750400";1017 $webvar{custid} = $def_custids{$webvar{alloctype}}; 1020 1018 } 1021 1019 }
Note:
See TracChangeset
for help on using the changeset viewer.