$Host = $FileDate = ""; if (($handle = fopen($uploadfile, "r")) !== FALSE) { while (($data = fgetcsv($handle, 1000, "\t")) !== FALSE) { if ($row == 1) { $Row1Array = explode(" ", $data[0]); $FileDate = $Row1Array[0] . " " . $Row1Array[1] . " " . $Row1Array[2]; $Host = trim($Row1Array[9], "\\"); } $row++; $groupname = addslashes($data[0]); $comment = addslashes($data[1]); $groupmember = addslashes($data[3]); if ($row > 4) { $sql = "INSERT INTO dumpsec_group_table (\n\t\t\t\t\tAgency,\n\t\t\t\t\tFileDate,\n\t\t\t\t\tFileName,\n\t\t\t\t\tHost,\n\t\t\t\t\tGroupName,\n\t\t\t\t\tComment,\n\t\t\t\t\tGroupType,\n\t\t\t\t\tGroupMember,\n\t\t\t\t\tMemberType\n\t\t\t\t) VALUES (\n\t\t\t\t\t'{$agency}',\n\t\t\t\t\t'{$FileDate}', \n\t\t\t\t\t'{$filename}',\n\t\t\t\t\t'{$Host}',\n\t\t\t\t\t'{$groupname}','{$comment}','{$data['2']}','{$groupmember}','{$data['4']}'\n\t\t\t\t)"; $results = $db->query($sql); ifDBError($results); } } //end while fclose($handle); } } ?> </td></tr></table> </body></html> <?php function ifDBError($error) { if (PEAR::isError($error)) { echo 'Standard Message: ' . $error->getMessage() . "</br>";
$result = $db->query($sql); ifDBError($result); } } } } /* Find the scan start and end time from all scan start and end times collected. */ sort($startScanArray); $scan_start = $startScanArray[0]; rsort($endScanArray); $scan_end = $endScanArray[0]; $sql = "UPDATE nessus_compliance_results SET scan_start = '{$scan_start}', scan_end = '{$scan_end}' WHERE scan_start = '{$randValue}' AND scan_end = '{$randValue}'"; $result = $db->query($sql); ifDBError($result); ?> <table cellspacing="5" cellpadding="5" width="600"> <tr> <td colspan="2"> <form enctype="multipart/form-data" action="parseComplianceAudit.php" method="POST"> <input type="hidden" name="MAX_FILE_SIZE" value="2000000000" /> <img src="images/nessus_logo.png"></img> <p>The Nessus .audit file is used in a compliance scan and is the only place where the Compliance Type can be found. It will be uploaded and parsed adding this information to the database.</p> </td> </tr> <tr> <td><p>Select .audit compliance file: </p></td><td><input name="userfile" type="file" /></td> </tr> <tr> <td></td>