Changeset 192 for branches/stable
- Timestamp:
- 03/10/05 14:15:19 (20 years ago)
- Location:
- branches/stable
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/cgi-bin/IPDB.pm
r185 r192 234 234 eval { 235 235 $msg = "Unable to allocate $cidr as '$disp_alloctypes{$type}'"; 236 if ($type eq 'r r') {236 if ($type eq 'rm') { 237 237 $sth = $dbh->prepare("update freeblocks set routed='y',city='$city'". 238 238 " where cidr='$cidr'"); … … 243 243 } else { 244 244 # common stuff for end-use, dialup, dynDSL, pools, etc, etc. 245 $sth = $dbh->prepare("delete from freeblocks where cidr='$cidr'"); 246 $sth->execute; 247 245 246 # special case - block is a container/"reserve" block 247 if ($type =~ /^(.)c$/) { 248 $sth = $dbh->prepare("update freeblocks set routed='$1' where cidr='$cidr'"); 249 $sth->execute; 250 } else { 251 # "normal" case 252 $sth = $dbh->prepare("delete from freeblocks where cidr='$cidr'"); 253 $sth->execute; 254 } 248 255 $sth = $dbh->prepare("insert into allocations". 249 256 " (cidr,custid,type,city,description,notes,maskbits,circuitid)". … … 305 312 306 313 # now we have to do some magic for routing blocks 307 if ($type eq 'r r') {314 if ($type eq 'rm') { 308 315 309 316 # Insert the new freeblocks entries … … 325 332 $sth->execute; 326 333 327 } else { # done with alloctype == r r334 } else { # done with alloctype == rm 328 335 329 336 # Insert the new freeblocks entries 337 # Along with some more HairyPerl(TM) in case we're inserting a 338 # subblock (.r) allocation 330 339 $sth = $dbh->prepare("insert into freeblocks (cidr,maskbits,city,routed)". 331 " values (?, ?, (select city from routed where cidr >>= '$cidr'),'y')"); 340 " values (?, ?, (select city from routed where cidr >>= '$cidr'),'". 341 (($type =~ /^(.)r$/) ? "$1" : 'y')."')"); 332 342 foreach my $block (@newfreeblocks) { 333 343 $sth->execute("$block", $block->masklen); 334 344 } 335 345 # Special-case for reserve/"container" blocks - generate 346 # the "extra" freeblocks entry for the container 347 if ($type =~ /^(.)c$/) { 348 $sth = $dbh->prepare("insert into freeblocks (cidr,maskbits,city,routed)". 349 " values ('$cidr',".$cidr->masklen.",'$city','$1')"); 350 $sth->execute; 351 } 336 352 # Insert the allocations entry 337 353 $sth = $dbh->prepare("insert into allocations (cidr,custid,type,city,". … … 354 370 } 355 371 356 } # done with netblock alloctype != r r372 } # done with netblock alloctype != rm 357 373 358 374 $dbh->commit; … … 485 501 eval { 486 502 487 if ($type eq 'r r') {503 if ($type eq 'rm') { 488 504 $msg = "Unable to remove routing allocation $cidr"; 489 505 $sth = $dbh->prepare("delete from routed where cidr='$cidr'"); … … 499 515 } else { # end alloctype routing case 500 516 501 $sth = $dbh->prepare("delete from allocations where cidr='$cidr'"); 517 # Delete all allocations within the block being deleted. This is 518 # deliberate and correct, and removes the need to special-case 519 # removal of "container" blocks. 520 $sth = $dbh->prepare("delete from allocations where cidr <<='$cidr'"); 502 521 $sth->execute; 522 503 523 # Special case - delete pool IPs 504 524 if ($type =~ /^.[pd]$/) { … … 511 531 $sth = $dbh->prepare("select cidr from freeblocks where cidr <<= ". 512 532 "(select cidr from routed where cidr >>= '$cidr') ". 513 " and maskbits<=".$cidr->masklen." and routed='y' order by maskbits desc"); 533 " and maskbits<=".$cidr->masklen. 534 " and routed='".(($type =~ /^(.)r$/) ? '$1' : 'y'). 535 "' order by maskbits desc"); 514 536 515 537 } # end alloctype general case … … 562 584 } 563 585 564 # Clear old freeblocks entries - if any. $i==0 if not. 565 if ($i>0) { 566 $sth = $dbh->prepare("delete from freeblocks where cidr=?"); 567 foreach my $block (@combinelist) { 568 $sth->execute("$block"); 569 } 570 } 586 # Clear old freeblocks entries - if any. They should all be within 587 # the $cidr determined above. 588 $sth = $dbh->prepare("delete from freeblocks where cidr <<='$cidr'"); 589 $sth->execute; 571 590 572 591 # insert "new" freeblocks entry 573 if ($type eq 'r r') {592 if ($type eq 'rm') { 574 593 $sth = $dbh->prepare("insert into freeblocks (cidr,maskbits,city)". 575 594 " values ('$cidr',".$cidr->masklen.",'<NULL>')"); … … 577 596 $sth = $dbh->prepare("insert into freeblocks (cidr,maskbits,city,routed)". 578 597 " values ('$cidr',".$cidr->masklen. 579 ",(select city from routed where cidr >>= '$cidr'),'y')"); 598 ",(select city from routed where cidr >>= '$cidr'),'". 599 (($type =~ /^(.)r$/) ? "$1" : 'y')."')"); 580 600 } 581 601 $sth->execute; -
branches/stable/cgi-bin/consistency-check.pl
r168 r192 17 17 initIPDBGlobals($dbh); 18 18 19 print " First check: All blocks must be within one of the master blocks\n";19 print "Checking master containment...\n"; 20 20 21 21 # First check - make sure ALL routes and allocated blocks are part 22 22 # of one of the master blocks. 23 print " Checking routed blocks:";23 print " Checking routed blocks:"; 24 24 $sth = $dbh->prepare("select cidr from routed"); 25 # union select cidr from allocations union select cidr from freeblocks");26 $ sth->execute;25 $sth->execute; 26 $flag = ''; 27 27 ROUTED: while (@data = $sth->fetchrow_array) { 28 28 $cidr = new NetAddr::IP $data[0]; … … 30 30 if ($master->contains($cidr)) { next ROUTED; } 31 31 } 32 print " $cidr not mastered\n";33 } 34 print " done.\n";32 print "\n $cidr not mastered"; 33 } 34 print "$flag done.\n"; 35 35 36 36 # Next test: All allocations must be part of a master. 37 print " Checking allocations:";37 print " Checking allocations:"; 38 38 $sth = $dbh->prepare("select cidr from allocations"); 39 39 $sth->execute; 40 $flag = ''; 40 41 ALLOCATED: while (@data = $sth->fetchrow_array) { 41 42 $cidr = new NetAddr::IP $data[0]; … … 43 44 if ($master->contains($cidr)) { next ALLOCATED; } 44 45 } 45 print "$cidr not mastered\n"; 46 } 47 print " done.\n"; 46 print "\n $cidr not mastered"; 47 $flag = "\n "; 48 } 49 print "$flag done.\n"; 48 50 49 51 # Next: free blocks 50 print " Checking freeblocks:";52 print " Checking freeblocks:"; 51 53 $sth = $dbh->prepare("select cidr from freeblocks order by cidr"); 52 54 $sth->execute; 55 $flag = ''; 53 56 FREEBLOCK: while (@data = $sth->fetchrow_array) { 54 57 $cidr = new NetAddr::IP $data[0]; … … 56 59 if ($master->contains($cidr)) { next FREEBLOCK; } 57 60 } 58 print "$cidr not mastered\n"; 59 } 60 print " done.\n"; 61 62 print "Done checking master containment.\n\nChecking pool containment:\n"; 61 print "\n $cidr not mastered"; 62 $flag = "\n "; 63 } 64 print "$flag done.\n"; 65 66 print "Done checking master containment.\n\n"; 67 68 print "Checking pool containment...\n"; 63 69 64 70 $sth = $dbh->prepare("select pool,ip from poolips order by ip"); … … 67 73 $pool = new NetAddr::IP $data[0]; 68 74 $ip = new NetAddr::IP $data[1]; 69 print " IP $ip listed with incorrect pool $pool\n"75 print " IP $ip listed with incorrect pool $pool\n" 70 76 if !$pool->contains($ip); 71 77 } … … 75 81 $sth2 = $dbh->prepare("select cidr from allocations where cidr='$data[0]'"); 76 82 $sth2->execute; 77 print " Pool $data[0] does not exist in allocations table\n"83 print " Pool $data[0] does not exist in allocations table\n" 78 84 if (($sth2->fetchrow_array)[0] eq ''); 79 85 } 80 86 81 print "Done checking pool containment.\n\nChecking block-alignment consistency:\n"; 87 print "Done checking pool containment.\n\n"; 88 89 print "Checking block-alignment consistency...\n"; 82 90 83 91 # Block alignment consistency: All allocated+free blocks within a master … … 95 103 96 104 foreach $master (@masterblocks) { 97 print " Master $master:\n";105 print " Master $master:\n"; 98 106 $prev = $master; 99 107 $sth = $dbh->prepare("(select network(cidr) as net, broadcast(cidr) as bcast ". 100 " from allocations where cidr <<= '$master') union".101 " (select network(cidr) as net, broadcast(cidr) as bcast ".102 "from freeblocks where cidr <<= '$master' ) order by net");108 "from allocations where cidr <<= '$master' and type not like '_c') ". 109 "union (select network(cidr) as net, broadcast(cidr) as bcast ". 110 "from freeblocks where cidr <<= '$master' and not (routed='c')) order by net"); 103 111 $sth->execute; 104 112 … … 109 117 # check if cur starts with master 110 118 if ($cur->numeric > $prev->numeric) { 111 print " Gap from start of master $master to first block $cur\n";119 print " Gap from start of master $master to first block $cur\n"; 112 120 } elsif ($cur->numeric < $prev->numeric) { 113 print " BIG problem! Current block $cur begins before master $master!\n";121 print " BIG problem! Current block $cur begins before master $master!\n"; 114 122 } 115 123 } else { 116 124 if ($cur->numeric < ($prev->numeric + 1)) { 117 print " Block ".$prev->network." overlaps block $cur\n";125 print " Block ".$prev->network." overlaps block $cur\n"; 118 126 } elsif ($cur->numeric > ($prev->numeric + 1)) { 119 print " Gap between end of block ".$prev->network." and block $cur\n";127 print " Gap between end of block ".$prev->network." and block $cur\n"; 120 128 } 121 129 } … … 129 137 $master--; 130 138 if ($cur->numeric ne $master->numeric) { 131 print " Gap from $cur to end of master at $master\n"; 132 } 133 print "done $master.\n"; 134 } 135 136 print "Done checking block alignment.\n\nChecking for correctness on 'defined' CustIDs:\n"; 139 print " Gap from $cur to end of master at $master\n"; 140 } 141 print " done $master.\n"; 142 } 143 144 print "Done checking block alignment.\n\n"; 145 146 print "Checking containment on container blocks...\n"; 147 # First, we need a list of containers. 148 # Then, we check all of the contained blocks to see if they're within 149 # the proper container. 150 $sth = $dbh->prepare("select cidr from allocations where type like '_c' order by cidr"); 151 $sth->execute; 152 $i=0; 153 while (@data = $sth->fetchrow_array) { 154 $containers[$i++] = new NetAddr::IP $data[0]; 155 } 156 print " Checking general containment:"; 157 $sth = $dbh->prepare("select cidr from allocations where type like '_r' order by cidr"); 158 $sth->execute; 159 $flag = ''; 160 CONTAINED: while (@data = $sth->fetchrow_array) { 161 $cidr = new NetAddr::IP $data[0]; 162 foreach $container (@containers) { 163 next CONTAINED if $container->contains($cidr); 164 } 165 print "\n $cidr not contained"; 166 $flag = "\n "; 167 } 168 print "$flag done.\n"; 169 print " Checking alignment:\n"; 170 foreach $container (@containers) { 171 print " Container $container:\n"; 172 $prev = $container; 173 $sth = $dbh->prepare("(select network(cidr) as net, broadcast(cidr) as bcast ". 174 "from allocations where cidr <<= '$container' and type like '_r') ". 175 "union (select network(cidr) as net, broadcast(cidr) as bcast ". 176 "from freeblocks where cidr <<= '$container' and routed='w') order by net"); 177 $sth->execute; 178 179 while (@data = $sth->fetchrow_array) { 180 $cur = new NetAddr::IP $data[0]; 181 182 if ($container->numeric == $prev->numeric) { 183 # check if cur starts with master 184 if ($cur->numeric > $prev->numeric) { 185 print " Gap from start of container $container to first block $cur\n"; 186 } elsif ($cur->numeric < $prev->numeric) { 187 print " BIG problem! Current block $cur begins before container $container!\n"; 188 } 189 } else { 190 if ($cur->numeric < ($prev->numeric + 1)) { 191 print " Block ".$prev->network." overlaps block $cur\n"; 192 } elsif ($cur->numeric > ($prev->numeric + 1)) { 193 print " Gap between end of block ".$prev->network." and block $cur\n"; 194 } 195 } 196 197 $prev = $cur; 198 $prev--; 199 200 } # while (@data...) 201 202 $cur--; 203 $container--; 204 if ($cur->numeric ne $container->numeric) { 205 print " Gap from $cur to end of container at $container\n"; 206 } 207 print " done $container.\n"; 208 209 } 210 print " done container alignment.\n"; 211 print "Done checking container containment.\n\n"; 212 213 print "Checking for correctness on 'defined' CustIDs:\n"; 137 214 # New check: Make sure "defined" CustIDs are correct. 138 215 $sth = $dbh->prepare("select cidr,type,custid from allocations where not type='cn' order by cidr"); -
branches/stable/cgi-bin/ipdb.psql
r185 r192 120 120 GRANT ALL on "cities" to "ipdb"; 121 121 122 -- 123 -- Selected TOC Entries: 124 -- 125 \connect - ipdb 126 127 -- 128 -- TOC Entry ID 2 (OID 92809) 129 -- 130 -- Name: alloctypes Type: TABLE Owner: ipdb 131 -- 132 133 CREATE TABLE "alloctypes" ( 134 "type" character(2) DEFAULT '' NOT NULL, 135 "listname" character varying(40) DEFAULT '', 136 "dispname" character varying(40) DEFAULT '', 137 "listorder" integer DEFAULT 0, 138 "def_custid" character varying(16) DEFAULT '', 139 Constraint "alloctypes_pkey" Primary Key ("type") 140 ); 141 142 -- 143 -- TOC Entry ID 3 (OID 92809) 144 -- 145 -- Name: alloctypes Type: ACL Owner: 146 -- 147 148 REVOKE ALL on "alloctypes" from PUBLIC; 149 GRANT ALL on "alloctypes" to "kdeugau"; 150 GRANT ALL on "alloctypes" to "ipdb"; 151 152 -- 153 -- Data for TOC Entry ID 4 (OID 92809) 154 -- 155 -- Name: alloctypes Type: TABLE DATA Owner: ipdb 156 -- 157 158 122 159 COPY "alloctypes" FROM stdin; 123 160 cd Static Pool - Cable Cable pool 41 CBL-BUS … … 125 162 mp Static Pool - Dialup Static dialup pool 43 DIAL-BUS 126 163 wp Static Pool - Wireless Static wireless pool 44 WL-BUS 127 dc Dynamic cable block Dynamic cable block 103 CBL-RES128 dy Dynamic DSL block Dynamic DSL block 102 DSL-RES129 dn Dialup netblock Dialup netblock 101 DIAL-RES130 dw Dynamic WiFi block Dynamic WiFi block 104 WL-RES131 164 mm Master block Master block 999 6750400 132 rr Routing Routed netblock 500 6750400133 165 in Internal netblock Internal netblock 990 6750400 134 ee End-use netblock End-use netblock 100 6750400135 166 sd Static Pool - Servers Server pool 40 6750400 136 167 cn Customer netblock Customer netblock 0 … … 140 171 wi Static IP - Wireless Static wireless IP 24 141 172 si Static IP - Server pool Server pool IP 20 6750400 173 wc Reserve for WAN blocks WAN IP blocks 200 6750400 174 wr Internal WAN block Internal WAN block 201 6750400 175 pc Reserve for dynamic-route DSL netblocks Dynamic-route netblocks 202 6750400 176 en End-use netblock End-use netblock 100 6750400 177 me Dialup netblock Dialup netblock 101 DIAL-RES 178 de Dynamic DSL block Dynamic DSL block 102 DSL-RES 179 ce Dynamic cable block Dynamic cable block 103 CBL-RES 180 we Dynamic WiFi block Dynamic WiFi block 104 WL-RES 181 rm Routing Routed netblock 500 6750400 182 pr Dynamic-route DSL netblock Dynamic-route DSL 203 142 183 \. -
branches/stable/cgi-bin/main.cgi
r185 r192 325 325 326 326 while (my @data = $sth->fetchrow_array) { 327 # cidr,custid,type,city,description,notes 328 # Fix up types from pools (which are single-char) 329 # Fixing the database would be... painful. :( 330 ##fixme LEGACY CODE 331 if ($data[2] =~ /^[cdsmw]$/) { 332 $data[2] .= 'i'; 333 } 334 my @row = (qq(<a href="/ip/cgi-bin/main.cgi?action=edit&block=$data[0]">$data[0]</a>), 327 # cidr,custid,type,city,description 328 # Prefix subblocks with "Sub " 329 my @row = ( (($data[2] =~ /^.r$/) ? 'Sub ' : ''). 330 qq(<a href="/ip/cgi-bin/main.cgi?action=edit&block=$data[0]">$data[0]</a>), 335 331 $data[1], $disp_alloctypes{$data[2]}, $data[3], $data[4]); 336 332 # Allow listing of pool if desired/required. … … 599 595 # $data[2] =~ s/\s+//g; 600 596 601 my @row = ("<a href=\"/ip/cgi-bin/main.cgi?action=edit&block=$data[0]\">$data[0]</a>", 597 # Prefix subblocks with "Sub " 598 my @row = ( (($data[2] =~ /^.r$/) ? 'Sub ' : ''). 599 qq(<a href="/ip/cgi-bin/main.cgi?action=edit&block=$data[0]">$data[0]</a>), 602 600 $data[1], $disp_alloctypes{$data[2]}, $data[3], $data[4]); 603 601 # If the allocation is a pool, allow listing of the IPs in the pool. … … 622 620 qq(<input type=hidden name=action value="delete">\n). 623 621 qq(<input type=hidden name=block value="$master">\n). 624 qq(<input type=hidden name=alloctype value="r r">\n).622 qq(<input type=hidden name=alloctype value="rm">\n). 625 623 qq(<input type=submit value=" Remove this block ">\n). 626 624 qq(</form>\n); … … 635 633 # unrouted free blocks, but it's better to let the database do the work if we can. 636 634 $count = 0; 637 $sth = $ip_dbh->prepare("select cidr from freeblocks where routed='y' and cidr <<= '$master' order by cidr"); 635 $sth = $ip_dbh->prepare("select cidr,routed from freeblocks where cidr <<= '$master'". 636 " order by cidr"); 638 637 $sth->execute(); 639 638 while (my @data = $sth->fetchrow_array()) { 640 # cidr, maskbits,city639 # cidr,routed 641 640 my $cidr = new NetAddr::IP $data[0]; 642 my @row = ("<a href=\"/ip/cgi-bin/main.cgi?action=assign&block=$cidr\">$cidr</a>", 641 # Include some HairyPerl(TM) to prefix subblocks with "Sub " 642 my @row = ((($data[1] ne 'y' && $data[1] ne 'n') ? 'Sub ' : ''). 643 qq(<a href="/ip/cgi-bin/main.cgi?action=assign&block=$cidr&fbtype=$data[1]">$cidr</a>), 643 644 $cidr->range); 644 645 printRow(\@row, 'color1') if ($count%2 == 0); … … 730 731 $html =~ s|\$\$MASKBITS\$\$|$block->masklen|; 731 732 my $typelist = ''; 732 $sth = $ip_dbh->prepare("select type,listname from alloctypes where listorder < 500 and type not like '_i' order by listorder"); 733 $sth->execute; 734 my @data = $sth->fetchrow_array; 735 $typelist .= "<option value='$data[0]' selected>$data[1]</option>\n"; 736 while (my @data = $sth->fetchrow_array) { 737 $typelist .= "<option value='$data[0]'>$data[1]</option>\n"; 733 734 # This is a little dangerous, as it's *theoretically* possible to 735 # get fbtype='n' (aka a non-routed freeblock). However, should 736 # someone manage to get there, they get what they deserve. 737 if ($webvar{fbtype} ne 'y') { 738 # Snag the type of the block from the database. We have no 739 # convenient way to pass this in from the calling location. :/ 740 $sth = $ip_dbh->prepare("select type from allocations where cidr >>='$block'"); 741 $sth->execute; 742 my @data = $sth->fetchrow_array; 743 $data[0] =~ s/c$/r/; # Munge the type into the correct form 744 $typelist = "$list_alloctypes{$data[0]}<input type=hidden name=alloctype value=$data[0]>\n"; 745 } else { 746 $typelist .= qq(<select name="alloctype">\n); 747 $sth = $ip_dbh->prepare("select type,listname from alloctypes where listorder < 500 ". 748 "and type not like '_i' and type not like '_r' order by listorder"); 749 $sth->execute; 750 my @data = $sth->fetchrow_array; 751 $typelist .= "<option value='$data[0]' selected>$data[1]</option>\n"; 752 while (my @data = $sth->fetchrow_array) { 753 $typelist .= "<option value='$data[0]'>$data[1]</option>\n"; 754 } 755 $typelist .= "</select>\n"; 738 756 } 739 757 $html =~ s|\$\$TYPELIST\$\$|$typelist|g; … … 839 857 my $city; 840 858 my $failmsg; 841 if ($webvar{alloctype} eq 'r r') {859 if ($webvar{alloctype} eq 'rm') { 842 860 if ($webvar{allocfrom} ne '-') { 843 861 $sql = "select * from freeblocks where maskbits<=$webvar{maskbits} and routed='n'". … … 853 871 ##fixme 854 872 # This section needs serious Pondering. 855 if ($webvar{alloctype} =~ /^.[pd]$/) { 873 # Pools of all types get assigned to the POP they're "routed from" 874 # This includes WAN blocks and other netblock "containers" 875 if ($webvar{alloctype} =~ /^.[pdc]$/) { 856 876 if (($webvar{city} !~ /^(Sudbury|North Bay)$/) && ($webvar{alloctype} eq 'dp')) { 857 877 printError("You must chose Sudbury or North Bay for DSL pools."); … … 870 890 if ($webvar{allocfrom} ne '-') { 871 891 $sql = "select cidr from freeblocks where city='$city' and maskbits<=$webvar{maskbits}". 872 " and cidr <<= '$webvar{allocfrom}' and routed='y' order by cidr,maskbits desc"; 892 " and cidr <<= '$webvar{allocfrom}' and routed='". 893 (($webvar{alloctype} =~ /^(.)r$/) ? "$1" : 'y')."' order by maskbits desc,cidr"; 873 894 } else { 874 895 $sql = "select cidr from freeblocks where city='$city' and maskbits<=$webvar{maskbits}". 875 " and routed='y' order by cidr,maskbits desc"; 896 " and routed='".(($webvar{alloctype} =~ /^(.)r$/) ? "$1" : 'y'). 897 "' order by maskbits desc,cidr"; 876 898 } 877 899 } … … 955 977 } else { 956 978 print qq(<div class="center"><div class="heading">The block $webvar{fullcidr} was ). 957 "sucessfully added as type '$webvar{alloctype}' ". 958 "($disp_alloctypes{$webvar{alloctype}})</div></div>"; 979 "sucessfully added as: $disp_alloctypes{$webvar{alloctype}}</div></div>"; 959 980 } 960 981 syslog "notice", "$authuser allocated '$webvar{fullcidr}' to '$webvar{custid}' as ". … … 963 984 syslog "err", "Allocation of '$webvar{fullcidr}' to '$webvar{custid}' as ". 964 985 "'$webvar{alloctype}' by $authuser failed: '$msg'"; 965 printError("Allocation of $webvar{fullcidr} as $disp_alloctypes{$webvar{alloctype}}".986 printError("Allocation of $webvar{fullcidr} as '$disp_alloctypes{$webvar{alloctype}}'". 966 987 " failed:<br>\n$msg\n"); 967 988 } … … 1023 1044 # Check POP location 1024 1045 my $flag; 1025 if ($webvar{alloctype} eq 'r r') {1046 if ($webvar{alloctype} eq 'rm') { 1026 1047 $flag = 'for a routed netblock'; 1027 1048 foreach (@poplist) { … … 1095 1116 # this has now been Requested, so here goes. 1096 1117 1097 if ($data[2] =~ /^d[nyc]|cn|ee|in$/) { 1118 ##fixme The check here should be built from the database 1119 if ($data[2] =~ /^.[ne]$/) { 1098 1120 # Block that can be changed 1099 1121 my $blockoptions = "<select name=alloctype><option". 1100 (($data[2] eq 'dn') ? ' selected' : '') ." value='dn'>Dialup netblock</option>\n<option". 1101 (($data[2] eq 'dy') ? ' selected' : '') ." value='dy'>Dynamic DSL netblock</option>\n<option". 1102 (($data[2] eq 'dc') ? ' selected' : '') ." value='dc'>Dynamic cable netblock</option>\n<option". 1122 (($data[2] eq 'me') ? ' selected' : '') ." value='me'>Dialup netblock</option>\n<option". 1123 (($data[2] eq 'de') ? ' selected' : '') ." value='de'>Dynamic DSL netblock</option>\n<option". (($data[2] eq 'dc') ? ' selected' : '') ." value='dc'>Dynamic cable netblock</option>\n<option". 1124 (($data[2] eq 'ce') ? ' selected' : '') ." value='ce'>Dynamic cable netblock</option>\n<option". (($data[2] eq 'dc') ? ' selected' : '') ." value='dc'>Dynamic cable netblock</option>\n<option". 1125 (($data[2] eq 'we') ? ' selected' : '') ." value='we'>Dynamic wireless netblock</option>\n<option". (($data[2] eq 'dc') ? ' selected' : '') ." value='dc'>Dynamic cable netblock</option>\n<option". 1103 1126 (($data[2] eq 'cn') ? ' selected' : '') ." value='cn'>Customer netblock</option>\n<option". 1104 (($data[2] eq 'e e') ? ' selected' : '') ." value='ee'>End-use netblock</option>\n<option".1127 (($data[2] eq 'en') ? ' selected' : '') ." value='en'>End-use netblock</option>\n<option". 1105 1128 (($data[2] eq 'in') ? ' selected' : '') ." value='in'>Internal netblock</option>\n". 1106 1129 "</select>\n"; … … 1199 1222 my ($cidr, $custid, $type, $city, $circid, $desc, $notes, $alloctype); 1200 1223 1201 if ($webvar{alloctype} eq 'r r') {1224 if ($webvar{alloctype} eq 'rm') { 1202 1225 $sth = $ip_dbh->prepare("select cidr,city from routed where cidr='$webvar{block}'"); 1203 1226 $sth->execute(); … … 1223 1246 $desc = "N/A"; 1224 1247 $notes = "N/A"; 1225 } elsif ($webvar{alloctype} =~ /^.i$/) { # done with alloctype= rr1248 } elsif ($webvar{alloctype} =~ /^.i$/) { # done with alloctype=[rm]m 1226 1249 1227 1250 # Unassigning a static IP -
branches/stable/fb-assign.html
r98 r192 13 13 <tr class="color1"> 14 14 <td>Allocation type:</td><td> 15 <select name="alloctype">16 15 $$TYPELIST$$ 17 </select>18 16 <input type="button" value=" ? " onclick="helpAllocTypes()" class="regular"> 19 17 </td>
Note:
See TracChangeset
for help on using the changeset viewer.