Changeset 56


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

/branches/stable

Add support for checking CustIDs against an external agent

  • Uses CustIDCK.pm micro-module
Location:
branches/stable/cgi-bin
Files:
1 added
1 edited

Legend:

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

    r53 r56  
    1515use CommonWeb qw(:ALL);
    1616use IPDB qw(:ALL);
     17use CustIDCK;
    1718use POSIX qw(ceil);
    1819use NetAddr::IP;
     
    11591160    }
    11601161    if ($webvar{custid} !~ /^(?:\d{10}|\d{7}|STAFF)(?:-\d\d?)?$/) {
    1161       printAndExit("Please enter a valid customer ID- this must be a 7- or 10-digit number, or STAFF for static IPs for staff.");
    1162     }
    1163     print "<!-- [ In validateInput().  Insert customer ID cross-check here. ] -->\n";
     1162      # Force uppercase for now...
     1163      $webvar{custid} =~ tr/a-z/A-Z/;
     1164      # Crosscheck with ... er...  something.
     1165      my $status = CustIDCK->custid_exist($webvar{custid});
     1166      printAndExit("Error verifying customer ID: ".$CustIDCK::ErrMsg)
     1167        if $CustIDCK::Error;
     1168      printAndExit("Customer ID not valid.  Make sure the Customer ID ".
     1169        "is correct.<br>\nUse STAFF for staff static IPs, and 6750400 for any other ".
     1170        "non-customer assignments.")
     1171        if !$status;
     1172#"Please enter a valid customer ID- this must be a 7- or 10-digit number, or STAFF for
     1173#static IPs for staff.");
     1174    }
     1175#    print "<!-- [ In validateInput().  Insert customer ID cross-check here. ] -->\n";
    11641176  } elsif ($webvar{alloctype} =~ /^([sdcmw]p|si|dn|dy|dc|ee|rr|ii)$/){
    11651177    # All non-customer allocations MUST be entered with "our" customer ID.
    11661178    # I have Defined this as 6750400 for consistency.
    1167     $webvar{custid} = "6750400";
     1179    # STAFF is also acceptable.
     1180    if ((!$webvar{custid}) || ($webvar{custid} ne 'STAFF')) {
     1181      $webvar{custid} = "6750400";
     1182    }
    11681183    if ($webvar{alloctype} eq 'rr') {
    11691184      if ($webvar{city} !~ /^(?:Huntsville|North Bay|Ottawa|Pembroke|Sault Ste. Marie|Sudbury|Timmins|Thunder Bay|Toronto)$/) {
Note: See TracChangeset for help on using the changeset viewer.