Changeset 328 for trunk


Ignore:
Timestamp:
04/07/06 13:34:55 (18 years ago)
Author:
Kris Deugau
Message:

/trunk

Tighten 'rules' for exporting customer data. Only types that
have a blank default CustID in the alloctypes table are supposed
to be allocated direct to customers, so only those types should
have any *need* to have customer data associated with them.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/cgi-bin/extras/db2rwhois.pl

    r327 r328  
    2929my @masterblocks;
    3030my %netnameprefix;
     31my %def_custids;
    3132
    3233# Fill in data about our master blocks as allocated from ARIN
     
    8586while (my @data = $sth->fetchrow_array) {
    8687  $netnameprefix{$data[0]} = $data[2];
     88  $def_custids{$data[0]} = $data[1];
    8789}
    8890
     
    166168      my $netname = $netnameprefix{$type};
    167169
    168       if ($swip eq 'n') {
    169         print MASTERFILE "---\nID: NETBLK-ISP.$master\n".
    170                 "Auth-Area: $master\n".
    171                 "Network-Name: $netname-".$net->network."\n".
    172                 "IP-Network: $net\n".
    173                 "IP-Network-Block: ".$net->range."\n".
    174                 "Org-Name: Friendly ISP\n".
    175                 "Street-Address: 123 4th Street\n".
    176                 "City: Anytown\n".
    177                 "StateProv: Ontario\n".
    178                 "Postal-Code: H0H 0H0\n".
    179                 "Country-Code: CA\n".
    180                 "Tech-Contact: ISP-ARIN-HANDLE\n".
    181                 "Created: $ctime\n".
    182                 "Updated: $mtime\n".
    183                 "Updated-By: noc\@example.com\n";
    184       } else {
     170      if ($swip eq 'y' && $def_custids{$type} eq '') {
     171        # def_custids{$type} should only be blank on types that are
     172        # allocated direct to customers.  i are sMart!!11!!oneone!
    185173        $custsth->execute($custid);
    186174        my ($name, $street, $city, $prov, $country, $pocode, $phone, $tech, $special) = $custsth->fetchrow_array;
     
    206194                "Updated: $mtime\n".
    207195                "Updated-By: noc\@example.com\n";
    208       } # swip
    209 
     196      } else {
     197        print MASTERFILE "---\nID: NETBLK-ISP.$master\n".
     198                "Auth-Area: $master\n".
     199                "Network-Name: $netname-".$net->network."\n".
     200                "IP-Network: $net\n".
     201                "IP-Network-Block: ".$net->range."\n".
     202                "Org-Name: Friendly ISP\n".
     203                "Street-Address: 123 4th Street\n".
     204                "City: Anytown\n".
     205                "StateProv: Ontario\n".
     206                "Postal-Code: H0H 0H0\n".
     207                "Country-Code: CA\n".
     208                "Tech-Contact: ISP-ARIN-HANDLE\n".
     209                "Created: $ctime\n".
     210                "Updated: $mtime\n".
     211                "Updated-By: noc\@example.com\n";
     212      } # decide which contact data to use (cust data only on swip==y && def custid=='')
    210213    } # net in master
    211214  } # foreach master
Note: See TracChangeset for help on using the changeset viewer.