Handle hostnames with upper-case letters
[webmin.git] / pam / pam_mail.so.pl
1 # display args for pam_mail.so.pl
2
3 # display_args(&service, &module, &args)
4 sub display_module_args
5 {
6 print &ui_table_row($text{'mail_nopen'},
7         &ui_radio("noopen", defined($_[2]->{'nopen'}) ? 1 : 0,
8                   [ [ 0, $text{'yes'} ], [ 1, $text{'no'} ] ]));
9
10 print &ui_table_row($text{'mail_close'},
11         &ui_radio("noopen", defined($_[2]->{'close'}) ? 1 : 0,
12                   [ [ 1, $text{'yes'} ], [ 0, $text{'no'} ] ]));
13
14 print &ui_table_row($text{'mail_empty'},
15         &ui_radio("noopen", defined($_[2]->{'empty'}) ? 1 : 0,
16                   [ [ 1, $text{'yes'} ], [ 0, $text{'no'} ] ]));
17
18 print &ui_table_row($text{'mail_noenv'},
19         &ui_radio("noopen", defined($_[2]->{'noenv'}) ? 1 : 0,
20                   [ [ 0, $text{'yes'} ], [ 1, $text{'no'} ] ]));
21
22 print &ui_table_row($text{'mail_dir'},
23         &ui_opt_textbox("dir", $_[2]->{'dir'}, 50, $text{'default'})." ".
24         &file_chooser_button("dir"), 3);
25 }
26
27 # parse_module_args(&service, &module, &args)
28 sub parse_module_args
29 {
30 if ($in{'nopen'}) { $_[2]->{'nopen'} = ''; }
31 else { delete($_[2]->{'nopen'}); }
32
33 if ($in{'close'}) { $_[2]->{'close'} = ''; }
34 else { delete($_[2]->{'close'}); }
35
36 if ($in{'empty'}) { $_[2]->{'empty'} = ''; }
37 else { delete($_[2]->{'empty'}); }
38
39 if ($in{'noenv'}) { $_[2]->{'noenv'} = ''; }
40 else { delete($_[2]->{'noenv'}); }
41
42 if ($in{'dir_def'}) { delete($_[2]->{'dir'}); }
43 else {
44         -d $in{'dir'} || &error($text{'mail_edir'});
45         $_[2]->{'dir'} = $in{'dir'};
46         }
47 }
48