Changeset 72
- Timestamp:
- 11/15/04 16:53:24 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cgi-bin/main.cgi
r70 r72 356 356 # Fix up types from pools (which are single-char) 357 357 # Fixing the database would be... painful. :( 358 if ($data[2] =~ /^[ sdcmw]$/) {358 if ($data[2] =~ /^[cdsmw]$/) { 359 359 $data[2] .= 'i'; 360 360 } … … 362 362 $data[1], $full_alloc_types{$data[2]}, $data[3], $data[4]); 363 363 # Allow listing of pool if desired/required. 364 if ($data[2] =~ /^[ sdcmw]p$/) {364 if ($data[2] =~ /^[cdsmw]p$/) { 365 365 $row[0] .= ' <a href="/ip/cgi-bin/main.cgi?action=listpool'. 366 366 "&pool=$data[0]\">List IPs</a>"; … … 651 651 $data[3], $full_alloc_types{$data[2]}, $data[1], $data[4]); 652 652 # If the allocation is a pool, allow listing of the IPs in the pool. 653 if ($data[2] =~ /^[ sdcmw]p$/) {653 if ($data[2] =~ /^[cdsmw]p$/) { 654 654 $row[0] .= ' <a href="/ip/cgi-bin/main.cgi?action=listpool'. 655 655 "&pool=$data[0]\">List IPs</a>"; … … 814 814 # + Different flavours of netblock 815 815 816 if ($webvar{alloctype} =~ /^[ scdmw]i$/) {816 if ($webvar{alloctype} =~ /^[cdsmw]i$/) { 817 817 my ($base,undef) = split //, $webvar{alloctype}; # split into individual chars 818 818 my $sql; … … 870 870 " a set of smaller netblocks or a single smaller netblock."; 871 871 } else { 872 if ($webvar{alloctype} =~ /^[ scdmw]p$/) {872 if ($webvar{alloctype} =~ /^[cdsmw]p$/) { 873 873 if (($webvar{city} !~ /^(Sudbury|North Bay)$/) && ($webvar{alloctype} eq 'dp')) { 874 874 printAndExit("You must chose Sudbury or North Bay for DSL pools."); } … … 912 912 $cidr = $subblocks[0]; 913 913 } 914 } # if ($webvar{alloctype} =~ /^[cdsm ]i$/) {914 } # if ($webvar{alloctype} =~ /^[cdsmw]i$/) 915 915 916 916 open HTML, "../confirm.html" … … 964 964 # Same ordering as confirmation page 965 965 966 if ($webvar{alloctype} =~ /^[ scdmw]i$/) {966 if ($webvar{alloctype} =~ /^[cdsmw]i$/) { 967 967 my ($base,$tmp) = split //, $webvar{alloctype}; # split into individual chars 968 968 … … 1114 1114 # special extra handling for pools. 1115 1115 # Note that this must be done for ANY pool allocation! 1116 if ( my ($pooltype) = ($webvar{alloctype} =~ /^([cdsm ])p$/) ) {1116 if ( my ($pooltype) = ($webvar{alloctype} =~ /^([cdsmw])p$/) ) { 1117 1117 # have to insert all pool IPs into poolips table as "unallocated". 1118 1118 $sth = $ip_dbh->prepare("insert into poolips values ('$webvar{fullcidr}',". … … 1158 1158 } 1159 1159 print "<!-- [ In validateInput(). Insert customer ID cross-check here. ] -->\n"; 1160 } elsif ($webvar{alloctype} =~ /^([ sdcmw]p|si|dn|dy|dc|ee|rr|ii)$/){1160 } elsif ($webvar{alloctype} =~ /^([cdsmw]p|si|dn|dy|dc|ee|rr|ii)$/){ 1161 1161 # All non-customer allocations MUST be entered with "our" customer ID. 1162 1162 # I have Defined this as 6750400 for consistency. … … 1204 1204 1205 1205 # Postfix "i" on pool IP types 1206 if ($data[2] =~ /^[cdsm ]$/) {1206 if ($data[2] =~ /^[cdsmw]$/) { 1207 1207 $data[2] .= "i"; 1208 1208 } … … 1264 1264 # Relatively simple SQL transaction here. 1265 1265 my $sql; 1266 if (my $pooltype = ($webvar{alloctype} =~ /^([cd ms])i$/) ) {1266 if (my $pooltype = ($webvar{alloctype} =~ /^([cdsmw])i$/) ) { 1267 1267 $sql = "update poolips set custid='$webvar{custid}',". 1268 1268 "notes='$webvar{notes}',description='$webvar{desc}' ". … … 1344 1344 $desc = "N/A"; 1345 1345 $notes = "N/A"; 1346 } elsif ($webvar{alloctype} =~ /^[ sdcmw]i$/) { # done with alloctype=rr1346 } elsif ($webvar{alloctype} =~ /^[cdsmw]i$/) { # done with alloctype=rr 1347 1347 1348 1348 # Unassigning a static IP … … 1357 1357 $alloctype .="i"; 1358 1358 1359 } else { # done with alloctype=[ sdcmw]i1359 } else { # done with alloctype=[cdsmw]i 1360 1360 1361 1361 my $sth = $ip_dbh->prepare("select cidr,custid,type,city,description,notes from ". … … 1381 1381 1382 1382 # Set the warning text. 1383 if ($alloctype =~ /^[ sdcmw]p$/) {1383 if ($alloctype =~ /^[cdsmw]p$/) { 1384 1384 $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>|; 1385 1385 } else { … … 1403 1403 local $ip_dbh->{RaiseError} = 1; 1404 1404 1405 if ($webvar{alloctype} =~ /^[ sdcmw]i$/) {1405 if ($webvar{alloctype} =~ /^[cdsmw]i$/) { 1406 1406 1407 1407 eval { … … 1426 1426 syslog "notice", "$authuser deallocated static IP $webvar{block}"; 1427 1427 1428 } elsif ($webvar{alloctype} eq 'mm') { # end alloctype = [ sdcmw]i1428 } elsif ($webvar{alloctype} eq 'mm') { # end alloctype = [cdsmw]i 1429 1429 1430 1430 eval { … … 1471 1471 $sth->execute; 1472 1472 # Special case - delete pool IPs 1473 if ($webvar{alloctype} =~ /^[ sdcmw]p$/) {1473 if ($webvar{alloctype} =~ /^[cdsmw]p$/) { 1474 1474 # We have to delete the IPs from the pool listing. 1475 1475 $sth = $ip_dbh->prepare("delete from poolips where pool='$webvar{block}'");
Note:
See TracChangeset
for help on using the changeset viewer.