|
|
@@ -694,24 +694,16 @@ if (!empty($_POST['save'])) {
|
|
|
$v_security_adv = 'yes';
|
|
|
}
|
|
|
}
|
|
|
- if (empty($_SESSION['error_msg'])) {
|
|
|
- if ($_POST['v_api'] != $_SESSION['API']) {
|
|
|
- $api_status = 'disable';
|
|
|
- if ($_POST['v_api'] == 'yes'){
|
|
|
- $api_status = 'enable';
|
|
|
- }
|
|
|
- exec (HESTIA_CMD."v-change-sys-api ".escapeshellarg($api_status), $output, $return_var);
|
|
|
- check_return_code($return_var,$output);
|
|
|
- unset($output);
|
|
|
- if (empty($_SESSION['error_msg'])) $v_login_style = $_POST['v_api'];
|
|
|
- $v_security_adv = 'yes';
|
|
|
- }
|
|
|
- }
|
|
|
+
|
|
|
if (empty($_SESSION['error_msg'])) {
|
|
|
if ($_POST['v_api_allowed_ip'] != $_SESSION['API_ALLOWED_IP']) {
|
|
|
$ips = array();
|
|
|
foreach(explode("\n",$_POST['v_api_allowed_ip']) as $ip){
|
|
|
- if(filter_var(trim($ip), FILTER_VALIDATE_IP)){
|
|
|
+ if ($ip != "allow-all") {
|
|
|
+ if(filter_var(trim($ip), FILTER_VALIDATE_IP)){
|
|
|
+ $ips[] = trim($ip);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
$ips[] = trim($ip);
|
|
|
}
|
|
|
}
|
|
|
@@ -724,6 +716,21 @@ if (!empty($_POST['save'])) {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ if (empty($_SESSION['error_msg'])) {
|
|
|
+ if ($_POST['v_api'] != $_SESSION['API']) {
|
|
|
+ $api_status = 'disable';
|
|
|
+ if ($_POST['v_api'] == 'yes'){
|
|
|
+ $api_status = 'enable';
|
|
|
+ }
|
|
|
+ exec (HESTIA_CMD."v-change-sys-api ".escapeshellarg($api_status), $output, $return_var);
|
|
|
+ check_return_code($return_var,$output);
|
|
|
+ unset($output);
|
|
|
+ if (empty($_SESSION['error_msg'])) $v_login_style = $_POST['v_api'];
|
|
|
+ $v_security_adv = 'yes';
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// Update SSL certificate
|
|
|
if ((!empty($_POST['v_ssl_crt'])) && (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']))) {
|