Example #1
0
     }
 } 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) {
             $data['status'] = 'error';
             $data['data'] = $e->getMessage();
         }
     } else {
         //Ask for confirmation
         $data['status'] = 'confirm';
         $data['data'] = '';
     }
 }