Changeset 504 for branches/htmlform


Ignore:
Timestamp:
09/27/11 13:01:55 (13 years ago)
Author:
Kris Deugau
Message:

/branches/htmlform

Convert all but one remaining call to printError to use the
designated error space in the relevant templates
Also make sure to actually generate an error on a missing POP
for new allocations
See #15.

File:
1 edited

Legend:

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

    r503 r504  
    701701            " block size for the pool.";
    702702        } else {
     703          if (!$webvar{pop}) {
     704            $page->param(err => 'Please select a POP to route the block from/through.');
     705            return;
     706          }
    703707          $city = $webvar{pop};
    704708          $failmsg = "No suitable free block found.<br>\nYou will have to route another".
     
    845849sub validateInput {
    846850  if ($webvar{city} eq '-') {
    847     printError("Please choose a city.");
     851    $page->param(err => 'Please choose a city');
    848852    return;
    849853  }
     
    854858    # Danger! Danger!  alloctype should ALWAYS be set by a dropdown.  Anyone
    855859    # managing to call things in such a way as to cause this deserves a cryptic error.
    856     printError("Invalid alloctype");
     860    $page->param(err => 'Invalid alloctype');
    857861    return;
    858862  }
     
    862866  if ($def_custids{$webvar{alloctype}} eq '') {
    863867    if (!$webvar{custid}) {
    864       printError("Please enter a customer ID.");
     868      $page->param(err => 'Please enter a customer ID.');
    865869      return;
    866870    }
     
    871875      my $status = CustIDCK->custid_exist($webvar{custid});
    872876      if ($CustIDCK::Error) {
    873         printError("Error verifying customer ID: ".$CustIDCK::ErrMsg);
     877        $page->param(err => "Error verifying customer ID: ".$CustIDCK::ErrMsg);
    874878        return;
    875879      }
    876880      if (!$status) {
    877         printError("Customer ID not valid.  Make sure the Customer ID ".
     881        $page->param(err => "Customer ID not valid.  Make sure the Customer ID ".
    878882          "is correct.<br>\nUse STAFF for staff static IPs, and $IPDB::defcustid for any other ".
    879883          "non-customer assignments.");
     
    907911    }
    908912  }
     913
     914  # if the alloctype has a restricted city/POP list as determined above,
     915  # and the reqested city/POP does not match that list, complain
    909916  if ($flag ne 'n') {
    910     printError("Please choose a valid POP location $flag.  Valid ".
     917    $page->param(err => "Please choose a valid POP location $flag.  Valid ".
    911918        "POP locations are currently:<br>\n".join (" - ", @poplist));
    912919    return;
     
    11411148  # Serves'em right for getting here...
    11421149  if (!defined($webvar{block})) {
    1143     printError("Error 332");
     1150    $page->param(err => "Can't delete a block that doesn't exist");
    11441151    return;
    11451152  }
Note: See TracChangeset for help on using the changeset viewer.