#!/usr/local/bin/perl # edit_mod.cgi # Edit one PAM authentication module for some service require './pam-lib.pl'; &ReadParse(); @pam = &get_pam_config(); $pam = $pam[$in{'idx'}]; if ($in{'midx'} ne '') { $mod = $pam->{'mods'}->[$in{'midx'}]; $module = $mod->{'module'}; $module =~ s/^.*\///; $type = $mod->{'type'}; &ui_print_header(undef, $text{'mod_edit'}, ""); } else { $module = $in{'module'}; $type = $in{'type'}; &ui_print_header(undef, $text{'mod_create'}, ""); } print "
\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "
$text{'mod_header'}
\n"; print "\n"; $t = $text{'desc_'.$pam->{'name'}}; print "\n"; print "\n"; $t = $text{$module}; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; if (-r "./$module.pl") { do "./$module.pl"; if (!$module_has_no_args) { print "\n"; foreach $a (split(/\s+/, $mod->{'args'})) { if ($a =~ /^([^\s=]+)=(\S*)$/) { $args{$1} = $2; } else { $args{$a} = ""; } } &display_module_args($pam, $mod, \%args); } } else { print "\n"; print "\n"; print "\n"; } print "
$text{'mod_name'}",&html_escape($pam->{'name'})," ", $pam->{'desc'} ? "($pam->{'desc'})" : $t ? "($t)" : "","$text{'mod_mod'}$module ",$t ? "($t)" : "","
$text{'mod_type'}",$text{'mod_type_'.$type},"$text{'mod_control'}


$text{'mod_args'}
\n"; print "\n"; print "\n"; if ($in{'midx'} ne '') { print "\n"; } print "
\n"; print "
\n"; &ui_print_footer("edit_pam.cgi?idx=$in{'idx'}", $text{'edit_return'}, "", $text{'index_return'});