Changeset 380


Ignore:
Timestamp:
01/22/08 16:11:01 (16 years ago)
Author:
Kris Deugau
Message:

/trunk

Merge bugfixes/updates from /branches/stable r317 through r379

Location:
trunk
Files:
5 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/cgi-bin/extras/db2rwhois.pl

    r371 r380  
    4141my @masterblocks;
    4242my %netnameprefix;
    43 my %def_custids;
    4443
    4544# Get the list of live directories for potential deletion
     
    282281        "IP-Network: $net\n".
    283282        "IP-Network-Block: ".$net->range."\n".
    284         "Org-Name: $name\n".
    285         "Street-Address: $street\n".
    286         "City: $city\n".
    287         "StateProv: $prov\n".
    288         "Postal-Code: $pocode\n".
    289         "Country-Code: $country\n".
    290         "Tech-Contact: $tech\n".
     283        "Org-Name: ".($name ? $name : 'Friendly ISP')."\n".
     284        "Street-Address: ".($street ? $street : '123 4th Street')."\n".
     285        "City: ".($city ? $city : 'Anytown')."\n".
     286        "StateProv: ".($prov ? $prov : 'Ontario')."\n".
     287        "Postal-Code: ".($pocode ? $pocode : 'H0H 0H0')."\n".
     288        "Country-Code: ".($country ? $country : 'CA')."\n".
     289        "Tech-Contact: ".($tech ? $tech : 'ISP-ARIN-HANDLE')."\n".
    291290        "Created: $ctime\n".
    292291        "Updated: $mtime\n".
  • trunk/cgi-bin/ipdb.psql

    r371 r380  
    158158fc      Reserve for fibre       Fibre blocks    203     6750400 ISP
    159159wr      CORE/WAN block  CORE/WAN block  220     6750400 ISP
    160 pr      Dynamic-route DSL netblock      Dynamic-route DSL       221             ISP
     160pr      Dynamic-route DSL netblock (cust)       Dynamic-route DSL (cust)        221             ISPCUST
    161161ar      ATM block       ATM block       222             ISP
    162162fr      Fibre   Fibre   223     ATM-BUS ISP
  • trunk/cgi-bin/main.cgi

    r371 r380  
    400400  $sth->execute();
    401401
     402  # hack hack hack
     403  # set up to flag swip=y records if they don't actually have supporting data in the customers table
     404  my $custsth = $ip_dbh->prepare("select count(*) from customers where custid=?");
     405
    402406  my $count=0;
    403407  while (my @data = $sth->fetchrow_array()) {
     
    408412#    $data[2] =~ s/\s+//g;
    409413
     414    $custsth->execute($data[3]);
     415    my ($ncust) = $custsth->fetchrow_array();
     416
    410417    # Prefix subblocks with "Sub "
    411418    my @row = ( (($data[2] =~ /^.r$/) ? 'Sub ' : '').
    412419        qq(<a href="/ip/cgi-bin/main.cgi?action=edit&block=$data[0]">$data[0]</a>),
    413420        $data[1], $disp_alloctypes{$data[2]}, $data[3],
    414         ($data[4] eq 'y' ? 'Yes' : 'No'), $data[5]);
     421        ($data[4] eq 'y' ? ($ncust == 0 ? 'Yes<small>*</small>' : 'Yes') : 'No'), $data[5]);
    415422    # If the allocation is a pool, allow listing of the IPs in the pool.
    416423    if ($data[2] =~ /^.[pd]$/) {
     
    841848      print qq(<div class="center"><div class="heading">The IP $msg has been allocated to customer $webvar{custid}</div>).
    842849        ( ($webvar{alloctype} eq 'di' && $webvar{billinguser}) ?
    843                 qq(<div><a href="https://billing.example.com/extserv.pl?).
     850                qq(<div><a href="https://billing.example.com/radius.pl?).
    844851                "action=new_radius_user&custid=$webvar{custid}&userid=$webvar{billinguser}".
    845852                qq(&ipdb=1&ip=$msg">Add this IP to RADIUS user table</a></div>)
     
    854861        "sucessfully added as: $disp_alloctypes{$webvar{alloctype}}</div>".
    855862        ( ($webvar{alloctype} eq 'pr' && $webvar{billinguser}) ?
    856                 qq(<div><a href="https://billing.example.com/extserv.pl?).
     863                qq(<div><a href="https://billing.example.com/radius.pl?).
    857864                "action=new_radius_user&custid=$webvar{custid}&userid=$webvar{billinguser}".
    858865                "&route_subnet=".$netblock->addr."&subnet_slash=".$netblock->masklen.
     
    11201127  my $html = join('', <HTML>);
    11211128
     1129  # Link back to browse-routed or list-pool page on "Update complete" page.
     1130  my $backlink = "/ip/cgi-bin/main.cgi?action=";
     1131  my $cblock;   # to contain the CIDR of the container block we're retrieving.
     1132  my $sql;
     1133  if (my $pooltype = ($webvar{alloctype} =~ /^(.)i$/) ) {
     1134    $sql = "select pool from poolips where ip='$webvar{block}'";
     1135    $backlink .= "listpool&pool=";
     1136  } else {
     1137    $sql = "select cidr from routed where cidr >>= '$webvar{block}'";
     1138    $backlink .= "showrouted&block=";
     1139  }
     1140  # I define there to be no errors on this operation...  so we don't need to check for them.
     1141  $sth = $ip_dbh->prepare($sql);
     1142  $sth->execute;
     1143  $sth->bind_columns(\$cblock);
     1144  $sth->fetch();
     1145  $sth->finish;
     1146  $backlink .= $cblock;
     1147
    11221148my $swiptmp = ($webvar{swip} eq 'on' ? 'Yes' : 'No');
    11231149  $html =~ s/\$\$BLOCK\$\$/$webvar{block}/g;
     
    11341160  $webvar{notes} = desanitize($webvar{notes});
    11351161  $html =~ s/\$\$NOTES\$\$/$webvar{notes}/g;
     1162  $html =~ s/\$\$BACKLINK\$\$/$backlink/g;
     1163  $html =~ s/\$\$BACKBLOCK\$\$/$cblock/g;
    11361164
    11371165  if ($IPDBacl{$authuser} =~ /s/) {
  • trunk/header.inc

    r370 r380  
    3434</tbody></table>
    3535
    36 <table width="100%" border="0" cellspacing="0" cellpadding="0"
     36<table width="100%" border="0" cellspacing="0" cellpadding="0">
    3737<tr bgcolor="#000000"><td></td></tr></table>
    3838<!-- end line and top. -->
  • trunk/updated.html

    r320 r380  
    1313</table>
    1414</div>
     15<p>
     16<div name="backlink">
     17<a href="$$BACKLINK$$">Back to $$BACKBLOCK$$</a>
     18</div>
Note: See TracChangeset for help on using the changeset viewer.