mirror of
https://github.com/myvesta/vesta
synced 2025-07-11 07:36:47 -07:00
*Add letsencrypt GUI support
This commit is contained in:
parent
50f1db1abf
commit
48bced28e3
6 changed files with 221 additions and 149 deletions
|
@ -79,6 +79,7 @@ if (!empty($_POST['ok'])) {
|
||||||
$v_ssl_key = $_POST['v_ssl_key'];
|
$v_ssl_key = $_POST['v_ssl_key'];
|
||||||
$v_ssl_ca = $_POST['v_ssl_ca'];
|
$v_ssl_ca = $_POST['v_ssl_ca'];
|
||||||
$v_ssl_home = $data[$v_domain]['SSL_HOME'];
|
$v_ssl_home = $data[$v_domain]['SSL_HOME'];
|
||||||
|
$v_letsencrypt = $_POST['v_letsencrypt'];
|
||||||
$v_stats = escapeshellarg($_POST['v_stats']);
|
$v_stats = escapeshellarg($_POST['v_stats']);
|
||||||
$v_stats_user = $data[$v_domain]['STATS_USER'];
|
$v_stats_user = $data[$v_domain]['STATS_USER'];
|
||||||
$v_stats_password = $data[$v_domain]['STATS_PASSWORD'];
|
$v_stats_password = $data[$v_domain]['STATS_PASSWORD'];
|
||||||
|
@ -96,6 +97,7 @@ if (!empty($_POST['ok'])) {
|
||||||
if ((!empty($_POST['v_ssl'])) || (!empty($_POST['v_elog']))) $v_adv = 'yes';
|
if ((!empty($_POST['v_ssl'])) || (!empty($_POST['v_elog']))) $v_adv = 'yes';
|
||||||
if ((!empty($_POST['v_ssl_crt'])) || (!empty($_POST['v_ssl_key']))) $v_adv = 'yes';
|
if ((!empty($_POST['v_ssl_crt'])) || (!empty($_POST['v_ssl_key']))) $v_adv = 'yes';
|
||||||
if ((!empty($_POST['v_ssl_ca'])) || ($_POST['v_stats'] != 'none')) $v_adv = 'yes';
|
if ((!empty($_POST['v_ssl_ca'])) || ($_POST['v_stats'] != 'none')) $v_adv = 'yes';
|
||||||
|
if ((!empty($_POST['v_letsencrypt']))) $v_adv = 'yes';
|
||||||
|
|
||||||
// Check advanced features
|
// Check advanced features
|
||||||
if (empty($_POST['v_dns'])) $v_dns = 'off';
|
if (empty($_POST['v_dns'])) $v_dns = 'off';
|
||||||
|
@ -144,42 +146,51 @@ if (!empty($_POST['ok'])) {
|
||||||
unset($output);
|
unset($output);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add SSL certificates
|
// Add Lets Encrypt support
|
||||||
if ((!empty($_POST['v_ssl'])) && (empty($_SESSION['error_msg']))) {
|
|
||||||
exec ('mktemp -d', $output, $return_var);
|
|
||||||
$tmpdir = $output[0];
|
|
||||||
unset($output);
|
|
||||||
|
|
||||||
// Save certificate
|
if ((!empty($_POST['v_letsencrypt'])) && (empty($_SESSION['error_msg']))) {
|
||||||
if (!empty($_POST['v_ssl_crt'])) {
|
exec (VESTA_CMD."v-add-letsencrypt-domain ".$user." ".$v_domain." '' 'no'", $output, $return_var);
|
||||||
$fp = fopen($tmpdir."/".$_POST['v_domain'].".crt", 'w');
|
check_return_code($return_var,$output);
|
||||||
fwrite($fp, str_replace("\r\n", "\n", $_POST['v_ssl_crt']));
|
unset($output);
|
||||||
fwrite($fp, "\n");
|
}
|
||||||
fclose($fp);
|
else {
|
||||||
}
|
// Add SSL certificates only if Lets Encrypt is off
|
||||||
|
if ((!empty($_POST['v_ssl'])) && (empty($_SESSION['error_msg']))) {
|
||||||
|
exec ('mktemp -d', $output, $return_var);
|
||||||
|
$tmpdir = $output[0];
|
||||||
|
unset($output);
|
||||||
|
|
||||||
// Save private key
|
// Save certificate
|
||||||
if (!empty($_POST['v_ssl_key'])) {
|
if (!empty($_POST['v_ssl_crt'])) {
|
||||||
$fp = fopen($tmpdir."/".$_POST['v_domain'].".key", 'w');
|
$fp = fopen($tmpdir."/".$_POST['v_domain'].".crt", 'w');
|
||||||
fwrite($fp, str_replace("\r\n", "\n", $_POST['v_ssl_key']));
|
fwrite($fp, str_replace("\r\n", "\n", $_POST['v_ssl_crt']));
|
||||||
fwrite($fp, "\n");
|
fwrite($fp, "\n");
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save CA bundle
|
// Save private key
|
||||||
if (!empty($_POST['v_ssl_ca'])) {
|
if (!empty($_POST['v_ssl_key'])) {
|
||||||
$fp = fopen($tmpdir."/".$_POST['v_domain'].".ca", 'w');
|
$fp = fopen($tmpdir."/".$_POST['v_domain'].".key", 'w');
|
||||||
fwrite($fp, str_replace("\r\n", "\n", $_POST['v_ssl_ca']));
|
fwrite($fp, str_replace("\r\n", "\n", $_POST['v_ssl_key']));
|
||||||
fwrite($fp, "\n");
|
fwrite($fp, "\n");
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
}
|
}
|
||||||
|
|
||||||
$v_ssl_home = escapeshellarg($_POST['v_ssl_home']);
|
// Save CA bundle
|
||||||
exec (VESTA_CMD."v-add-web-domain-ssl ".$user." ".$v_domain." ".$tmpdir." ".$v_ssl_home." 'no'", $output, $return_var);
|
if (!empty($_POST['v_ssl_ca'])) {
|
||||||
check_return_code($return_var,$output);
|
$fp = fopen($tmpdir."/".$_POST['v_domain'].".ca", 'w');
|
||||||
unset($output);
|
fwrite($fp, str_replace("\r\n", "\n", $_POST['v_ssl_ca']));
|
||||||
}
|
fwrite($fp, "\n");
|
||||||
|
fclose($fp);
|
||||||
|
}
|
||||||
|
|
||||||
|
$v_ssl_home = escapeshellarg($_POST['v_ssl_home']);
|
||||||
|
exec (VESTA_CMD."v-add-web-domain-ssl ".$user." ".$v_domain." ".$tmpdir." ".$v_ssl_home." 'no'", $output, $return_var);
|
||||||
|
check_return_code($return_var,$output);
|
||||||
|
unset($output);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
// Add web stats
|
// Add web stats
|
||||||
if ((!empty($_POST['v_stats'])) && ($_POST['v_stats'] != 'none' ) && (empty($_SESSION['error_msg']))) {
|
if ((!empty($_POST['v_stats'])) && ($_POST['v_stats'] != 'none' ) && (empty($_SESSION['error_msg']))) {
|
||||||
$v_stats = escapeshellarg($_POST['v_stats']);
|
$v_stats = escapeshellarg($_POST['v_stats']);
|
||||||
|
|
|
@ -35,7 +35,8 @@ $v_tpl = $data[$v_domain]['IP'];
|
||||||
$v_cgi = $data[$v_domain]['CGI'];
|
$v_cgi = $data[$v_domain]['CGI'];
|
||||||
$v_elog = $data[$v_domain]['ELOG'];
|
$v_elog = $data[$v_domain]['ELOG'];
|
||||||
$v_ssl = $data[$v_domain]['SSL'];
|
$v_ssl = $data[$v_domain]['SSL'];
|
||||||
if ( $v_ssl == 'yes' ) {
|
$v_letsencrypt = $data[$v_domain]['LETSENCRYPT'];
|
||||||
|
if ( $v_ssl == 'yes' && ($v_letsencrypt == 'no' || empty($v_letsencrypt))) {
|
||||||
exec (VESTA_CMD."v-list-web-domain-ssl ".$user." '".$v_domain."' json", $output, $return_var);
|
exec (VESTA_CMD."v-list-web-domain-ssl ".$user." '".$v_domain."' json", $output, $return_var);
|
||||||
$ssl_str = json_decode(implode('', $output), true);
|
$ssl_str = json_decode(implode('', $output), true);
|
||||||
unset($output);
|
unset($output);
|
||||||
|
@ -256,139 +257,159 @@ if (!empty($_POST['save'])) {
|
||||||
$restart_proxy = 'yes';
|
$restart_proxy = 'yes';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Delete SSL certificate
|
// Disable Lets Encrypt support
|
||||||
if (( $v_ssl == 'yes' ) && (empty($_POST['v_ssl'])) && (empty($_SESSION['error_msg']))) {
|
|
||||||
exec (VESTA_CMD."v-delete-web-domain-ssl ".$v_username." ".$v_domain." 'no'", $output, $return_var);
|
if (( $v_letsencrypt == 'yes' ) && (empty($_POST['v_letsencrypt'])) && (!empty($_POST['v_letsencrypt'])) && (empty($_SESSION['error_msg']))) {
|
||||||
|
exec (VESTA_CMD."v-add-letsencrypt-domain ".$user." ".$v_domain." '' 'no'", $output, $return_var);
|
||||||
check_return_code($return_var,$output);
|
check_return_code($return_var,$output);
|
||||||
unset($output);
|
unset($output);
|
||||||
$v_ssl = 'no';
|
$v_letsencrypt = 'no';
|
||||||
$restart_web = 'yes';
|
$restart_web = 'yes';
|
||||||
$restart_proxy = 'yes';
|
$restart_proxy = 'yes';
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
// Change SSL certificate
|
// Delete SSL certificate
|
||||||
if (($v_ssl == 'yes') && (!empty($_POST['v_ssl'])) && (empty($_SESSION['error_msg']))) {
|
if (( $v_ssl == 'yes' ) && (empty($_POST['v_ssl'])) && (empty($_SESSION['error_msg']))) {
|
||||||
if (( $v_ssl_crt != str_replace("\r\n", "\n", $_POST['v_ssl_crt'])) || ( $v_ssl_key != str_replace("\r\n", "\n", $_POST['v_ssl_key'])) || ( $v_ssl_ca != str_replace("\r\n", "\n", $_POST['v_ssl_ca']))) {
|
exec (VESTA_CMD."v-delete-web-domain-ssl ".$v_username." ".$v_domain." 'no'", $output, $return_var);
|
||||||
exec ('mktemp -d', $mktemp_output, $return_var);
|
|
||||||
$tmpdir = $mktemp_output[0];
|
|
||||||
|
|
||||||
// Certificate
|
|
||||||
if (!empty($_POST['v_ssl_crt'])) {
|
|
||||||
$fp = fopen($tmpdir."/".$_POST['v_domain'].".crt", 'w');
|
|
||||||
fwrite($fp, str_replace("\r\n", "\n", $_POST['v_ssl_crt']));
|
|
||||||
fwrite($fp, "\n");
|
|
||||||
fclose($fp);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Key
|
|
||||||
if (!empty($_POST['v_ssl_key'])) {
|
|
||||||
$fp = fopen($tmpdir."/".$_POST['v_domain'].".key", 'w');
|
|
||||||
fwrite($fp, str_replace("\r\n", "\n", $_POST['v_ssl_key']));
|
|
||||||
fwrite($fp, "\n");
|
|
||||||
fclose($fp);
|
|
||||||
}
|
|
||||||
|
|
||||||
// CA
|
|
||||||
if (!empty($_POST['v_ssl_ca'])) {
|
|
||||||
$fp = fopen($tmpdir."/".$_POST['v_domain'].".ca", 'w');
|
|
||||||
fwrite($fp, str_replace("\r\n", "\n", $_POST['v_ssl_ca']));
|
|
||||||
fwrite($fp, "\n");
|
|
||||||
fclose($fp);
|
|
||||||
}
|
|
||||||
|
|
||||||
exec (VESTA_CMD."v-change-web-domain-sslcert ".$user." ".$v_domain." ".$tmpdir." 'no'", $output, $return_var);
|
|
||||||
check_return_code($return_var,$output);
|
check_return_code($return_var,$output);
|
||||||
unset($output);
|
unset($output);
|
||||||
|
$v_ssl = 'no';
|
||||||
$restart_web = 'yes';
|
$restart_web = 'yes';
|
||||||
$restart_proxy = 'yes';
|
$restart_proxy = 'yes';
|
||||||
$v_ssl_crt = $_POST['v_ssl_crt'];
|
|
||||||
$v_ssl_key = $_POST['v_ssl_key'];
|
|
||||||
$v_ssl_ca = $_POST['v_ssl_ca'];
|
|
||||||
|
|
||||||
// Cleanup certificate tempfiles
|
|
||||||
if (!empty($_POST['v_ssl_crt'])) {
|
|
||||||
unlink($tmpdir."/".$_POST['v_domain'].".crt");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!empty($_POST['v_ssl_key'])) {
|
|
||||||
unlink($tmpdir."/".$_POST['v_domain'].".key");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!empty($_POST['v_ssl_ca'])) {
|
|
||||||
unlink($tmpdir."/".$_POST['v_domain'].".ca");
|
|
||||||
}
|
|
||||||
|
|
||||||
rmdir($tmpdir);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (( $v_letsencrypt == 'no' || empty( $v_letsencrypt)) && (!empty($_POST['v_letsencrypt'])) && empty($_SESSION['error_msg'])) {
|
||||||
|
exec (VESTA_CMD."v-add-letsencrypt-domain ".$user." ".$v_domain." '' 'no'", $output, $return_var);
|
||||||
|
check_return_code($return_var,$output);
|
||||||
|
unset($output);
|
||||||
|
$v_letsencrypt = 'yes';
|
||||||
|
$restart_web = 'yes';
|
||||||
|
$restart_proxy = 'yes';
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
// Change SSL certificate
|
||||||
|
if (($v_ssl == 'yes') && (!empty($_POST['v_ssl'])) && (empty($_SESSION['error_msg']))) {
|
||||||
|
if (( $v_ssl_crt != str_replace("\r\n", "\n", $_POST['v_ssl_crt'])) || ( $v_ssl_key != str_replace("\r\n", "\n", $_POST['v_ssl_key'])) || ( $v_ssl_ca != str_replace("\r\n", "\n", $_POST['v_ssl_ca']))) {
|
||||||
|
exec ('mktemp -d', $mktemp_output, $return_var);
|
||||||
|
$tmpdir = $mktemp_output[0];
|
||||||
|
|
||||||
// Add SSL certificate
|
// Certificate
|
||||||
if (( $v_ssl == 'no') && (!empty($_POST['v_ssl'])) && (empty($_SESSION['error_msg']))) {
|
if (!empty($_POST['v_ssl_crt'])) {
|
||||||
if ((!empty($_POST['v_ssl'])) && (empty($_POST['v_ssl_crt']))) $errors[] = 'ssl certificate';
|
$fp = fopen($tmpdir."/".$_POST['v_domain'].".crt", 'w');
|
||||||
if ((!empty($_POST['v_ssl'])) && (empty($_POST['v_ssl_key']))) $errors[] = 'ssl key';
|
fwrite($fp, str_replace("\r\n", "\n", $_POST['v_ssl_crt']));
|
||||||
if ((!empty($_POST['v_ssl'])) && (empty($_POST['v_ssl_home']))) $errors[] = 'ssl home';
|
fwrite($fp, "\n");
|
||||||
$v_ssl_home = escapeshellarg($_POST['v_ssl_home']);
|
fclose($fp);
|
||||||
if (!empty($errors[0])) {
|
}
|
||||||
foreach ($errors as $i => $error) {
|
|
||||||
if ( $i == 0 ) {
|
|
||||||
$error_msg = $error;
|
|
||||||
} else {
|
|
||||||
$error_msg = $error_msg.", ".$error;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$_SESSION['error_msg'] = __('Field "%s" can not be blank.',$error_msg);
|
|
||||||
} else {
|
|
||||||
exec ('mktemp -d', $mktemp_output, $return_var);
|
|
||||||
$tmpdir = $mktemp_output[0];
|
|
||||||
|
|
||||||
// Certificate
|
// Key
|
||||||
if (!empty($_POST['v_ssl_crt'])) {
|
if (!empty($_POST['v_ssl_key'])) {
|
||||||
$fp = fopen($tmpdir."/".$_POST['v_domain'].".crt", 'w');
|
$fp = fopen($tmpdir."/".$_POST['v_domain'].".key", 'w');
|
||||||
fwrite($fp, str_replace("\r\n", "\n", $_POST['v_ssl_crt']));
|
fwrite($fp, str_replace("\r\n", "\n", $_POST['v_ssl_key']));
|
||||||
fclose($fp);
|
fwrite($fp, "\n");
|
||||||
}
|
fclose($fp);
|
||||||
|
}
|
||||||
|
|
||||||
// Key
|
// CA
|
||||||
if (!empty($_POST['v_ssl_key'])) {
|
if (!empty($_POST['v_ssl_ca'])) {
|
||||||
$fp = fopen($tmpdir."/".$_POST['v_domain'].".key", 'w');
|
$fp = fopen($tmpdir."/".$_POST['v_domain'].".ca", 'w');
|
||||||
fwrite($fp, str_replace("\r\n", "\n", $_POST['v_ssl_key']));
|
fwrite($fp, str_replace("\r\n", "\n", $_POST['v_ssl_ca']));
|
||||||
fclose($fp);
|
fwrite($fp, "\n");
|
||||||
}
|
fclose($fp);
|
||||||
|
}
|
||||||
|
|
||||||
// CA
|
exec (VESTA_CMD."v-change-web-domain-sslcert ".$user." ".$v_domain." ".$tmpdir." 'no'", $output, $return_var);
|
||||||
if (!empty($_POST['v_ssl_ca'])) {
|
check_return_code($return_var,$output);
|
||||||
$fp = fopen($tmpdir."/".$_POST['v_domain'].".ca", 'w');
|
unset($output);
|
||||||
fwrite($fp, str_replace("\r\n", "\n", $_POST['v_ssl_ca']));
|
$restart_web = 'yes';
|
||||||
fclose($fp);
|
$restart_proxy = 'yes';
|
||||||
}
|
$v_ssl_crt = $_POST['v_ssl_crt'];
|
||||||
exec (VESTA_CMD."v-add-web-domain-ssl ".$user." ".$v_domain." ".$tmpdir." ".$v_ssl_home." 'no'", $output, $return_var);
|
$v_ssl_key = $_POST['v_ssl_key'];
|
||||||
check_return_code($return_var,$output);
|
$v_ssl_ca = $_POST['v_ssl_ca'];
|
||||||
unset($output);
|
|
||||||
$v_ssl = 'yes';
|
|
||||||
$restart_web = 'yes';
|
|
||||||
$restart_proxy = 'yes';
|
|
||||||
$v_ssl_crt = $_POST['v_ssl_crt'];
|
|
||||||
$v_ssl_key = $_POST['v_ssl_key'];
|
|
||||||
$v_ssl_ca = $_POST['v_ssl_ca'];
|
|
||||||
$v_ssl_home = $_POST['v_ssl_home'];
|
|
||||||
|
|
||||||
// Cleanup certificate tempfiles
|
// Cleanup certificate tempfiles
|
||||||
if (!empty($_POST['v_ssl_crt'])) {
|
if (!empty($_POST['v_ssl_crt'])) {
|
||||||
unlink($tmpdir."/".$_POST['v_domain'].".crt");
|
unlink($tmpdir."/".$_POST['v_domain'].".crt");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($_POST['v_ssl_key'])) {
|
if (!empty($_POST['v_ssl_key'])) {
|
||||||
unlink($tmpdir."/".$_POST['v_domain'].".key");
|
unlink($tmpdir."/".$_POST['v_domain'].".key");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($_POST['v_ssl_ca'])) {
|
if (!empty($_POST['v_ssl_ca'])) {
|
||||||
unlink($tmpdir."/".$_POST['v_domain'].".ca");
|
unlink($tmpdir."/".$_POST['v_domain'].".ca");
|
||||||
}
|
}
|
||||||
|
|
||||||
rmdir($tmpdir);
|
rmdir($tmpdir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add SSL certificate
|
||||||
|
if (( $v_ssl == 'no') && (!empty($_POST['v_ssl'])) && (empty($_SESSION['error_msg']))) {
|
||||||
|
if ((!empty($_POST['v_ssl'])) && (empty($_POST['v_ssl_crt']))) $errors[] = 'ssl certificate';
|
||||||
|
if ((!empty($_POST['v_ssl'])) && (empty($_POST['v_ssl_key']))) $errors[] = 'ssl key';
|
||||||
|
if ((!empty($_POST['v_ssl'])) && (empty($_POST['v_ssl_home']))) $errors[] = 'ssl home';
|
||||||
|
$v_ssl_home = escapeshellarg($_POST['v_ssl_home']);
|
||||||
|
if (!empty($errors[0])) {
|
||||||
|
foreach ($errors as $i => $error) {
|
||||||
|
if ( $i == 0 ) {
|
||||||
|
$error_msg = $error;
|
||||||
|
} else {
|
||||||
|
$error_msg = $error_msg.", ".$error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$_SESSION['error_msg'] = __('Field "%s" can not be blank.',$error_msg);
|
||||||
|
} else {
|
||||||
|
exec ('mktemp -d', $mktemp_output, $return_var);
|
||||||
|
$tmpdir = $mktemp_output[0];
|
||||||
|
|
||||||
|
// Certificate
|
||||||
|
if (!empty($_POST['v_ssl_crt'])) {
|
||||||
|
$fp = fopen($tmpdir."/".$_POST['v_domain'].".crt", 'w');
|
||||||
|
fwrite($fp, str_replace("\r\n", "\n", $_POST['v_ssl_crt']));
|
||||||
|
fclose($fp);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Key
|
||||||
|
if (!empty($_POST['v_ssl_key'])) {
|
||||||
|
$fp = fopen($tmpdir."/".$_POST['v_domain'].".key", 'w');
|
||||||
|
fwrite($fp, str_replace("\r\n", "\n", $_POST['v_ssl_key']));
|
||||||
|
fclose($fp);
|
||||||
|
}
|
||||||
|
|
||||||
|
// CA
|
||||||
|
if (!empty($_POST['v_ssl_ca'])) {
|
||||||
|
$fp = fopen($tmpdir."/".$_POST['v_domain'].".ca", 'w');
|
||||||
|
fwrite($fp, str_replace("\r\n", "\n", $_POST['v_ssl_ca']));
|
||||||
|
fclose($fp);
|
||||||
|
}
|
||||||
|
exec (VESTA_CMD."v-add-web-domain-ssl ".$user." ".$v_domain." ".$tmpdir." ".$v_ssl_home." 'no'", $output, $return_var);
|
||||||
|
check_return_code($return_var,$output);
|
||||||
|
unset($output);
|
||||||
|
$v_ssl = 'yes';
|
||||||
|
$restart_web = 'yes';
|
||||||
|
$restart_proxy = 'yes';
|
||||||
|
$v_ssl_crt = $_POST['v_ssl_crt'];
|
||||||
|
$v_ssl_key = $_POST['v_ssl_key'];
|
||||||
|
$v_ssl_ca = $_POST['v_ssl_ca'];
|
||||||
|
$v_ssl_home = $_POST['v_ssl_home'];
|
||||||
|
|
||||||
|
// Cleanup certificate tempfiles
|
||||||
|
if (!empty($_POST['v_ssl_crt'])) {
|
||||||
|
unlink($tmpdir."/".$_POST['v_domain'].".crt");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($_POST['v_ssl_key'])) {
|
||||||
|
unlink($tmpdir."/".$_POST['v_domain'].".key");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($_POST['v_ssl_ca'])) {
|
||||||
|
unlink($tmpdir."/".$_POST['v_domain'].".ca");
|
||||||
|
}
|
||||||
|
|
||||||
|
rmdir($tmpdir);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
// Change document root for ssl domain
|
// Change document root for ssl domain
|
||||||
if (( $v_ssl == 'yes') && (!empty($_POST['v_ssl'])) && (empty($_SESSION['error_msg']))) {
|
if (( $v_ssl == 'yes') && (!empty($_POST['v_ssl'])) && (empty($_SESSION['error_msg']))) {
|
||||||
if ( $v_ssl_home != $_POST['v_ssl_home'] ) {
|
if ( $v_ssl_home != $_POST['v_ssl_home'] ) {
|
||||||
|
|
|
@ -151,6 +151,21 @@ App.Actions.WEB.toggle_additional_ftp_accounts = function(elm) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
App.Actions.WEB.toggle_letsencrypt = function(elm) {
|
||||||
|
if ($(elm).attr('checked')) {
|
||||||
|
$('#ssltable textarea[name=v_ssl_crt],#ssltable textarea[name=v_ssl_key], #ssltable textarea[name=v_ssl_ca]').attr('disabled', 'disabled');
|
||||||
|
$('input[name=v_ssl]').prop('checked', true);
|
||||||
|
$('#ssltable').show();
|
||||||
|
$('#generate-csr').hide();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$('#ssltable textarea[name=v_ssl_crt],#ssltable textarea[name=v_ssl_key], #ssltable textarea[name=v_ssl_ca]').removeAttr('disabled');
|
||||||
|
$('input[name=v_ssl]').prop('checked', false);
|
||||||
|
$('#ssltable').hide();
|
||||||
|
$('#generate-csr').show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Page entry point
|
// Page entry point
|
||||||
App.Listeners.WEB.keypress_ftp_username();
|
App.Listeners.WEB.keypress_ftp_username();
|
||||||
|
|
|
@ -132,6 +132,21 @@ App.Actions.WEB.toggle_additional_ftp_accounts = function(elm) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
App.Actions.WEB.toggle_letsencrypt = function(elm) {
|
||||||
|
if ($(elm).attr('checked')) {
|
||||||
|
$('#ssltable textarea[name=v_ssl_crt],#ssltable textarea[name=v_ssl_key], #ssltable textarea[name=v_ssl_ca]').attr('disabled', 'disabled');
|
||||||
|
$('input[name=v_ssl]').prop('checked', true);
|
||||||
|
$('#ssltable').show();
|
||||||
|
$('#generate-csr').hide();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$('#ssltable textarea[name=v_ssl_crt],#ssltable textarea[name=v_ssl_key], #ssltable textarea[name=v_ssl_ca]').removeAttr('disabled');
|
||||||
|
$('input[name=v_ssl]').prop('checked', false);
|
||||||
|
$('#ssltable').hide();
|
||||||
|
$('#generate-csr').show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
App.Actions.WEB.randomPasswordGenerated = function(elm) {
|
App.Actions.WEB.randomPasswordGenerated = function(elm) {
|
||||||
return App.Actions.WEB.passwordChanged(elm);
|
return App.Actions.WEB.passwordChanged(elm);
|
||||||
}
|
}
|
||||||
|
|
|
@ -128,7 +128,7 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td class="step-top vst-text">
|
<td class="step-top vst-text">
|
||||||
<label><input type="checkbox" size="20" class="vst-checkbox" name="v_ssl" <?php if($v_ssl == 'yes' || $v_ssl == 'on') echo "checked=yes" ?> onclick="javascript:elementHideShow('ssltable');"> <?php print __('SSL Support');?></label> /
|
<label><input type="checkbox" size="20" class="vst-checkbox" name="v_ssl" <?php if($v_ssl == 'yes' || $v_ssl == 'on') echo "checked=yes" ?> onclick="javascript:elementHideShow('ssltable');"> <?php print __('SSL Support');?></label> /
|
||||||
<a class="generate" target="_blank" href="/generate/ssl/"><?php print __('Generate CSR') ?></a>
|
<a class="generate" id="generate-csr" target="_blank" href="/generate/ssl/"><?php print __('Generate CSR') ?></a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -184,6 +184,11 @@
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="step-top vst-text">
|
||||||
|
<label><input type="checkbox" size="20" class="vst-checkbox" name="v_letencrypt" <?php if($v_letencrypt == 'yes' || $v_letencrypt == 'on') echo "checked=yes" ?> onclick="App.Actions.WEB.toggle_letsencrypt(this)"> <?php print __('Lets Encrypt Support');?></label>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="vst-text step-top">
|
<td class="vst-text step-top">
|
||||||
<?php print __('Web Statistics');?>
|
<?php print __('Web Statistics');?>
|
||||||
|
|
|
@ -186,7 +186,7 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td class="vst-text step-top">
|
<td class="vst-text step-top">
|
||||||
<label><input type="checkbox" size="20" class="vst-checkbox" name="v_ssl" <?php if ($v_ssl == 'yes') echo "checked=yes" ?> onclick="javascript:elementHideShow('ssltable');"> <?php print __('SSL Support');?></label> /
|
<label><input type="checkbox" size="20" class="vst-checkbox" name="v_ssl" <?php if ($v_ssl == 'yes') echo "checked=yes" ?> onclick="javascript:elementHideShow('ssltable');"> <?php print __('SSL Support');?></label> /
|
||||||
<a class="generate" target="_blank" href="/generate/ssl/?domain=<?php echo $v_domain ?>"><?php print __('Generate CSR') ?></a>
|
<a class="generate" id="generate-csr" target="_blank" href="/generate/ssl/?domain=<?php echo $v_domain ?>"><?php print __('Generate CSR') ?></a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -243,6 +243,11 @@
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="step-top vst-text">
|
||||||
|
<label><input type="checkbox" size="20" class="vst-checkbox" name="v_letencrypt" <?php if($v_letencrypt == 'yes' || $v_letencrypt == 'on') echo "checked=yes" ?> onclick="App.Actions.WEB.toggle_letsencrypt(this)"> <?php print __('Lets Encrypt Support');?></label>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="vst-text step-top">
|
<td class="vst-text step-top">
|
||||||
<?php print __('Web Statistics');?>
|
<?php print __('Web Statistics');?>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue