diff --git a/pam/lang/en b/pam/lang/en index ab375352c..4e47b0a5d 100644 --- a/pam/lang/en +++ b/pam/lang/en @@ -269,4 +269,4 @@ inc_edit=Edit Included Service inc_create=Create Included Service inc_header=Included PAM service details inc_inc=Included PAM service - +inc_err=Failed to save included service diff --git a/pam/pam_cracklib.so.pl b/pam/pam_cracklib.so.pl index 9b732852f..982b468b5 100644 --- a/pam/pam_cracklib.so.pl +++ b/pam/pam_cracklib.so.pl @@ -3,19 +3,11 @@ # display_args(&service, &module, &args) sub display_module_args { -print " $text{'cracklib_retry'}\n"; -printf " %s\n", - $_[2]->{'retry'} ? '' : 'checked', $text{'default'}; -printf "\n", - $_[2]->{'retry'} ? 'checked' : ''; -print "\n"; +print &ui_table_row($text{'cracklib_retry'}, + &ui_opt_textbox("retry", $_[2]->{'retry'}, 5, $text{'default'})); -print "$text{'cracklib_type'}\n"; -printf " %s\n", - $_[2]->{'type'} ? '' : 'checked', $text{'default'}; -printf "\n", - $_[2]->{'type'} ? 'checked' : ''; -print " \n"; +print &ui_table_row($text{'cracklib_type'}, + &ui_opt_textbox("type", $_[2]->{'type'}, 20, $text{'default'})); } # parse_module_args(&service, &module, &args) diff --git a/pam/pam_env.so.pl b/pam/pam_env.so.pl index ee912757a..025bbc631 100644 --- a/pam/pam_env.so.pl +++ b/pam/pam_env.so.pl @@ -22,18 +22,21 @@ while() { } } close(FILE); -print " \n"; -print " ", - " ", - "\n"; +local $et; +$et .= &ui_columns_start([ $text{'env_var'}, + $text{'env_def'}, + $text{'env_over'} ]); local $i = 0; foreach $e (@env, [ ]) { - print "\n"; - print "\n"; - print "\n"; + $et .= &ui_columns_row([ + &ui_textbox("var_$i", $e->[0], 20), + &ui_textbox("def_$i", $e->[1], 30), + &ui_textbox("over_$i", $e->[2], 30), + ]); $i++; } -print "
$text{'env_var'}$text{'env_def'}$text{'env_over'}
\n"; +$et .= &ui_columns_end(); +print &ui_table_row(undef, $et, 4); } # parse_module_args(&service, &module, &args) diff --git a/pam/pam_group.so.pl b/pam/pam_group.so.pl index d1040b213..75e6cec38 100644 --- a/pam/pam_group.so.pl +++ b/pam/pam_group.so.pl @@ -14,24 +14,26 @@ while() { } } close(FILE); -print " \n"; -print " ", - " ", - " ", - " ", - "\n"; +local $gt; +$gt .= &ui_columns_start([ $text{'group_services'}, + $text{'group_ttys'}, + $text{'group_users'}, + $text{'group_times'}, + $text{'group_groups'} ]); local $i = 0; foreach $g (@group, [ ]) { - print "\n"; - print "\n"; - print "\n"; - print "\n"; - print "\n"; - print "\n"; - print "\n"; + $gt .= &ui_columns_row([ + &ui_textbox("services_$i", $g->[0], 20), + &ui_textbox("ttys_$i", $g->[1], 20), + &ui_textbox("users_$i", $g->[2], 20), + &ui_textbox("times_$i", $g->[3], 20), + &ui_textbox("groups_$i", $g->[4], 20), + ]); $i++; } -print "
$text{'group_services'}$text{'group_ttys'}$text{'group_users'}$text{'group_times'}$text{'group_groups'}

$text{'group_info'} \n"; +$gt .= &ui_columns_end(); +$gt .= "
".$text{'group_info'}; +print &ui_table_row(undef, $gt, 4); } # parse_module_args(&service, &module, &args) diff --git a/pam/pam_listfile.so.pl b/pam/pam_listfile.so.pl index cdc73db74..d18bcac7b 100644 --- a/pam/pam_listfile.so.pl +++ b/pam/pam_listfile.so.pl @@ -3,43 +3,35 @@ # display_args(&service, &module, &args) sub display_module_args { -print " $text{'listfile_item'}\n"; -print "\n"; +print &ui_table_row($text{'listfile_item'}, + &ui_select("item", $_[2]->{'item'}, + [ map { [ $_, $text{'listfile_item_'.$_} ] } + ('user', 'tty', 'rhost', 'ruser', 'group', 'shell') ])); -print "$text{'listfile_sense'}\n"; -printf " %s\n", - $_[2]->{'sense'} eq 'allow' ? 'checked' : '', $text{'listfile_succeed'}; -printf " %s \n", - $_[2]->{'sense'} eq 'allow' ? '' : 'checked', $text{'listfile_fail'}; +print &ui_table_row($text{'listfile_sense'}, + &ui_radio("sense", $_[2]->{'sense'} || "deny", + [ [ "allow", $text{'listfile_succeed'} ], + [ "deny", $text{'listfile_fail'} ] ])); -print " $text{'listfile_file'}\n"; -print " ", - &file_chooser_button("file")," \n"; +print &ui_table_row($text{'listfile_file'}, + &ui_textbox("file", $_[2]->{'file'}, 50)." ". + &file_chooser_button("file"), 3); -print " $text{'listfile_onerr'}\n"; -printf " %s\n", - $_[2]->{'onerr'} eq 'fail' ? 'checked' : '', $text{'listfile_fail'}; -printf " %s\n", - $_[2]->{'onerr'} eq 'fail' ? '' : 'checked', $text{'listfile_succeed'}; +print &ui_table_row($text{'listfile_onerr'}, + &ui_radio("onerr", $_[2]->{'onerr'} || "succeed", + [ [ "fail", $text{'listfile_fail'} ], + [ "success", $text{'listfile_succeed'} ] ])); local $mode = $_[2]->{'apply'} =~ /^\@/ ? 2 : $_[2]->{'apply'} ? 1 : 0; -print "$text{'listfile_apply'}\n"; -printf " %s\n", - $mode == 0 ? 'checked' : '', $text{'listfile_all'}; -printf " %s %s\n", - $mode == 1 ? 'checked' : '', $text{'listfile_user'}, - &unix_user_input("apply_user", $mode == 1 ? $_[2]->{'apply'} : ""); -printf " %s %s \n", - $mode == 2 ? 'checked' : '', $text{'listfile_group'}, - &unix_group_input("apply_group", $mode == 2 ? - substr($_[2]->{'apply'}, 1) : ""); +print &ui_table_row($text{'listfile_apply'}, + &ui_radio("apply_mode", $mode, + [ [ 0, $text{'listfile_all'} ], + [ 1, $text{'listfile_user'}." ". + &unix_user_input("apply_user", $mode == 1 ? $_[2]->{'apply'} : "")], + [ 2, $text{'listfile_group'}." ". + &unix_group_input("apply_group", $mode == 2 ? + substr($_[2]->{'apply'}, 1) : "") ] ]), 3); } # parse_module_args(&service, &module, &args) diff --git a/pam/pam_mail.so.pl b/pam/pam_mail.so.pl index 39b9fcada..5427edd7e 100644 --- a/pam/pam_mail.so.pl +++ b/pam/pam_mail.so.pl @@ -3,37 +3,25 @@ # display_args(&service, &module, &args) sub display_module_args { -print " $text{'mail_nopen'}\n"; -printf " %s\n", - defined($_[2]->{'nopen'}) ? '' : 'checked', $text{'yes'}; -printf " %s\n", - defined($_[2]->{'nopen'}) ? 'checked' : '', $text{'no'}; +print &ui_table_row($text{'mail_nopen'}, + &ui_radio("noopen", defined($_[2]->{'nopen'}) ? 1 : 0, + [ [ 0, $text{'yes'} ], [ 1, $text{'no'} ] ])); -print "$text{'mail_close'}\n"; -printf " %s\n", - defined($_[2]->{'close'}) ? 'checked' : '', $text{'yes'}; -printf " %s \n", - defined($_[2]->{'close'}) ? '' : 'checked', $text{'no'}; +print &ui_table_row($text{'mail_close'}, + &ui_radio("noopen", defined($_[2]->{'close'}) ? 1 : 0, + [ [ 1, $text{'yes'} ], [ 0, $text{'no'} ] ])); -print " $text{'mail_empty'}\n"; -printf " %s\n", - defined($_[2]->{'empty'}) ? 'checked' : '', $text{'yes'}; -printf " %s\n", - defined($_[2]->{'empty'}) ? '' : 'checked', $text{'no'}; +print &ui_table_row($text{'mail_empty'}, + &ui_radio("noopen", defined($_[2]->{'empty'}) ? 1 : 0, + [ [ 1, $text{'yes'} ], [ 0, $text{'no'} ] ])); -print "$text{'mail_noenv'}\n"; -printf " %s\n", - defined($_[2]->{'noenv'}) ? '' : 'checked', $text{'yes'}; -printf " %s \n", - defined($_[2]->{'noenv'}) ? 'checked' : '', $text{'no'}; +print &ui_table_row($text{'mail_noenv'}, + &ui_radio("noopen", defined($_[2]->{'noenv'}) ? 1 : 0, + [ [ 0, $text{'yes'} ], [ 1, $text{'no'} ] ])); -print " $text{'mail_dir'}\n"; -printf " %s\n", - $_[2]->{'dir'} ? '' : 'checked', $text{'default'}; -printf " %s\n", - $_[2]->{'dir'} ? 'checked' : ''; -print " ", - &file_chooser_button("dir")," \n"; +print &ui_table_row($text{'mail_dir'}, + &ui_opt_textbox("dir", $_[2]->{'dir'}, 50, $text{'default'})." ". + &file_chooser_button("dir"), 3); } # parse_module_args(&service, &module, &args) diff --git a/pam/pam_motd.so.pl b/pam/pam_motd.so.pl index 707e09658..34cdbf0af 100644 --- a/pam/pam_motd.so.pl +++ b/pam/pam_motd.so.pl @@ -5,13 +5,9 @@ $module_has_no_args = 1; # file= arg doesn't seem to work! # display_args(&service, &module, &args) sub display_module_args { -print " $text{'motd_file'}\n"; -printf " %s\n", - $_[2]->{'file'} ? '' : 'checked', $text{'motd_file_def'}; -printf "\n", - $_[2]->{'file'} ? 'checked' : ''; -print " ", - &file_chooser_button("file")," \n"; +print &ui_table_row($text{'motd_file'}, + &ui_opt_textbox("file", $_[2]->{'file'}, 40, $text{'motd_file_def'}). + " ".&file_chooser_button("file"), 3); } # parse_module_args(&service, &module, &args) diff --git a/pam/pam_pwdb.so.pl b/pam/pam_pwdb.so.pl index c38b7f8de..f5d64364e 100644 --- a/pam/pam_pwdb.so.pl +++ b/pam/pam_pwdb.so.pl @@ -3,29 +3,18 @@ # display_args(&service, &module, &args) sub display_module_args { -print " $text{'pwdb_shadow'}\n"; -printf " %s\n", - defined($_[2]->{'shadow'}) ? 'checked' : '', $text{'yes'}; -printf " %s\n", - defined($_[2]->{'shadow'}) ? '' : 'checked', $text{'no'}; +print &ui_table_row($text{'pwdb_shadow'}, + &ui_yesno_radio("shadow", defined($_[2]->{'shadow'}) ? 1 : 0)); -print "$text{'pwdb_nullok'}\n"; -printf " %s\n", - defined($_[2]->{'nullok'}) ? 'checked' : '', $text{'yes'}; -printf " %s \n", - defined($_[2]->{'nullok'}) ? '' : 'checked', $text{'no'}; +print &ui_table_row($text{'pwdb_nullok'}, + &ui_yesno_radio("nullok", defined($_[2]->{'nullok'}) ? 1 : 0)); -print " $text{'pwdb_md5'}\n"; -printf " %s\n", - defined($_[2]->{'md5'}) ? 'checked' : '', $text{'yes'}; -printf " %s\n", - defined($_[2]->{'md5'}) ? '' : 'checked', $text{'no'}; +print &ui_table_row($text{'pwdb_md5'}, + &ui_yesno_radio("md5", defined($_[2]->{'md5'}) ? 1 : 0)); -print "$text{'pwdb_nodelay'}\n"; -printf " %s\n", - defined($_[2]->{'nodelay'}) ? '' : 'checked', $text{'yes'}; -printf " %s \n", - defined($_[2]->{'nodelay'}) ? 'checked' : '', $text{'no'}; +print &ui_table_row($text{'pwdb_nodelay'}, + &ui_radio("md5", defined($_[2]->{'nodelay'}) ? 1 : 0, + [ [ 0, $text{'yes'} ], [ 1, $text{'no'} ] ])); } # parse_module_args(&service, &module, &args) diff --git a/pam/pam_rhosts_auth.so.pl b/pam/pam_rhosts_auth.so.pl index ac4c844be..a0d1fa2f2 100644 --- a/pam/pam_rhosts_auth.so.pl +++ b/pam/pam_rhosts_auth.so.pl @@ -3,29 +3,20 @@ # display_args(&service, &module, &args) sub display_module_args { -print " $text{'rhosts_equiv'}\n"; -printf " $text{'yes'}\n", - defined($_[2]->{'no_hosts_equiv'}) ? '' : 'checked'; -printf " $text{'no'}\n", - defined($_[2]->{'no_hosts_equiv'}) ? 'checked' : ''; +print &ui_table_row($text{'rhosts_equiv'}, + &ui_radio("equiv", defined($_[2]->{'no_hosts_equiv'}) ? 1 : 0, + [ [ 0, $text{'yes'} ], [ 1, $text{'no'} ] ])); -print "$text{'rhosts_rhosts'}\n"; -printf " $text{'yes'}\n", - defined($_[2]->{'no_rhosts'}) ? '' : 'checked'; -printf " $text{'no'} \n", - defined($_[2]->{'no_rhosts'}) ? 'checked' : ''; +print &ui_table_row($text{'rhosts_rhosts'}, + &ui_radio("rhosts", defined($_[2]->{'no_hosts'}) ? 1 : 0, + [ [ 0, $text{'yes'} ], [ 1, $text{'no'} ] ])); -print " $text{'rhosts_promiscuous'}\n"; -printf " $text{'yes'}\n", - defined($_[2]->{'promiscuous'}) ? 'checked' : ''; -printf " $text{'no'}\n", - defined($_[2]->{'promiscuous'}) ? '' : 'checked'; +print &ui_table_row($text{'rhosts_promiscuous'}, + &ui_yesno_radio("promiscuous",defined($_[2]->{'promiscuous'}) ? 1 : 0)); -print "$text{'rhosts_suppress'}\n"; -printf " $text{'yes'}\n", - defined($_[2]->{'suppress'}) ? '' : 'checked'; -printf " $text{'no'} \n", - defined($_[2]->{'suppress'}) ? 'checked' : ''; +print &ui_table_row($text{'rhosts_suppress'}, + &ui_radio("suppress", defined($_[2]->{'supress'}) ? 1 : 0, + [ [ 0, $text{'yes'} ], [ 1, $text{'no'} ] ])); } # parse_module_args(&service, &module, &args)