Changeset 189 for trunk/cgi-bin/main.cgi


Ignore:
Timestamp:
03/08/05 17:37:46 (19 years ago)
Author:
Kris Deugau
Message:

/trunk

Caught some buglets in the HairyPerl(TM) ('$1' vs "$1")
Corrected a potentially annoying SQL buglet relating to the

selection of which netblock an allocation is to be taken from;
under certain conditions it would pick a larger block to slice
up while there was still a perfectly usable block just the
right size waiting to be allocated.

Removed display of back-end alloctypes from success/failure notes
Corrected comments referring to alloctypes that have been altered
Updated IPDB "default" schema and alloctypes list with current

base information

File:
1 edited

Legend:

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

    r187 r189  
    890890          $sql = "select cidr from freeblocks where city='$city' and maskbits<=$webvar{maskbits}".
    891891                " and cidr <<= '$webvar{allocfrom}' and routed='".
    892                 (($webvar{alloctype} =~ /^(.)r$/) ? '$1' : 'y')."' order by cidr,maskbits desc";
     892                (($webvar{alloctype} =~ /^(.)r$/) ? "$1" : 'y')."' order by maskbits desc,cidr";
    893893        } else {
    894894          $sql = "select cidr from freeblocks where city='$city' and maskbits<=$webvar{maskbits}".
    895                 " and routed='".(($webvar{alloctype} =~ /^(.)r$/) ? '$1' : 'y').
    896                 "' order by cidr,maskbits desc";
     895                " and routed='".(($webvar{alloctype} =~ /^(.)r$/) ? "$1" : 'y').
     896                "' order by maskbits desc,cidr";
    897897        }
    898898      }
     
    976976    } else {
    977977      print qq(<div class="center"><div class="heading">The block $webvar{fullcidr} was ).
    978         "sucessfully added as type '$webvar{alloctype}' ".
    979         "($disp_alloctypes{$webvar{alloctype}})</div></div>";
     978        "sucessfully added as: $disp_alloctypes{$webvar{alloctype}}</div></div>";
    980979    }
    981980    syslog "notice", "$authuser allocated '$webvar{fullcidr}' to '$webvar{custid}' as ".
     
    984983    syslog "err", "Allocation of '$webvar{fullcidr}' to '$webvar{custid}' as ".
    985984        "'$webvar{alloctype}' by $authuser failed: '$msg'";
    986     printError("Allocation of $webvar{fullcidr} as $disp_alloctypes{$webvar{alloctype}}".
     985    printError("Allocation of $webvar{fullcidr} as '$disp_alloctypes{$webvar{alloctype}}'".
    987986        " failed:<br>\n$msg\n");
    988987  }
     
    12321231    $desc = "N/A";
    12331232    $notes = "N/A";
    1234   } elsif ($webvar{alloctype} =~ /^.i$/) { # done with alloctype=rr
     1233  } elsif ($webvar{alloctype} =~ /^.i$/) { # done with alloctype=[rm]m
    12351234
    12361235    # Unassigning a static IP
Note: See TracChangeset for help on using the changeset viewer.