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


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/main.cgi

    r541 r546  
    572572      return;
    573573    }
    574     if ($webvar{custid} !~ /^(?:\d{10}|\d{7}|STAFF)(?:-\d\d?)?$/) {
    575       # Force uppercase for now...
    576       $webvar{custid} =~ tr/a-z/A-Z/;
    577       # Crosscheck with billing.
    578       my $status = CustIDCK->custid_exist($webvar{custid});
    579       if ($CustIDCK::Error) {
    580         $page->param(err => "Error verifying customer ID: ".$CustIDCK::ErrMsg);
    581         return;
    582       }
    583       if (!$status) {
    584         $page->param(err => "Customer ID not valid.  Make sure the Customer ID ".
    585           "is correct.<br>\nUse STAFF for staff static IPs, and $IPDB::defcustid for any other ".
    586           "non-customer assignments.");
    587         return;
    588       }
     574    # Crosscheck with billing.
     575    my $status = CustIDCK->custid_exist($webvar{custid});
     576    if ($CustIDCK::Error) {
     577      $page->param(err => "Error verifying customer ID: ".$CustIDCK::ErrMsg);
     578      return;
     579    }
     580    if (!$status) {
     581      $page->param(err => "Customer ID not valid.  Make sure the Customer ID ".
     582        "is correct.<br>\nUse STAFF for staff static IPs, and $IPDB::defcustid for any other ".
     583        "non-customer assignments.");
     584      return;
    589585    }
    590586#    print "<!-- [ In validateInput().  Insert customer ID cross-check here. ] -->\n";
Note: See TracChangeset for help on using the changeset viewer.