Handle hostnames with upper-case letters
[webmin.git] / apache / mod_auth_dbm.pl
1 # mod_auth_dbm.pl
2 # Defines editors for DBM file authentication directives
3
4 sub mod_auth_dbm_directives
5 {
6 local($rv);
7 $rv = [ [ 'AuthDBMUserFile AuthDBMGroupFile AuthDBMAuthoritative', 0, 4, 'directory htaccess' ],
8         [ 'AuthDBMType', 0, 4, 'directory htaccess', 2.030, -1 ] ];
9 return &make_directives($rv, $_[0], "mod_auth_dbm");
10 }
11
12 sub edit_AuthDBMUserFile_AuthDBMGroupFile_AuthDBMAuthoritative
13 {
14 local($rv, $uf, $gf);
15 $uf = $_[0] ? 1 : 0; $gf = $_[1] ? 1 : 0;
16 $rv = "<table border><tr><td><table>\n";
17
18 $rv .= "<tr> <td><b>$text{'mod_auth_dbm_ufile'}</b></td> <td>".
19        &opt_input($_[0]->{'value'}, "AuthDBMUserFile", $text{'default'}, 25).
20        &file_chooser_button("AuthDBMUserFile", 0)."</td></tr>\n";
21
22 $rv .= "<tr> <td><b>$text{'mod_auth_dbm_gfile'}</b></td> <td>".
23        &opt_input($_[1]->{'value'}, "AuthDBMGroupFile", $text{'default'}, 25).
24        &file_chooser_button("AuthDBMGroupFile", 0)."</td></tr>\n";
25
26 $rv .= "<tr> <td><b>$text{'mod_auth_dbm_pass'}</b></td> <td>".
27        &choice_input($_[2]->{'value'}, "AuthDBMAuthoritative", "",
28        "$text{'yes'},off", "$text{'no'},on", "$text{'default'},").
29        "</td> </tr>\n";
30 $rv .= "</table></td></tr></table>\n";
31 return (2, $text{'mod_auth_dbm_auth'}, $rv);
32 }
33 sub save_AuthDBMUserFile_AuthDBMGroupFile_AuthDBMAuthoritative
34 {
35 local(@rv);
36 @rv = (&parse_opt("AuthDBMUserFile", '^\S+$', $text{'mod_auth_dbm_eufile'}) ,
37        &parse_opt("AuthDBMGroupFile", '^\S+$', $text{'mod_auth_dbm_egfile'}) ,
38        &parse_choice("AuthDBMAuthoritative", ""));
39 return @rv;
40 }
41
42 sub edit_AuthDBMType
43 {
44 return (1, $text{'mod_auth_dbm_type'},
45         &select_input($_[0]->{'value'}, "AuthDBMType", "",
46                       "$text{'default'},", "GDBM,GDBM", "SDBM,SDBM", "DB,DB",
47                       "$text{'mod_auth_dbm_default'},default"));
48 }
49 sub save_AuthDBMType
50 {
51 return &parse_select("AuthDBMType", "");
52 }
53
54 1;
55