Line 211: |
Line 211: |
| | | |
| our $db = esmith::ConfigDB->open() or die("Unable to open Configuration DB"); | | our $db = esmith::ConfigDB->open() or die("Unable to open Configuration DB"); |
| + | our %sme_conf = $db->get('dhcpd')->props; |
| + | our %smb_conf = $db->get('smb')->props; |
| our $adb = esmith::AccountsDB->open() or die("Unable to open accounts DB"); | | our $adb = esmith::AccountsDB->open() or die("Unable to open accounts DB"); |
| | | |
Line 226: |
Line 228: |
| # | | # |
| my $c = shift; | | my $c = shift; |
− | #die("hello world"); | + | $dhcp_data{"status"} = [[$c->l('dhcpd_ENABLED'),'enabled'], |
− | $dhcp_data{"first"} = 'dhcp_DESCRIPTION'; | + | [$c->l('dhcpd_DISABLED'),'disabled'] |
| + | ]; |
| + | |
| + | $dhcp_data{"check"} = [[$c->l('dhcpd_ENABLED'),'enabled'], |
| + | [$c->l('dhcpd_DISABLED'),'disabled'] |
| + | ]; |
| + | if (! $sme_conf{'winscustom'} ) { |
| + | $sme_conf{'winscustom'} = 'disabled' ; |
| + | } |
| + | if (! $sme_conf{'dnscustom'} ) { |
| + | $sme_conf{'dnscustom'} = 'disabled' ; |
| + | } |
| + | if ( ! $sme_conf{'leasetime'} ) |
| + | { $sme_conf{'leasetime'} = "86400" ; |
| + | } |
| + | if (! $sme_conf{'gatewaycustom'} ) { |
| + | $sme_conf{'gatewaycustom'} = 'disabled' ; |
| + | } |
| + | #$dhcp_data{"first"} = 'dhcpd_DESCRIPTION'; |
| do_display( $c, %dhcp_data ); | | do_display( $c, %dhcp_data ); |
| } | | } |
Line 237: |
Line 257: |
| my $c = shift; | | my $c = shift; |
| $c->app->log->info( $c->log_req ); | | $c->app->log->info( $c->log_req ); |
− | my $title = $c->l("dhcp_DHCPD_SETTINGS_TITLE"); | + | my $title = $c->l("dhcpd_DHCP manager"); |
| my $modul = ''; | | my $modul = ''; |
| my $trt = "SETTINGS"; | | my $trt = "SETTINGS"; |
| $dhcp_data{trt} = $trt; | | $dhcp_data{trt} = $trt; |
| # Accumulate parameters for Configuration DB | | # Accumulate parameters for Configuration DB |
− | # ..... | + | $dhcp_data{'params'} = \%sme_conf; |
− | $c->stash( title => $title, modul => $modul, dhcp_data => \%dhcp_data ); | + | $dhcp_data{'smbparams'} = \%smb_conf; |
| + | $c->stash( title => $title, |
| + | modul => $modul, |
| + | dhcp_data => \%dhcp_data |
| + | ); |
| $c->render( template => 'dhcpd' ); | | $c->render( template => 'dhcpd' ); |
− | }
| |
| | | |
| sub do_leases { | | sub do_leases { |