- Timestamp:
- 07/15/05 16:57:02 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/cgi-bin/main.cgi
r266 r267 889 889 my $city; 890 890 my $failmsg; 891 my $extracond = ''; 892 if ($webvar{allocfrom} eq '-') { 893 $extracond = ($webvar{allowpriv} eq 'on' ? '' : 894 " and not (cidr <<= '192.168.0.0/16'". 895 " or cidr <<= '10.0.0.0/8'". 896 " or cidr <<= '172.16.0.0/12')"); 897 } 898 my $sortorder; 891 899 if ($webvar{alloctype} eq 'rm') { 892 900 if ($webvar{allocfrom} ne '-') { 893 901 $sql = "select * from freeblocks where maskbits<=$webvar{maskbits} and routed='n'". 894 " and cidr <<= '$webvar{allocfrom}' order by maskbits desc"; 902 " and cidr <<= '$webvar{allocfrom}'"; 903 $sortorder = "maskbits desc"; 895 904 } else { 896 $sql = "select * from freeblocks where maskbits<=$webvar{maskbits} and routed='n'". 897 ($webvar{allowpriv} eq 'on' ? '' : 898 " and not (cidr <<= '192.168.0.0/16'". 899 " or cidr <<= '10.0.0.0/8'". 900 " or cidr <<= '172.16.0.0/12')"). 901 " order by maskbits desc"; 905 $sql = "select * from freeblocks where maskbits<=$webvar{maskbits} and routed='n'"; 906 $sortorder = "maskbits desc"; 902 907 } 903 908 $failmsg = "No suitable free block found.<br>\nWe do not have a free". … … 928 933 $sql = "select cidr from freeblocks where city='$city' and maskbits<=$webvar{maskbits}". 929 934 " and cidr <<= '$webvar{allocfrom}' and routed='". 930 (($webvar{alloctype} =~ /^(.)r$/) ? "$1" : 'y')."' order by maskbits desc,cidr"; 935 (($webvar{alloctype} =~ /^(.)r$/) ? "$1" : 'y')."'"; 936 $sortorder = "maskbits desc,cidr"; 931 937 } else { 932 938 $sql = "select cidr from freeblocks where city='$city' and maskbits<=$webvar{maskbits}". 933 " and routed='".(($webvar{alloctype} =~ /^(.)r$/) ? "$1" : 'y'). 934 "' order bymaskbits desc,cidr";939 " and routed='".(($webvar{alloctype} =~ /^(.)r$/) ? "$1" : 'y')."'"; 940 $sortorder = "maskbits desc,cidr"; 935 941 } 936 942 } 943 $sql = $sql.$extracond." order by ".$sortorder; 937 944 $sth = $ip_dbh->prepare($sql); 938 945 $sth->execute;
Note:
See TracChangeset
for help on using the changeset viewer.