Exemple #1
0
 }
 //One IP address or server name is allowed (Patch temporary)
 if (empty($validation_errors['ntp_server']) && $_POST['ntp_server'] != '') {
     $ntp_servers = trim($_POST['ntp_server']);
     $ntp_servers = str_replace(' ', '', $ntp_servers);
     $ntp_servers = explode(",", $ntp_servers);
     if (count($ntp_servers) > 1) {
         $validation_errors['ntp_server'] = _("Error in the 'NTP Server' field (More than one server)");
     }
 }
 //Check Admin IPs
 if (empty($validation_errors['admin_ip']) && empty($validation_errors['system_id'])) {
     $system_id = POST('system_id');
     $admin_ips = array();
     try {
         $general_cnf = Av_center::get_general_configuration($system_id);
         $admin_ips[$general_cnf['data']['admin_ip']['value']] = $general_cnf['data']['admin_ip']['value'];
         $st = Av_center::get_system_status($system_id, 'network');
         foreach ($st['interfaces'] as $i_name => $i_data) {
             if ($i_name != 'lo' && $i_data['ipv4']['address'] != '') {
                 $admin_ips[$i_data['ipv4']['address']] = $i_data['ipv4']['address'];
             }
         }
     } catch (Exception $e) {
     }
     if (!array_key_exists(POST('admin_ip'), $admin_ips)) {
         $validation_errors['admin_ip'] = _('Admin IP not allowed');
     }
 }
 if (is_array($validation_errors) && !empty($validation_errors)) {
     $data['status'] = 'error';