예제 #1
0
}
if (_DEBUG) {
    fwrite($dfh, "\nEmailing scan results");
}
// If there are multiple recipients, then they need to have email sent to them
if (count($recipients) > 0) {
    if (!$client->query('jobs.emailResults', _CLIENT_KEY, $profile_id, $recipients, $subject, $output, $format)) {
        die($client->getErrorCode() . ' : ' . $client->getErrorMessage());
    }
} else {
    if (!$client->query('jobs.emailResults', _CLIENT_KEY, $profile_id, '', $subject, $output, $format)) {
        die($client->getErrorCode() . ' : ' . $client->getErrorMessage());
    }
}
// Get duration of the scan to insert into the exempt database
$duration = $nes->call_duration_seconds($nes->scan_start, $nes->scan_end);
if (_RELEASE == "fermi") {
    if (!$client->query('jobs.addExemption', _CLIENT_KEY, $profile_id, $username, $duration)) {
        die($client->getErrorCode() . ' : ' . $client->getErrorMessage());
    }
    if (_DEBUG) {
        fwrite($dfh, "\nInserting scan exemption");
    }
}
// Close the log file handle
if (_DEBUG) {
    fclose($dfh);
}
// And remove the machine list...
if (file_exists($ml)) {
    unlink($ml);