-
-
Notifications
You must be signed in to change notification settings - Fork 129
Expand file tree
/
Copy pathcopy_cert_all.cgi
More file actions
executable file
·28 lines (22 loc) · 832 Bytes
/
copy_cert_all.cgi
File metadata and controls
executable file
·28 lines (22 loc) · 832 Bytes
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
#!/usr/local/bin/perl
# Copy this domain's cert to all services as the default
require './virtual-server-lib.pl';
&ReadParse();
$d = &get_domain($in{'dom'});
$d && &can_edit_domain($d) && &can_edit_ssl() && &can_webmin_cert() ||
&error($text{'copycert_ecannot'});
$d->{'ssl_pass'} && &error($text{'copycert_epass'});
&ui_print_unbuffered_header(&domain_in($d), $text{'copycert_title'}, "");
@already = &get_all_domain_service_ssl_certs($d);
foreach my $st (&list_service_ssl_cert_types()) {
($a) = grep { !$_->{'d'} && $_->{'id'} eq $st->{'id'} } @already;
if (!$a) {
my $cfunc = "copy_".$st->{'id'}."_ssl_service";
&$cfunc($d);
}
}
&run_post_actions();
&webmin_log("copycert", "all");
&ui_print_footer("cert_form.cgi?dom=$d->{'id'}", $text{'cert_return'},
&domain_footer_link($d),
"", $text{'index_return'});