Ignore:
Timestamp:
11/07/12 17:45:28 (12 years ago)
Author:
Kris Deugau
Message:

/trunk

Tweak custid check in both main.cgi and admin.cgi; move the
general hardcoded checks into CustIDCK.pm.

File:
1 edited

Legend:

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

    r545 r546  
    123123  my $custid = $def_custids{$webvar{alloctype}};
    124124  if ($custid eq '') {
    125     if ($webvar{custid} !~ /^(?:\d{10}|\d{7}|STAFF)(?:-\d\d?)?$/) {
    126       # Force uppercase for now...
    127       $webvar{custid} =~ tr/a-z/A-Z/;
    128       # Crosscheck with billing.
    129       my $status = CustIDCK->custid_exist($webvar{custid});
    130       if ($CustIDCK::Error) {
    131         $page->param(errmsg => "Error verifying customer ID: ".$CustIDCK::ErrMsg);
    132         goto ERRJUMP;
    133       }
    134       if (!$status) {
    135         $page->param(errmsg => "Customer ID not valid.  Make sure the Customer ID ".
    136           "is correct.<br>\nUse STAFF for staff static IPs, and $IPDB::defcustid for any other ".
    137           "non-customer assignments.");
    138         goto ERRJUMP;
    139       }
     125    # Crosscheck with billing.
     126    my $status = CustIDCK->custid_exist($webvar{custid});
     127    if ($CustIDCK::Error) {
     128      $page->param(errmsg => "Error verifying customer ID: ".$CustIDCK::ErrMsg);
     129      goto ERRJUMP;
     130    }
     131    if (!$status) {
     132      $page->param(errmsg => "Customer ID not valid.  Make sure the Customer ID ".
     133        "is correct.<br>\nUse STAFF for staff static IPs, and $IPDB::defcustid for any other ".
     134        "non-customer assignments.");
     135      goto ERRJUMP;
    140136    }
    141137    # Type that doesn't have a default custid
Note: See TracChangeset for help on using the changeset viewer.