Menu

Adding new subnets and limitations

jas
2010-05-05
2012-08-29
  • jas

    jas - 2010-05-05

    Today I was made aware of a problem in regards to the usage of subnets.

    The phpDHCPAdmin >> manage subnets control panel has a strict set of rules
    regarding the adding of new subnets. This was originally done to prevent
    inexperienced users from adding subnets that the server's interfaces are not
    configured to listen on.

    It seems that this may be an oversight on my part and will be addressed in the
    next release. For those that are in need of a quick fix please edit the file
    'phpDHCPAdmin-0.9.5-beta/manage.subnets.php'

    On line 211 the line reads like the following:

    if( ( $val->ValidateIPv4( $subnet ) !== -1 ) && ( $val->ValidateIPv4( $subnet_mask ) !== -1 ) && ( $val->ValidateDomain( $dns_server_1 ) !== -1 ) && ( $val->ValidateDomain( $dns_server_2 ) !== -1 ) && ( $val->ValidateIPv4( $router ) !== -1 ) && ( $val->ValidateParagraph( $subnet_name ) !== -1 ) && ( $val->ValidateAlphaChar( $pool_name ) !== -1 ) || ( $pool_name === "---------------" ) && ( $val->ValidateString( $enable_scope ) !== -1 ) && ( $val->ValidateIPv4( $scope_range_1 ) !== -1 ) &&  ( $val->ValidateIPv4( $scope_range_2 ) !== -1 ) && ( $val->ValidateParagraph( $bootp_filename ) !== -1 ) && ( $val->ValidateDomain( $bootp_server ) !== -1 ) && ( $val->ValidateString( $enable_forwarding ) !== -1 ) && ( $val->ValidateDomain( $broadcast_address ) !== -1 ) && ( $val->ValidateDomain( $ntp_servers ) !== -1 ) && ( $val->ValidateDomain( $netbios_servers ) !== -1 ) && ( $val->ValidateInteger( $default_lease ) !== -1 ) && ( $val->ValidateInteger( $min_lease ) !== -1 ) && ( $val->ValidateInteger( $max_lease ) !== -1 ) && ( $val->ValidateBroadcast2List( $interface_list, $subnet ) === 0 ) && ( $val->ValidateBroadcast2List( $interface_list, $broadcast_address ) === 0 ) ) {
    

    In order to add subnets regardless of your server's interface list you will
    want to change the above line to the following:

    if( ( $val->ValidateIPv4( $subnet ) !== -1 ) && ( $val->ValidateIPv4( $subnet_mask ) !== -1 ) && ( $val->ValidateDomain( $dns_server_1 ) !== -1 ) && ( $val->ValidateDomain( $dns_server_2 ) !== -1 ) && ( $val->ValidateIPv4( $router ) !== -1 ) && ( $val->ValidateParagraph( $subnet_name ) !== -1 ) && ( $val->ValidateAlphaChar( $pool_name ) !== -1 ) || ( $pool_name === "---------------" ) && ( $val->ValidateString( $enable_scope ) !== -1 ) && ( $val->ValidateIPv4( $scope_range_1 ) !== -1 ) &&  ( $val->ValidateIPv4( $scope_range_2 ) !== -1 ) && ( $val->ValidateParagraph( $bootp_filename ) !== -1 ) && ( $val->ValidateDomain( $bootp_server ) !== -1 ) && ( $val->ValidateString( $enable_forwarding ) !== -1 ) && ( $val->ValidateDomain( $broadcast_address ) !== -1 ) && ( $val->ValidateDomain( $ntp_servers ) !== -1 ) && ( $val->ValidateDomain( $netbios_servers ) !== -1 ) && ( $val->ValidateInteger( $default_lease ) !== -1 ) && ( $val->ValidateInteger( $min_lease ) !== -1 ) && ( $val->ValidateInteger( $max_lease ) !== -1 ) ) {
    
     
  • jas

    jas - 2010-05-05

    And again...

    if( ( $val->ValidateIPv4( $subnet ) !== -1 ) && ( $val->ValidateIPv4( $subnet_mask ) !== -1 ) && ( $val->ValidateDomain( $dns_server_1 ) !== -1 ) && ( $val->ValidateDomain( $dns_server_2 ) !== -1 ) && ( $val->ValidateIPv4( $router ) !== -1 ) && ( $val->ValidateParagraph( $subnet_name ) !== -1 ) && ( $val->ValidateAlphaChar( $pool_name ) !== -1 ) && ( $val->ValidateString( $enable_scope ) !== -1 ) && ( $val->ValidateIPv4( $scope_range_1 ) !== -1 ) &&  ( $val->ValidateIPv4( $scope_range_2 ) !== -1 ) && ( $val->ValidateParagraph( $bootp_filename ) !== -1 ) && ( $val->ValidateDomain( $bootp_server ) !== -1 ) && ( $val->ValidateString( $enable_forwarding ) !== -1 ) && ( $val->ValidateDomain( $broadcast_address ) !== -1 ) && ( $val->ValidateDomain( $ntp_servers ) !== -1 ) && ( $val->ValidateDomain( $netbios_servers ) !== -1 ) && ( $val->ValidateInteger( $default_lease ) !== -1 ) && ( $val->ValidateInteger( $min_lease ) !== -1 ) && ( $val->ValidateInteger( $max_lease ) !== -1 )) {
    
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.