2 # Edit a PAM include for some service
4 require './pam-lib.pl';
7 @pam = &get_pam_config();
8 $pam = $pam[$in{'idx'}];
9 if ($in{'midx'} ne '') {
10 $mod = $pam->{'mods'}->[$in{'midx'}];
11 $inc = $mod->{'module'};
12 $type = $mod->{'type'};
13 &ui_print_header(undef, $text{'inc_edit'}, "");
16 &ui_print_header(undef, $text{'inc_create'}, "");
21 print &ui_form_start("save_inc.cgi");
22 print &ui_hidden("idx", $in{'idx'});
23 print &ui_hidden("midx", $in{'midx'});
24 print &ui_hidden("_type", $in{'type'});
25 print &ui_table_start($text{'inc_header'}, undef, 2, [ "width=30%" ]);
28 $t = $text{'desc_'.$pam->{'name'}};
29 print &ui_table_row($text{'mod_name'},
30 "<tt>".&html_escape($pam->{'name'})."</tt> ".
31 ($pam->{'desc'} ? "($pam->{'desc'})" : $t ? "($t)" : ""));
34 print &ui_table_row($text{'mod_type'},
35 $text{'mod_type_'.$type});
38 @pam = sort { $a->{'name'} cmp $b->{'name'} } @pam;
39 print &ui_table_row($text{'inc_inc'},
40 &ui_select("inc", $inc,
41 [ map { [ $_->{'name'},
42 $_->{'name'}.($text{'desc_'.$_->{'name'}} ?
43 " (".$text{'desc_'.$_->{'name'}}.")" : "") ] }
44 grep { $_->{'name'} ne $pam->{'name'} } @pam ],
47 print &ui_table_end();
49 if ($in{'midx'} ne '') {
50 print &ui_form_end([ [ undef, $text{'save'} ],
51 [ 'delete', $text{'delete'} ] ]);
54 print &ui_form_end([ [ undef, $text{'create'} ] ]);
57 &ui_print_footer("edit_pam.cgi?idx=$in{'idx'}", $text{'edit_return'},
58 "", $text{'index_return'});