diff --git a/config b/config index 7aa7310..3f51f0c 100644 --- a/config +++ b/config @@ -1,2 +1,2 @@ jailkit_config_dir=/etc/jailkit -jk_init_ini=/etc/jailkit/jk_init.ini +jk_init_ini=jk_init.ini diff --git a/index.cgi b/index.cgi index eb5937f..43f58c1 100644 --- a/index.cgi +++ b/index.cgi @@ -13,7 +13,7 @@ ui_print_header(undef, $text{'index_title'}, "", "index", 1, 1, 0, undef, undef, undef, undef); my @table; -foreach my $jail (keys %$jk_init_ini) { +foreach my $jail (keys %{$jk_init_ini}) { push(@table, [ { 'type' => 'checkbox', 'name' => 'd', 'value' => $jail, @@ -24,16 +24,19 @@ foreach my $jail (keys %$jk_init_ini) { my @buttons; push(@buttons, [ - [ "delete", $text{'jk_delete'} ] + [ "delete", $text{'index_delete_jail'} ] ]); my @actions; push(@actions, [ - [ "create", $text{'jk_create'} ] + [ "create", $text{'index_create_jail'} ] ]); -ui_form_columns_table('delete_jk_init.cgi', @buttons, 1, @actions, \@table); +use Data::Dumper; +print "\n"; + +print "\n"; -print ui_form_end([ [ "save", $text{'form_save'} ] ]); # save_config +ui_form_columns_table('delete_jk_init.cgi', @buttons, 1, @actions, \@table); ui_print_footer("/", $text{'index'}); diff --git a/jailkit-lib.pl b/jailkit-lib.pl index a67ba9b..5a69031 100644 --- a/jailkit-lib.pl +++ b/jailkit-lib.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/perl use strict; use warnings; @@ -13,7 +13,7 @@ =head1 jailkit-lib.pl foreign_require("jailkit", "jailkit-lib.pl"); $jk_init_ini = jailkit::get_jk_init_ini(); -$jk_init_ini will contain a list of hashrefs of configuration +$jk_init_ini will contain a list of hashrefs of configuration directives from jk_init.ini. =cut @@ -29,13 +29,14 @@ =head2 get_jk_init_ini() =cut sub get_jk_init_ini { - use Config::INI::Reader; + use Config::Simple; - my $config = Config::INI::Reader->read_file($config{'jk_init_ini'}); - return $config; + my $jk_init_ini = new Config::Simple('/etc/jailkit/jk_init.ini'); + #"$config{'jailkit_config_dir'}/$config{'jk_init_ini'}"); + return \%$jk_init_ini; } -=head2 write_jk_init_config(\%jk_init_ini) +=head2 write_jk_init_ini(\%jk_init_ini) Write configuration file array to config file. May return an error object, if write fails.