Changeset 301 for trunk


Ignore:
Timestamp:
11/17/05 11:25:31 (19 years ago)
Author:
Kris Deugau
Message:

/trunk

Make billing backlink for static DSL IPs more readable in code
Add billing backlink for raduser DSL "netblocks"
Open up (testing) check on CustIDs to allow 5 to 10 digits

instead of 7 or 10.

File:
1 edited

Legend:

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

    r300 r301  
    850850      print qq(<div class="center"><div class="heading">The IP $msg has been allocated to customer $webvar{custid}</div>).
    851851        ($webvar{alloctype} eq 'di' ?
    852         qq(<div><a href="https://billing.example.com/extserv.pl?action=new_radius_user&oldcustid=$webvar{custid}&userid=$webvar{billinguser}&ip=$msg">Add this IP to RADIUS user table</a></div>)
     852                qq(<div><a href="https://billing.example.com/extserv.pl?).
     853                "action=new_radius_user&oldcustid=$webvar{custid}&userid=$webvar{billinguser}".
     854                qq(&ip=$msg">Add this IP to RADIUS user table</a></div>)
    853855        : "</div>");
    854856      # Notify tech@example.com
     
    857859#       "Description: $webvar{desc}\n\nAllocated by: $authuser\n");
    858860    } else {
     861      my $netblock = new NetAddr::IP $webvar{fullcidr};
    859862      print qq(<div class="center"><div class="heading">The block $webvar{fullcidr} was ).
    860         "sucessfully added as: $disp_alloctypes{$webvar{alloctype}}</div></div>";
     863        "sucessfully added as: $disp_alloctypes{$webvar{alloctype}}</div>".
     864        ($webvar{alloctype} eq 'pr' ?
     865                qq(<div><a href="https://billing.example.com/extserv.pl?).
     866                "action=new_radius_user&oldcustid=$webvar{custid}&userid=$webvar{billinguser}".
     867                "&route_subnet=".$netblock->addr."&subnet_slash=".$netblock->masklen.
     868                qq(">Add this netblock to RADIUS user table</a></div>)
     869        : "</div>");
    861870    }
    862871    syslog "notice", "$authuser allocated '$webvar{fullcidr}' to '$webvar{custid}' as ".
     
    897906      return;
    898907    }
    899     if ($webvar{custid} !~ /^(?:\d{10}|\d{7}|STAFF|TEMP)(?:-\d\d?)?$/) {
     908    if ($webvar{custid} !~ /^(?:\d{5,10}|STAFF|TEMP)(?:-\d\d?)?$/) {
    900909      printError("Please enter a valid customer ID- this must be a 7- or 10-digit number, or STAFF for static IPs for staff.");
    901910      return;
Note: See TracChangeset for help on using the changeset viewer.