-
Notifications
You must be signed in to change notification settings - Fork 13
/
edit_laccess.cgi
executable file
·36 lines (28 loc) · 1.12 KB
/
edit_laccess.cgi
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
#!/usr/local/bin/perl
# Show location access control options
use strict;
use warnings;
require './virtualmin-nginx-lib.pl';
our (%text, %in, %access);
&ReadParse();
my $server = &find_server($in{'id'});
$server || &error($text{'server_egone'});
&can_edit_server($server) || &error($text{'server_ecannot'});
my $location = &find_location($server, $in{'path'});
$location || &error($text{'location_egone'});
&ui_print_header(&location_desc($server, $location), $text{'access_title'}, "");
print &ui_form_start("save_laccess.cgi", "post");
print &ui_hidden("id", $in{'id'});
print &ui_hidden("path", $in{'path'});
print &ui_table_start($text{'access_header'}, undef, 2);
print &nginx_access_input("allow", "deny", $location);
print &nginx_realm_input("auth_basic", $location);
print &nginx_passfile_input("auth_basic_user_file", $location,
$in{'id'}, $in{'path'});
print &ui_table_end();
print &ui_form_end([ [ undef, $text{'save'} ] ]);
&ui_print_footer("edit_location.cgi?id=".&urlize($in{'id'}).
"&path=".&urlize($in{'path'}),
$text{'location_return'},
"edit_server.cgi?id=".&urlize($in{'id'}),
$text{'server_return'});