Changeset 244


Ignore:
Timestamp:
04/27/05 17:27:22 (20 years ago)
Author:
Kris Deugau
Message:

/branches/stable

Semi-temporary change to allow SWIPing of existing netblocks.
SWIP process to be replaced with RWHOIS as soon as that can
be considered to be operating "correctly".

Location:
branches/stable
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/cgi-bin/main.cgi

    r242 r244  
    606606        qq($master ($data[0]):</div></center><br>\n);
    607607
    608   startTable('CIDR allocation','Customer Location','Type','CustID','Description/Name');
     608  startTable('CIDR allocation','Customer Location','Type','CustID','SWIPed?','Description/Name');
    609609
    610610  # Snag the allocations for this block
    611   $sth = $ip_dbh->prepare("select cidr,city,type,custid,description".
     611  $sth = $ip_dbh->prepare("select cidr,city,type,custid,swip,description".
    612612        " from allocations where cidr <<= '$master' order by cidr");
    613613  $sth->execute();
     
    615615  my $count=0;
    616616  while (my @data = $sth->fetchrow_array()) {
    617     # cidr,city,type,custid,description, as per the SELECT
     617    # cidr,city,type,custid,swip,description, as per the SELECT
    618618    my $cidr = new NetAddr::IP $data[0];
    619619
     
    624624    my @row = ( (($data[2] =~ /^.r$/) ? 'Sub ' : '').
    625625        qq(<a href="/ip/cgi-bin/main.cgi?action=edit&block=$data[0]">$data[0]</a>),
    626         $data[1], $disp_alloctypes{$data[2]}, $data[3], $data[4]);
     626        $data[1], $disp_alloctypes{$data[2]}, $data[3],
     627        ($data[4] eq 'y' ? 'Yes' : 'No'), $data[5]);
    627628    # If the allocation is a pool, allow listing of the IPs in the pool.
    628629    if ($data[2] =~ /^.[pd]$/) {
     
    11141115    $sql = "select ip,custid,type,city,circuitid,description,notes from poolips where ip='$webvar{block}'";
    11151116  } else {
    1116     $sql = "select cidr,custid,type,city,circuitid,description,notes from allocations where cidr='$webvar{block}'"
     1117    $sql = "select cidr,custid,type,city,circuitid,description,notes,swip from allocations where cidr='$webvar{block}'"
    11171118  }
    11181119
     
    11741175  }
    11751176
     1177## Hack time!  SWIP isn't going to stay, so I'm not going to integrate it with ACLs.
     1178if ($data[2] =~ /.i/) {
     1179  $html =~ s/\$\$SWIP\$\$/N\/A/;
     1180} else {
     1181  my $tmp = (($data[7] eq 'n') ? '<input type=checkbox name=swip>' :
     1182        '<input type=checkbox name=swip checked=yes>');
     1183  $html =~ s/\$\$SWIP\$\$/$tmp/;
     1184}
     1185
    11761186  # More ACL trickery - we can live with forms that don't submit,
    11771187  # but we can't leave the extra table rows there, and we *really*
     
    12221232      $sql = "update allocations set custid='$webvar{custid}',".
    12231233        "description='$webvar{desc}',notes='$webvar{notes}',city='$webvar{city}',".
    1224         "type='$webvar{alloctype}',circuitid='$webvar{circid}' where cidr='$webvar{block}'";
     1234        "type='$webvar{alloctype}',circuitid='$webvar{circid}',".
     1235        "swip='".($webvar{swip} eq 'on' ? 'y' : 'n')."' ".
     1236        " where cidr='$webvar{block}'";
    12251237    }
    12261238    # Log the details of the change.
     
    12451257  my $html = join('', <HTML>);
    12461258
     1259my $swiptmp = ($webvar{swip} eq 'on' ? 'Yes' : 'No');
    12471260  $html =~ s/\$\$BLOCK\$\$/$webvar{block}/g;
    12481261  $webvar{city} = desanitize($webvar{city});
     
    12511264  $html =~ s/\$\$TYPEFULL\$\$/$disp_alloctypes{$webvar{alloctype}}/g;
    12521265  $html =~ s/\$\$CUSTID\$\$/$webvar{custid}/g;
     1266  $html =~ s/\$\$SWIP\$\$/$swiptmp/g;
    12531267  $webvar{circid} = desanitize($webvar{circid});
    12541268  $html =~ s/\$\$CIRCID\$\$/$webvar{circid}/g;
  • branches/stable/editDisplay.html

    r242 r244  
    1414<tr class="color2"><td class=heading>CustID:</td><td class="regular">$$CUSTID$$</td></tr>
    1515
     16<tr class="color2"><td class=heading>SWIPed?:</td><td class=regular>$$SWIP$$</td></tr>
     17
    1618<tr class="color1"><td class="heading">Circuit ID:</td><td class="regular">$$CIRCID$$</td></tr>
    1719
  • branches/stable/updated.html

    r75 r244  
    66<tr class="color1"><td>Type:</td><td>$$TYPEFULL$$</td></tr>
    77<tr class="color2"><td>Customer ID:</td><td>$$CUSTID$$</td></tr>
     8<tr class="color2"><td>SWIPed?:</td><td>$$SWIP$$</td></tr>
    89<tr class="color1"><td>Circuit ID:</td><td>$$CIRCID$$</td></tr>
    910<tr class="color2"><td valign="top">Description/Name:</td><td>$$DESC$$</td></tr>
Note: See TracChangeset for help on using the changeset viewer.