Ignore:
Timestamp:
05/11/10 17:06:26 (14 years ago)
Author:
Kris Deugau
Message:

/trunk

Merge addition of CustIDCK.pm from r56 - proprietary info this contained
was stripped during repo history conversion and it makes a good base for
providing data validation hooks.
Also merge all updates and related additions since.
See #13.

File:
1 edited

Legend:

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

    r398 r400  
    1818use CommonWeb qw(:ALL);
    1919use MyIPDB;
     20use CustIDCK;
    2021#use POSIX qw(ceil);
    2122use NetAddr::IP;
     
    134135  my $custid = $data[0];
    135136  if ($custid eq '') {
     137    if ($webvar{custid} !~ /^(?:\d{10}|\d{7}|STAFF)(?:-\d\d?)?$/) {
     138      # Force uppercase for now...
     139      $webvar{custid} =~ tr/a-z/A-Z/;
     140      # Crosscheck with billing.
     141      my $status = CustIDCK->custid_exist($webvar{custid});
     142      if ($CustIDCK::Error) {
     143        printError("Error verifying customer ID: ".$CustIDCK::ErrMsg);
     144        return;
     145      }
     146      if (!$status) {
     147        printError("Customer ID not valid.  Make sure the Customer ID ".
     148          "is correct.<br>\nUse STAFF for staff static IPs, and 6750400 for any other ".
     149          "non-customer assignments.");
     150        return;
     151      }
     152    }
    136153    # Type that doesn't have a default custid
    137154    $custid = $webvar{custid};
    138155  }
    139 ##fixme Check billing DB here
    140156
    141157  my $cidr = new NetAddr::IP $webvar{cidr};
     
    506522#
    507523
     524print qq(<hr><a href="/ip/">Back</a> to main interface</a>\n);
    508525
    509526printFooter;
Note: See TracChangeset for help on using the changeset viewer.