Beispiel #1
0
     echo json_encode($data);
 }
 $can_be_removed = $system_id != $local_id && $ha_enabled == FALSE ? TRUE : FALSE;
 if ($can_be_removed == FALSE) {
     $data['status'] = 'error';
     if ($system_id == $local_id) {
         $data['data'] = _('You are not allowed to delete the local system');
     } else {
         $data['data'] = _('The remove request cannot be processed because you have HA enabled and running');
     }
 } else {
     $data = array();
     $force_delete = TRUE;
     //If we do not confirm the delete, then we check if the system is down
     if (!$confirm) {
         $reachable = Av_center::is_system_reachable($system_id);
         //If the system is down then we'll ask the user for extra confirmation
         if (!$reachable) {
             $force_delete = FALSE;
         }
     }
     //Delete the system
     if ($force_delete) {
         try {
             $res = Av_center::delete_system($system_id);
             // Refresh
             Av_component::report_changes('sensors');
             Av_component::report_changes('servers');
             $data['status'] = 'success';
             $data['data'] = $res;
         } catch (Exception $e) {