Handle hostnames with upper-case letters
[webmin.git] / apache / mod_authn_file.pl
1 # mod_authn_file.pl
2 # Defines editors for user text-file authentication directives
3
4 sub mod_authn_file_directives
5 {
6 local($rv);
7 $rv = [ [ 'AuthUserFile', 0, 4, 'directory htaccess' ] ];
8 return &make_directives($rv, $_[0], "mod_authn_file");
9 }
10
11 sub edit_AuthUserFile
12 {
13 local $uf = $_[0] && -r "list_authusers.cgi" ? 1 : 0;
14 return (2, $text{'mod_auth_ufile'},
15        &opt_input($_[0]->{'value'}, "AuthUserFile", $text{'default'}, 45).
16        &file_chooser_button("AuthUserFile", 0).
17        ($uf ? "&nbsp;<a href=\"list_authusers.cgi?file=".$_[0]->{'value'}.
18        "&url=".&urlize(&this_url())."\">$text{'mod_auth_uedit'}</a>" : ""));
19 }
20 sub save_AuthUserFile
21 {
22 $in{'AuthUserFile_def'} || &allowed_auth_file($in{'AuthUserFile'}) ||
23         &error($text{'mod_auth_eudir'});
24 return &parse_opt("AuthUserFile", '^\S+$', $text{'mod_auth_eufile'});
25 }
26