Changeset 315 for branches/stable/cgi-bin/main.cgi
- Timestamp:
- 03/31/06 13:48:28 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/cgi-bin/main.cgi
r296 r315 754 754 " chose a smaller blocksize."; 755 755 } 756 if ( $webvar{allocfrom} ne '-') {756 if (defined $webvar{allocfrom} && $webvar{allocfrom} ne '-') { 757 757 $sql = "select cidr from freeblocks where city='$city' and maskbits<=$webvar{maskbits}". 758 758 " and cidr <<= '$webvar{allocfrom}' and routed='". … … 827 827 $i++; 828 828 } 829 # We're going to abuse $$PRIVDATA$$ to stuff in some stuff for billing. 830 $privdata .= "<input type=hidden name=billinguser value=$webvar{userid}>\n" 831 if $webvar{userid}; 829 832 $html =~ s/\$\$PRIVDATA\$\$/$privdata/g; 830 833 … … 858 861 if ($code eq 'OK') { 859 862 if ($webvar{alloctype} =~ /^.i$/) { 860 print qq(<div class="center"><div class="heading">The IP $msg has been allocated to customer $webvar{custid}</div></div>); 863 $msg =~ s|/32||; 864 print qq(<div class="center"><div class="heading">The IP $msg has been allocated to customer $webvar{custid}</div>). 865 ( ($webvar{alloctype} eq 'di' && $webvar{billinguser}) ? 866 qq(<div><a href="https://billing.example.com/extserv.pl?). 867 "action=new_radius_user&custid=$webvar{custid}&userid=$webvar{billinguser}". 868 qq(&ipdb=1&ip=$msg">Add this IP to RADIUS user table</a></div>) 869 : "</div>"); 861 870 # Notify tech@example.com 862 871 mailNotify('tech@example.com',"ADDED: $disp_alloctypes{$webvar{alloctype}} allocation", … … 864 873 "Description: $webvar{desc}\n\nAllocated by: $authuser\n"); 865 874 } else { 875 my $netblock = new NetAddr::IP $webvar{fullcidr}; 866 876 print qq(<div class="center"><div class="heading">The block $webvar{fullcidr} was ). 867 "sucessfully added as: $disp_alloctypes{$webvar{alloctype}}</div></div>"; 877 "sucessfully added as: $disp_alloctypes{$webvar{alloctype}}</div>". 878 ( ($webvar{alloctype} eq 'pr' && $webvar{billinguser}) ? 879 qq(<div><a href="https://billing.example.com/extserv.pl?). 880 "action=new_radius_user&custid=$webvar{custid}&userid=$webvar{billinguser}". 881 "&route_subnet=".$netblock->addr."&subnet_slash=".$netblock->masklen. 882 "&include_routed_subnet=1&ipdb=1". 883 qq(">Add this netblock to RADIUS user table</a></div>) 884 : "</div>"); 868 885 } 869 886 syslog "notice", "$authuser allocated '$webvar{fullcidr}' to '$webvar{custid}' as ". … … 942 959 } else { 943 960 $flag = 'n'; 944 if ($webvar{alloctype} =~ /w./) { 945 $webvar{pop} = "Sudbury"; 946 } elsif ($webvar{pop} =~ /^-$/) { 961 if ($webvar{alloctype} =~ /[wp][cr]|[ds][pi]/) { 962 # Set this forcibly rather than messing around elsewhere. Yes, this *is* a hack. PTHBTT!! 963 $webvar{pop} = 'Sudbury'; 964 } 965 if ($webvar{pop} =~ /^-$/) { 947 966 $flag = 'to route the block from/through'; 948 967 }
Note:
See TracChangeset
for help on using the changeset viewer.