|
432 | 432 |
|
433 | 433 | // Update send notification setting |
434 | 434 | if (empty($_SESSION['error_msg'])) { |
435 | | - if ($_POST['v_upgrade_send_notification_email'] != $_SESSION['UPGRADE_SEND_EMAIL']) { |
| 435 | + if ( $_SESSION['UPGRADE_SEND_EMAIL'] == 'true' ){ $ugrade_send_mail = 'on'; }else{ $ugrade_send_mail = ''; } |
| 436 | + if ( $_POST['v_upgrade_send_notification_email'] != $ugrade_send_mail ) { |
436 | 437 | if ($_POST['v_upgrade_send_notification_email'] == 'on') { $_POST['v_upgrade_send_notification_email'] = 'true'; } else { $_POST['v_upgrade_send_notification_email'] = 'false'; } |
437 | 438 | exec (HESTIA_CMD."v-change-sys-config-value UPGRADE_SEND_EMAIL ".escapeshellarg($_POST['v_upgrade_send_notification_email']), $output, $return_var); |
438 | 439 | check_return_code($return_var,$output); |
|
443 | 444 |
|
444 | 445 | // Update send log by email setting |
445 | 446 | if (empty($_SESSION['error_msg'])) { |
446 | | - if ($_POST['v_upgrade_send_email_log'] != $_SESSION['UPGRADE_SEND_EMAIL_LOG']) { |
| 447 | + if ( $_SESSION['UPGRADE_SEND_EMAIL_LOG'] == 'true' ){ $send_email_log = 'on'; }else{ $send_email_log = ''; } |
| 448 | + if ( $_POST['v_upgrade_send_email_log'] != $send_email_log ) { |
447 | 449 | if ($_POST['v_upgrade_send_email_log'] == 'on') { $_POST['v_upgrade_send_email_log'] = 'true'; } else { $_POST['v_upgrade_send_email_log'] = 'false'; } |
448 | 450 | exec (HESTIA_CMD."v-change-sys-config-value UPGRADE_SEND_EMAIL_LOG ".escapeshellarg($_POST['v_upgrade_send_email_log']), $output, $return_var); |
449 | 451 | check_return_code($return_var,$output); |
|
515 | 517 | unset($output); |
516 | 518 | */ |
517 | 519 | if (empty($_SESSION['error_msg'])) $v_backup_dir = $_POST['v_backup_dir']; |
518 | | - $v_backup_adv = 'yes'; |
| 520 | + #$v_backup_adv = 'yes'; |
519 | 521 | } |
520 | 522 | } |
521 | 523 |
|
|
673 | 675 |
|
674 | 676 | // Change ENFORCE_SUBDOMAIN_OWNERSHIP |
675 | 677 | if (empty($_SESSION['error_msg'])) { |
676 | | - if ($_POST['v_enforce_subdomain_ownership'] != $_SESSION['v_enforce_subdomain_ownership']) { |
| 678 | + if ($_POST['v_enforce_subdomain_ownership'] != $_SESSION['ENFORCE_SUBDOMAIN_OWNERSHIP']) { |
677 | 679 | exec (HESTIA_CMD."v-change-sys-config-value ENFORCE_SUBDOMAIN_OWNERSHIP ".escapeshellarg($_POST['v_enforce_subdomain_ownership']), $output, $return_var); |
678 | 680 | check_return_code($return_var,$output); |
679 | 681 | unset($output); |
|
692 | 694 | $v_security_adv = 'yes'; |
693 | 695 | } |
694 | 696 | } |
695 | | - |
| 697 | + if (empty($_SESSION['error_msg'])) { |
| 698 | + if ($_POST['v_api'] != $_SESSION['API']) { |
| 699 | + $api_status = 'disable'; |
| 700 | + if ($_POST['v_api'] == 'yes'){ |
| 701 | + $api_status = 'enable'; |
| 702 | + } |
| 703 | + exec (HESTIA_CMD."v-change-sys-api ".escapeshellarg($api_status), $output, $return_var); |
| 704 | + check_return_code($return_var,$output); |
| 705 | + unset($output); |
| 706 | + if (empty($_SESSION['error_msg'])) $v_login_style = $_POST['v_api']; |
| 707 | + $v_security_adv = 'yes'; |
| 708 | + } |
| 709 | + } |
| 710 | + if (empty($_SESSION['error_msg'])) { |
| 711 | + if ($_POST['v_api_allowed_ip'] != $_SESSION['API_ALLOWED_IP']) { |
| 712 | + $ips = array(); |
| 713 | + foreach(explode("\n",$_POST['v_api_allowed_ip']) as $ip){ |
| 714 | + if(filter_var(trim($ip), FILTER_VALIDATE_IP)){ |
| 715 | + $ips[] = trim($ip); |
| 716 | + } |
| 717 | + } |
| 718 | + if(implode(',',$ips) != $_SESSION['API_ALLOWED_IP']){ |
| 719 | + exec (HESTIA_CMD."v-change-sys-config-value API_ALLOWED_IP ".escapeshellarg(implode(',',$ips)), $output, $return_var); |
| 720 | + check_return_code($return_var,$output); |
| 721 | + unset($output); |
| 722 | + if (empty($_SESSION['error_msg'])) $v_login_style = $_POST['v_api_allowed_ip']; |
| 723 | + $v_security_adv = 'yes'; |
| 724 | + } |
| 725 | + } |
| 726 | + } |
696 | 727 | // Update SSL certificate |
697 | 728 | if ((!empty($_POST['v_ssl_crt'])) && (empty($_SESSION['error_msg']))) { |
698 | 729 | 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']))) { |
|
0 commit comments