-
Notifications
You must be signed in to change notification settings - Fork 3
/
edit_fpm.cgi
41 lines (39 loc) · 1.25 KB
/
edit_fpm.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
37
38
39
40
41
#!/usr/bin/perl
# Show the config for one HTTP server
use strict;
use warnings;
require 'virtualmin-nginx-lib.pl';
our (%text, %in, %access, %config);
&ReadParse();
my $fpm_loc = $config{'php_fpm_loc'}.'/';
my $server;
if ($in{'new'}) {
$access{'vhosts'} && &error($text{'server_ecannotcreate'});
&ui_print_header(undef, $text{'server_create'}, "");
$server = { 'name' => 'server',
'members' => [ ] };
}
else {
&foreign_require("phpini");
$server = &phpini::get_config($fpm_loc.substr($in{'id'}, 0, -1).'.conf');
my $user = &phpini::find_value('user', $server);
$server || &error($text{'server_egone'});
&can_edit_server($server) || &error($text{'server_ecannot'});
&ui_print_header('For '.$user, "Configure PHP-FPM", "");
}
if ($in{'id'}) {
# Show icons for server settings types
print &ui_subheading($fpm_loc.substr($in{'id'}, 0, -1).'.conf');
my @spages = ( "sdocs", "ssl", "fcgi", "sssi", "sgzip", "sproxy",
"saccess", "srewrite", );
&icons_table(
[ map { "edit_".$_.".cgi?id=".&urlize($in{'id'}) } @spages ],
[ map { $text{$_."_title"} } @spages ],
[ map { "images/".$_.".gif" } @spages ],
);
print &ui_columns_end();
}
else {
print "<b>$text{'server_noneloc'}</b><p>\n";
}
&ui_print_footer("", $text{'index_return'});