Handle hostnames with upper-case letters
[webmin.git] / apache / mod_auth_digest.pl
1 # mod_auth_digest.pl
2 # Defines editors for digest authentication directives
3
4 sub mod_auth_digest_directives
5 {
6 local($rv);
7 $rv = [ [ 'AuthDigestAuthoritative', 0, 4, 'directory htaccess' ],
8         [ 'AuthDigestProvider', 0, 4, 'directory htaccess' ],
9         [ 'AuthDigestAlgorithm', 0, 4, 'directory htaccess' ],
10       ];
11 return &make_directives($rv, $_[0], "mod_auth_digest");
12 }
13
14 sub edit_AuthDigestAuthoritative
15 {
16 return (1, $text{'mod_auth_digest_pass'},
17        &choice_input($_[0]->{'value'}, "AuthDigestAuthoritative", "",
18        "$text{'yes'},off", "$text{'no'},on", "$text{'default'},") );
19 }
20 sub save_AuthDigestAuthoritative
21 {
22 return &parse_choice("AuthDigestAuthoritative", "");
23 }
24
25 sub edit_AuthDigestProvider
26 {
27 return (1, $text{'mod_auth_digest_prov'},
28         &ui_select("AuthDigestProvider", $_[0] ?  $_[0]->{'words'} : [ ],
29                    [ [ "file", $text{'mod_auth_basic_file'} ],
30                      [ "dbm", $text{'mod_auth_basic_dbm'} ] ],
31                    3, 1, 1));
32 }
33 sub save_AuthDigestProvider
34 {
35 local $p = $in{'AuthDigestProvider'};
36 return ( $p ? [ join(" ", split(/\0/, $p)) ] : [ ] );
37 }
38
39 sub edit_AuthDigestAlgorithm
40 {
41 return (1, $text{'mod_auth_digest_al'},
42        &choice_input($_[0]->{'value'}, "AuthDigestAlgorithm", "",
43        "MD5", "MD5-sess", "$text{'default'},") );
44 }
45 sub save_AuthDigestAlgorithm
46 {
47 return &parse_choice("AuthDigestAlgorithm", "");
48 }
49
50 sub edit_AuthDigestDomain
51 {
52 return (2,
53         $text{'mod_auth_digest_domain'},
54         &opt_input($_[0]->{'value'}, "AuthDigestDomain", $text{'core_default'}, 50));
55 }
56 sub save_AuthDigestDomain
57 {
58 return &parse_opt("AuthDigestDomain", '\S',
59                   $text{'mod_auth_digest_edomain'});
60 }
61