|
694 | 694 | $v_security_adv = 'yes'; |
695 | 695 | } |
696 | 696 | } |
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 | | - } |
| 697 | + |
710 | 698 | if (empty($_SESSION['error_msg'])) { |
711 | 699 | if ($_POST['v_api_allowed_ip'] != $_SESSION['API_ALLOWED_IP']) { |
712 | 700 | $ips = array(); |
713 | 701 | foreach(explode("\n",$_POST['v_api_allowed_ip']) as $ip){ |
714 | | - if(filter_var(trim($ip), FILTER_VALIDATE_IP)){ |
| 702 | + if ($ip != "allow-all") { |
| 703 | + if(filter_var(trim($ip), FILTER_VALIDATE_IP)){ |
| 704 | + $ips[] = trim($ip); |
| 705 | + } |
| 706 | + }else{ |
715 | 707 | $ips[] = trim($ip); |
716 | 708 | } |
717 | 709 | } |
|
724 | 716 | } |
725 | 717 | } |
726 | 718 | } |
| 719 | + |
| 720 | + if (empty($_SESSION['error_msg'])) { |
| 721 | + if ($_POST['v_api'] != $_SESSION['API']) { |
| 722 | + $api_status = 'disable'; |
| 723 | + if ($_POST['v_api'] == 'yes'){ |
| 724 | + $api_status = 'enable'; |
| 725 | + } |
| 726 | + exec (HESTIA_CMD."v-change-sys-api ".escapeshellarg($api_status), $output, $return_var); |
| 727 | + check_return_code($return_var,$output); |
| 728 | + unset($output); |
| 729 | + if (empty($_SESSION['error_msg'])) $v_login_style = $_POST['v_api']; |
| 730 | + $v_security_adv = 'yes'; |
| 731 | + } |
| 732 | + } |
| 733 | + |
727 | 734 | // Update SSL certificate |
728 | 735 | if ((!empty($_POST['v_ssl_crt'])) && (empty($_SESSION['error_msg']))) { |
729 | 736 | 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