You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
1.0 KiB
34 lines
1.0 KiB
<?php
|
|
require_once('../../scripts/sys_utils.php');
|
|
require_once('../../scripts/distro_web_utils.php');
|
|
print_PAGE_HEADER();
|
|
if( isset( $_FILES["cert"] ) ){
|
|
$target_dir = "/srv/etc/ssl/tmp";
|
|
$target_file = $target_dir . '/' . basename($_FILES["cert"]["name"]);
|
|
$tmp_file = $_FILES["cert"]["tmp_name"];
|
|
move_uploaded_file( $tmp_file, $target_file );
|
|
|
|
};
|
|
if( $SYS_CONFIG['NGINX_AUTH_IS_SET'] == false ) {
|
|
print_AUTH_WARNING();
|
|
};
|
|
print_CONNECTION_INFO();
|
|
$A = print_CERT_INFO( $target_file );
|
|
if( $A < 7 ){
|
|
print_CERT_UPLOAD_FORM();
|
|
} else {
|
|
if( $SYS_CONFIG['NGINX_CERTIFICATE_INSTALLED'] ){
|
|
@unlink( '/srv/etc/ssl/certs/host.crt' );
|
|
rename( $target_file, '/srv/etc/ssl/certs/host.crt' );
|
|
} else {
|
|
rename( $target_file, '/srv/etc/ssl/certs/host.crt' );
|
|
$SYS_CONFIG['NGINX_CERTIFICATE_INSTALLED'] = true;
|
|
save_system_config();
|
|
};
|
|
if( $SYS_CONFIG['NGINX_CERTIFICATE_ENABLED'] ){
|
|
// must restart NGINX
|
|
create_cron_task( 14 );
|
|
};
|
|
};
|
|
print_PAGE_BOTTOM();
|
|
?>
|