Changeset 87 for trunk/cgi-bin


Ignore:
Timestamp:
11/26/04 17:28:19 (20 years ago)
Author:
Kris Deugau
Message:

/trunk

Port bugfixes and tweaks from /branches/stable r79:86 forward.

File:
1 edited

Legend:

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

    r74 r87  
    828828my $city;       # Shut up Perl's "strict" scoping/usage check.
    829829      $sql = "select * from poolips where available='y' and".
    830         " ptype='$base' and city='$webvar{city}'";
     830        " ptype='$base' and city='$webvar{pop}'";
    831831    }
    832832
     
    839839      $ipcount{$data[0]}++;
    840840    }
     841    $sth = $ip_dbh->prepare("select city from allocations where cidr=?");
    841842    foreach my $key (keys %ipcount) {
    842       $optionlist .= "<option value='$key'>$key [$ipcount{$key} free IP(s)]</option>\n";
     843      $sth->execute($key);
     844      my @data = $sth->fetchrow_array;
     845      $optionlist .= "<option value='$key'>$key [$ipcount{$key} free IP(s)] in $data[0]</option>\n";
    843846    }
    844847    $cidr = "Single static IP";
     
    931934  $html =~ s|\$\$ALLOC_FROM\$\$|$alloc_from|g;
    932935  $html =~ s|\$\$CIDR\$\$|$cidr|g;
     936  $webvar{city} = desanitize($webvar{city});
    933937  $html =~ s|\$\$CITY\$\$|$webvar{city}|g;
    934938  $html =~ s|\$\$CUSTID\$\$|$webvar{custid}|g;
     939  $webvar{circid} = desanitize($webvar{circid});
    935940  $html =~ s|\$\$CIRCID\$\$|$webvar{circid}|g;
    936941  $webvar{desc} = desanitize($webvar{desc});
     
    11561161      printAndExit("Please enter a customer ID.");
    11571162    }
    1158     if ($webvar{custid} !~ /^(?:\d{10}|\d{7}|STAFF)(?:-\d\d?)?$/) {
     1163    if ($webvar{custid} !~ /^(?:\d{10}|\d{7}|STAFF|TEMP)(?:-\d\d?)?$/) {
    11591164      printAndExit("Please enter a valid customer ID- this must be a 7- or 10-digit number, or STAFF for static IPs for staff.");
    11601165    }
Note: See TracChangeset for help on using the changeset viewer.