Changeset 12 for trunk


Ignore:
Timestamp:
10/25/04 17:29:26 (20 years ago)
Author:
Kris Deugau
Message:

cgi-bin/main.cgi:

  • Added wireless IP and IP pool types
  • Fixed checks that missed some pool types
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/cgi-bin/main.cgi

    r9 r12  
    5050        "si","Server pool IP",
    5151        "mi","Static dialup IP",
     52        "wi","Static wireless IP",
    5253        "cp","Cable pool",
    5354        "dp","DSL pool",
    5455        "sp","Server pool",
    5556        "mp","Static dialup pool",
     57        "wp","Static wireless pool",
    5658        "dn","Dialup netblock",
    5759        "dy","Dynamic DSL netblock",
     
    364366        $data[1], $full_alloc_types{$data[2]}, $data[3], $data[4]);
    365367    # Allow listing of pool if desired/required.
    366     if ($data[2] =~ /^[sdcm]p$/) {
     368    if ($data[2] =~ /^[sdcmw]p$/) {
    367369      $row[0] .= ' &nbsp; <a href="/ip/cgi-bin/main.cgi?action=listpool'.
    368370        "&pool=$data[0]\">List IPs</a>";
     
    653655        $data[3], $full_alloc_types{$data[2]}, $data[1], $data[4]);
    654656    # If the allocation is a pool, allow listing of the IPs in the pool.
    655     if ($data[2] =~ /^[sdc]p$/) {
     657    if ($data[2] =~ /^[sdcmw]p$/) {
    656658      $row[0] .= ' &nbsp; <a href="/ip/cgi-bin/main.cgi?action=listpool'.
    657659        "&pool=$data[0]\">List IPs</a>";
     
    11221124    }
    11231125    print "<!-- [ In validateInput().  Insert customer ID cross-check here. ] -->\n";
    1124   } elsif ($webvar{alloctype} =~ /^([sdc]p|si|dn|dy|dc|ee|rr|ii)$/){
     1126  } elsif ($webvar{alloctype} =~ /^([sdcmw]p|si|dn|dy|dc|ee|rr|ii)$/){
    11251127    # All non-customer allocations MUST be entered with "our" customer ID.
    11261128    # I have Defined this as 6750400 for consistency.
     
    12931295    $desc = "N/A";
    12941296    $notes = "N/A";
    1295   } elsif ($webvar{alloctype} =~ /^[sdcm]i$/) { # done with alloctype=rr
     1297  } elsif ($webvar{alloctype} =~ /^[sdcmw]i$/) { # done with alloctype=rr
    12961298
    12971299    # Unassigning a static IP
     
    13061308    $alloctype .="i";
    13071309
    1308   } else { # done with alloctype=[sdcm]i
     1310  } else { # done with alloctype=[sdcmw]i
    13091311
    13101312    my $sth = $ip_dbh->prepare("select cidr,custid,type,city,description,notes from ".
     
    13301332
    13311333  # Set the warning text.
    1332   if ($alloctype =~ /^[sdcm]p$/) {
     1334  if ($alloctype =~ /^[sdcmw]p$/) {
    13331335    $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>|;
    13341336  } else {
     
    13521354  local $ip_dbh->{RaiseError} = 1;
    13531355
    1354   if ($webvar{alloctype} =~ /^[sdcm]i$/) {
     1356  if ($webvar{alloctype} =~ /^[sdcmw]i$/) {
    13551357
    13561358    eval {
     
    13751377    syslog "notice", "$authuser deallocated static IP $webvar{block}";
    13761378
    1377   } elsif ($webvar{alloctype} eq 'mm') { # end alloctype = [sdcm]i
     1379  } elsif ($webvar{alloctype} eq 'mm') { # end alloctype = [sdcmw]i
    13781380
    13791381    eval {
     
    14191421        $sth = $ip_dbh->prepare("delete from allocations where cidr='$webvar{block}'");
    14201422        $sth->execute;
    1421 
    14221423        # Special case - delete pool IPs
    1423         if ($webvar{alloctype} =~ /^[sdcm]p$/) {
     1424        if ($webvar{alloctype} =~ /^[sdcmw]p$/) {
    14241425          # We have to delete the IPs from the pool listing.
    14251426          $sth = $ip_dbh->prepare("delete * from poolips where pool='$webvar{block}'");
Note: See TracChangeset for help on using the changeset viewer.