[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cobalt-developers] RE: Changing the DNS control panel script...



Thanks,

Changing de show_bits and show_lessbits sub did the work.

sub show_bits
    {
    my( $actbits ) = ( ( $_[0] < 8 ) ? 28 : $_[0] );
    my( $html ) = "";

    for( $_=8; $_<=30; $_++ )
        {
        my $selflag = ( $_ == $actbits ? " selected" : "" );
        $html .= "<option value=$_ $selflag>$_\n";
        }
    return $html;
    }

...

sub show_lessbits
    {
    my( $actbits ) = ( ( $_[0] < 8 ) ? 28 : $_[0] );
    my( $html ) = "";
            
    for( $_=$actbits; $_<=30; $_++ )
        {
        my $selflag = ( $_ == $actbits ? " selected" : "" );
        $html .= "<option value=$_ $selflag>$_\n";
        }
    return $html;
    }

By convention the subnet mask is set to 30.  It will work with 32, but the
smallest possible network is:

11111111.11111111.11111111.11111100

   8        16       24       30

	    255.255.255.252

Robin

-----Original Message-----
From: Brad Hubbard [mailto:brad@xxxxxxxxxxxxxxxx]
Sent: Friday, June 22, 2001 7:24 PM
To: cobalt-developers@xxxxxxxxxxxxxxx; Robin Belley
Subject: Re: [cobalt-developers] Changing the DNS control panel
script...


On Sat, 23 Jun 2001 04:43, Robin Belley wrote:
> Howdy,
>
> Anyone ever tried to modify the control panel for the DNS entries?
>
> I am trying to change the default value in the "Select" statement and
> increase the "nbits" drop down menu to 32.

I'd start at the following subroutine;



  sub show_bits
    {
    my( $actbits ) = ( ( $_[0] < 8 ) ? 24 : $_[0] );
    my( $html ) = "";
 
    for( $_=8; $_<=30; $_++ )
        {
        my $selflag = ( $_ == $actbits ? " selected" : "" );
        $html .= "<option value=$_ $selflag>$_\n";
        }
    return $html;
    }

in /usr/admserv/cgi-bin/.cobalt/dns/index.cgi

>For that matter, can anyone
> explain why the values are limited to 30 when the internal table goes to
> 32?

Can't help you there.

And hey.... let's be careful out there ;-)

Cheers,
Brad
-- 
Brad Hubbard
Congo Systems
12 Northgate Drive,
Thomastown, Victoria, Australia 3074
Email: brad@xxxxxxxxxxxxxxxx
Ph: +61-3-94645981
Fax: +61-3-94645982
Mob: +61-419107559