forked from webmin/webmin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathacl_security.pl
executable file
·65 lines (54 loc) · 2.36 KB
/
acl_security.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
require 'htpasswd-file-lib.pl';
# acl_security_form(&options)
# Output HTML for editing security options for the passwd module
sub acl_security_form
{
print "<tr> <td><b>$text{'acl_repeat'}</b></td> <td>\n";
printf "<input type=radio name=repeat value=1 %s> $text{'yes'}\n",
$_[0]->{'repeat'} ? "checked" : "";
printf "<input type=radio name=repeat value=0 %s> $text{'no'}</td>\n",
$_[0]->{'repeat'} ? "" : "checked";
print "<td><b>$text{'acl_create'}</b></td> <td>\n";
printf "<input type=radio name=create value=1 %s> $text{'yes'}\n",
$_[0]->{'create'} ? "checked" : "";
printf "<input type=radio name=create value=0 %s> $text{'no'}</td> </tr>\n",
$_[0]->{'create'} ? "" : "checked";
print "<tr> <td><b>$text{'acl_rename'}</b></td> <td>\n";
printf "<input type=radio name=rename value=1 %s> $text{'yes'}\n",
$_[0]->{'rename'} ? "checked" : "";
printf "<input type=radio name=rename value=0 %s> $text{'no'}</td>\n",
$_[0]->{'rename'} ? "" : "checked";
print "<td><b>$text{'acl_delete'}</b></td> <td>\n";
printf "<input type=radio name=delete value=1 %s> $text{'yes'}\n",
$_[0]->{'delete'} ? "checked" : "";
printf "<input type=radio name=delete value=0 %s> $text{'no'}</td> </tr>\n",
$_[0]->{'delete'} ? "" : "checked";
print "<tr> <td><b>$text{'acl_enable'}</b></td> <td>\n";
printf "<input type=radio name=enable value=1 %s> $text{'yes'}\n",
$_[0]->{'enable'} ? "checked" : "";
printf "<input type=radio name=enable value=0 %s> $text{'no'}</td>\n",
$_[0]->{'enable'} ? "" : "checked";
print "<td><b>$text{'acl_sync'}</b></td> <td>\n";
printf "<input type=radio name=sync value=1 %s> $text{'yes'}\n",
$_[0]->{'sync'} ? "checked" : "";
printf "<input type=radio name=sync value=0 %s> $text{'no'}</td> </tr>\n",
$_[0]->{'sync'} ? "" : "checked";
print "<tr> <td><b>$text{'acl_single'}</b></td> <td>\n";
printf "<input type=radio name=single value=1 %s> $text{'yes'}\n",
$_[0]->{'single'} ? "checked" : "";
printf "<input type=radio name=single value=0 %s> $text{'no'}</td>\n",
$_[0]->{'single'} ? "" : "checked";
print "</tr>\n";
}
# acl_security_save(&options)
# Parse the form for security options for the bind8 module
sub acl_security_save
{
$_[0]->{'repeat'} = $in{'repeat'};
$_[0]->{'create'} = $in{'create'};
$_[0]->{'rename'} = $in{'rename'};
$_[0]->{'delete'} = $in{'delete'};
$_[0]->{'enable'} = $in{'enable'};
$_[0]->{'sync'} = $in{'sync'};
$_[0]->{'single'} = $in{'single'};
}