Changeset 442 for trunk/cgi-bin/main.cgi


Ignore:
Timestamp:
07/21/10 16:08:10 (14 years ago)
Author:
Kris Deugau
Message:

/trunk

Remove some ViaNet-isms (reference to city names with primary POPs).
See #26.
Update alloctypes.html to reflect current preseeded alloctypes

File:
1 edited

Legend:

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

    r435 r442  
    685685  if ($webvar{alloctype} =~ /^.i$/) {
    686686    my ($base,undef) = split //, $webvar{alloctype};    # split into individual chars
    687     my ($sql,$city);
    688     # Check for pools in Subury, North Bay, or Toronto if DSL or server pool.
    689     # Anywhere else is invalid and shouldn't be in the db in the first place.
    690     # ... aside from #^%#$%#@#^%^^!!!! legacy data.  GRRR.
    691     # Note that we want to retain the requested city to relate to customer info.
    692     if ($base =~ /^[ds]$/) {
    693       $city = "(allocations.city='Sudbury' or allocations.city='North Bay' or ".
    694         "allocations.city='Toronto')";
    695     } else {
    696       $city = "allocations.city='$webvar{pop}'";
    697     }
    698687
    699688# Ewww.  But it works.
    700689    $sth = $ip_dbh->prepare("SELECT (SELECT city FROM allocations WHERE cidr=poolips.pool), ".
    701690        "poolips.pool, COUNT(*) FROM poolips,allocations WHERE poolips.available='y' AND ".
    702         "poolips.pool=allocations.cidr AND $city AND poolips.type LIKE '".$base."_' ".
     691        "poolips.pool=allocations.cidr AND allocations.city='$webvar{pop}' AND poolips.type LIKE '".$base."_' ".
    703692        "GROUP BY pool");
    704693    $sth->execute;
     
    754743        # This does NOT include cable pools.
    755744        if ($webvar{alloctype} =~ /^.[pc]$/) {
    756           if (($webvar{city} !~ /^(Sudbury|North Bay|Toronto)$/) && ($webvar{alloctype} eq 'dp')) {
    757             printError("You must chose Sudbury, North Bay, or Toronto for DSL pools.");
    758             return;
    759           }
    760745          $city = $webvar{city};
    761746          $failmsg = "No suitable free block found.<br>\nYou will have to route another".
    762             " superblock from one of the<br>\nmaster blocks in Sudbury or chose a smaller".
     747            " superblock from one of the<br>\nmaster blocks or chose a smaller".
    763748            " block size for the pool.";
    764749        } else {
    765750          $city = $webvar{pop};
    766751          $failmsg = "No suitable free block found.<br>\nYou will have to route another".
    767             " superblock to $webvar{pop}<br>\nfrom one of the master blocks in Sudbury or".
     752            " superblock to $webvar{pop}<br>\nfrom one of the master blocks or".
    768753            " chose a smaller blocksize.";
    769754        }
     
    986971  } else {
    987972    $flag = 'n';
    988     if ($webvar{alloctype} =~ /[wp][cr]|[ds][pi]/) {
    989       # Set this forcibly rather than messing around elsewhere.  Yes, this *is* a hack.  PTHBTT!!
    990       $webvar{pop} = 'Sudbury';
    991     }
     973##fixme:  hook to force-set POP or city on certain alloctypes
     974# if ($webvar{alloctype =~ /foo,bar,bz/ { $webvar{pop} = 'blah'; }
    992975    if ($webvar{pop} =~ /^-$/) {
    993976      $flag = 'to route the block from/through';
Note: See TracChangeset for help on using the changeset viewer.