Changeset 442 for trunk/cgi-bin
- Timestamp:
- 07/21/10 16:08:10 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cgi-bin/main.cgi
r435 r442 685 685 if ($webvar{alloctype} =~ /^.i$/) { 686 686 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 }698 687 699 688 # Ewww. But it works. 700 689 $sth = $ip_dbh->prepare("SELECT (SELECT city FROM allocations WHERE cidr=poolips.pool), ". 701 690 "poolips.pool, COUNT(*) FROM poolips,allocations WHERE poolips.available='y' AND ". 702 "poolips.pool=allocations.cidr AND $cityAND poolips.type LIKE '".$base."_' ".691 "poolips.pool=allocations.cidr AND allocations.city='$webvar{pop}' AND poolips.type LIKE '".$base."_' ". 703 692 "GROUP BY pool"); 704 693 $sth->execute; … … 754 743 # This does NOT include cable pools. 755 744 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 }760 745 $city = $webvar{city}; 761 746 $failmsg = "No suitable free block found.<br>\nYou will have to route another". 762 " superblock from one of the<br>\nmaster blocks in Sudburyor chose a smaller".747 " superblock from one of the<br>\nmaster blocks or chose a smaller". 763 748 " block size for the pool."; 764 749 } else { 765 750 $city = $webvar{pop}; 766 751 $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 Sudburyor".752 " superblock to $webvar{pop}<br>\nfrom one of the master blocks or". 768 753 " chose a smaller blocksize."; 769 754 } … … 986 971 } else { 987 972 $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'; } 992 975 if ($webvar{pop} =~ /^-$/) { 993 976 $flag = 'to route the block from/through';
Note:
See TracChangeset
for help on using the changeset viewer.