Changeset 221 for branches/acl/cgi-bin/IPDB.pm
- Timestamp:
- 04/13/05 13:24:15 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/acl/cgi-bin/IPDB.pm
r189 r221 23 23 @EXPORT_OK = qw( 24 24 %disp_alloctypes %list_alloctypes %def_custids @citylist @poplist @masterblocks 25 %allocated %free %routed %bigfree 25 %allocated %free %routed %bigfree %IPDBacl 26 26 &initIPDBGlobals &connectDB &finish &checkDBSanity &allocateBlock &deleteBlock 27 27 &mailNotify … … 31 31 %EXPORT_TAGS = ( ALL => [qw( 32 32 %disp_alloctypes %list_alloctypes %def_custids @citylist @poplist 33 @masterblocks %allocated %free %routed %bigfree 33 @masterblocks %allocated %free %routed %bigfree %IPDBacl 34 34 &initIPDBGlobals &connectDB &finish &checkDBSanity &allocateBlock 35 35 &deleteBlock &mailNotify … … 50 50 our %routed; 51 51 our %bigfree; 52 our %IPDBacl; 52 53 53 54 # Let's initialize the globals. … … 83 84 $sth = $dbh->prepare("select cidr from masterblocks order by cidr"); 84 85 $sth->execute; 86 return (undef,$sth->errstr) if $sth->err; 85 87 for (my $i=0; my @data = $sth->fetchrow_array(); $i++) { 86 88 $masterblocks[$i] = new NetAddr::IP $data[0]; … … 91 93 $routed{"$masterblocks[$i]"} = 0; 92 94 } 95 96 # Load ACL data. Specific username checks are done at a different level. 97 $sth = $dbh->prepare("select username,acl from users"); 98 $sth->execute; 93 99 return (undef,$sth->errstr) if $sth->err; 100 while (my @data = $sth->fetchrow_array) { 101 $IPDBacl{$data[0]} = $data[1]; 102 } 94 103 95 104 return (1,"OK");
Note:
See TracChangeset
for help on using the changeset viewer.