- Timestamp:
- 12/02/04 15:48:33 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/cgi-bin/main.cgi
r91 r97 371 371 # Fix up types from pools (which are single-char) 372 372 # Fixing the database would be... painful. :( 373 if ($data[2] =~ /^[ sdcmw]$/) {373 if ($data[2] =~ /^[cdsmw]$/) { 374 374 $data[2] .= 'i'; 375 375 } … … 377 377 $data[1], $full_alloc_types{$data[2]}, $data[3], $data[4]); 378 378 # Allow listing of pool if desired/required. 379 if ($data[2] =~ /^[ sdcmw]p$/) {379 if ($data[2] =~ /^[cdsmw]p$/) { 380 380 $row[0] .= ' <a href="/ip/cgi-bin/main.cgi?action=listpool'. 381 381 "&pool=$data[0]\">List IPs</a>"; … … 666 666 $data[3], $full_alloc_types{$data[2]}, $data[1], $data[4]); 667 667 # If the allocation is a pool, allow listing of the IPs in the pool. 668 if ($data[2] =~ /^[ sdcmw]p$/) {668 if ($data[2] =~ /^[cdsmw]p$/) { 669 669 $row[0] .= ' <a href="/ip/cgi-bin/main.cgi?action=listpool'. 670 670 "&pool=$data[0]\">List IPs</a>"; … … 839 839 # + Different flavours of netblock 840 840 841 if ($webvar{alloctype} =~ /^[ scdmw]i$/) {841 if ($webvar{alloctype} =~ /^[cdsmw]i$/) { 842 842 my ($base,undef) = split //, $webvar{alloctype}; # split into individual chars 843 843 my $sql; … … 898 898 " a set of smaller netblocks or a single smaller netblock."; 899 899 } else { 900 if ($webvar{alloctype} =~ /^[ scdmw]p$/) {900 if ($webvar{alloctype} =~ /^[cdsmw]p$/) { 901 901 if (($webvar{city} !~ /^(Sudbury|North Bay)$/) && ($webvar{alloctype} eq 'dp')) { 902 902 printAndExit("You must chose Sudbury or North Bay for DSL pools."); } … … 940 940 $cidr = $subblocks[0]; 941 941 } 942 } # if ($webvar{alloctype} =~ /^[cdsm ]i$/) {942 } # if ($webvar{alloctype} =~ /^[cdsmw]i$/) 943 943 944 944 open HTML, "../confirm.html" … … 995 995 # Same ordering as confirmation page 996 996 997 if ($webvar{alloctype} =~ /^[cdsm ]i$/) {997 if ($webvar{alloctype} =~ /^[cdsmw]i$/) { 998 998 my ($base,$tmp) = split //, $webvar{alloctype}; # split into individual chars 999 999 … … 1146 1146 # special extra handling for pools. 1147 1147 # Note that this must be done for ANY pool allocation! 1148 if ( my ($pooltype) = ($webvar{alloctype} =~ /^([cdsm ])p$/) ) {1148 if ( my ($pooltype) = ($webvar{alloctype} =~ /^([cdsmw])p$/) ) { 1149 1149 # have to insert all pool IPs into poolips table as "unallocated". 1150 1150 $sth = $ip_dbh->prepare("insert into poolips values ('$webvar{fullcidr}',". … … 1201 1201 } 1202 1202 # print "<!-- [ In validateInput(). Insert customer ID cross-check here. ] -->\n"; 1203 } elsif ($webvar{alloctype} =~ /^([ sdcmw]p|si|dn|dy|dc|ee|rr|ii)$/){1203 } elsif ($webvar{alloctype} =~ /^([cdsmw]p|si|dn|dy|dc|ee|rr|ii)$/){ 1204 1204 # All non-customer allocations MUST be entered with "our" customer ID. 1205 1205 # I have Defined this as 6750400 for consistency. … … 1250 1250 1251 1251 # Postfix "i" on pool IP types 1252 if ($data[2] =~ /^[cdsm ]$/) {1252 if ($data[2] =~ /^[cdsmw]$/) { 1253 1253 $data[2] .= "i"; 1254 1254 } … … 1312 1312 # Relatively simple SQL transaction here. 1313 1313 my $sql; 1314 if (my $pooltype = ($webvar{alloctype} =~ /^([cd ms])i$/) ) {1314 if (my $pooltype = ($webvar{alloctype} =~ /^([cdsmw])i$/) ) { 1315 1315 $sql = "update poolips set custid='$webvar{custid}',notes='$webvar{notes}',". 1316 1316 "circuitid='$webvar{circid}',description='$webvar{desc}' ". … … 1399 1399 $desc = "N/A"; 1400 1400 $notes = "N/A"; 1401 } elsif ($webvar{alloctype} =~ /^[ sdcmw]i$/) { # done with alloctype=rr1401 } elsif ($webvar{alloctype} =~ /^[cdsmw]i$/) { # done with alloctype=rr 1402 1402 1403 1403 # Unassigning a static IP … … 1412 1412 $alloctype .="i"; 1413 1413 1414 } else { # done with alloctype=[ sdcmw]i1414 } else { # done with alloctype=[cdsmw]i 1415 1415 1416 1416 my $sth = $ip_dbh->prepare("select cidr,custid,type,city,circuitid,description,notes from ". … … 1437 1437 1438 1438 # Set the warning text. 1439 if ($alloctype =~ /^[ sdcmw]p$/) {1439 if ($alloctype =~ /^[cdsmw]p$/) { 1440 1440 $html =~ s|<!--warn-->|<tr bgcolor="black"><td colspan="2"><div class="red">Warning: clicking confirm will remove this record entirely.<br>Any IPs allocated from this pool will also be removed!</div></td></tr>|; 1441 1441 } else { … … 1459 1459 local $ip_dbh->{RaiseError} = 1; 1460 1460 1461 if ($webvar{alloctype} =~ /^[ sdcmw]i$/) {1461 if ($webvar{alloctype} =~ /^[cdsmw]i$/) { 1462 1462 1463 1463 eval { … … 1482 1482 syslog "notice", "$authuser deallocated static IP $webvar{block}"; 1483 1483 1484 } elsif ($webvar{alloctype} eq 'mm') { # end alloctype = [ sdcmw]i1484 } elsif ($webvar{alloctype} eq 'mm') { # end alloctype = [cdsmw]i 1485 1485 1486 1486 eval { … … 1527 1527 $sth->execute; 1528 1528 # Special case - delete pool IPs 1529 if ($webvar{alloctype} =~ /^[ sdcmw]p$/) {1529 if ($webvar{alloctype} =~ /^[cdsmw]p$/) { 1530 1530 # We have to delete the IPs from the pool listing. 1531 1531 $sth = $ip_dbh->prepare("delete from poolips where pool='$webvar{block}'");
Note:
See TracChangeset
for help on using the changeset viewer.