Ejemplo n.º 1
0
function reconfig_system()
{
    $uuid = Util::get_default_uuid();
    $data['status'] = 'error';
    $data['data'] = _('Error! It was not possible to apply the nfsen configuration.');
    if ($uuid !== FALSE) {
        //If we find a job id, then we try to retrieve the status of the job
        $client = new Alienvault_client();
        $response = $client->server()->nfsen_reconfig();
        $response = @json_decode($response, TRUE);
        //Comunication problem with the API. Error
        if (!$response || $response['status'] == 'error') {
            $exp_msg = $client->get_error_message($response);
            $data['status'] = 'error';
            $data['data'] = _('Error! Nfsen Reconfig was not executed due to an unexpected error.') . ' (' . $exp_msg . ')';
        } else {
            $data['status'] = 'success';
            $data['data'] = '';
        }
    }
    return $data;
}