$scanType = $scanSettings['SCAN_TYPE']; $scanID = $scanSettings['SCAN_ID']; //#! Check if this is a request to delete scans if (isset($_POST['deleteScan'])) { $scanID = intval($_POST['deleteScan']); wssLog('Receiving delete scan command for scan ID: ', $scanID); if (WsdWpScanner::isValidScan($scanID)) { if (!WsdWpScanner::deleteScan($scanID)) { echo '<script type="text/javascript">alert("Error: Could not delete scan. Scan ID = "+' . $scanID . ');</script>'; } } else { echo '<script type="text/javascript">alert("Invalid scan id provided: "+' . $scanID . ');</script>'; } } elseif (isset($_POST['deleteAllScans'])) { wssLog('Receiving command: delete all scans.'); if (WsdWpScanner::deleteAllScans()) { $eInfo['message'] = 'All scans have been deleted.'; } else { $eInfo['error'] = 'An error occurred while deleting the scans. Please try again in a few moments.'; } } else { // scanType if (isset($_POST['scanType'])) { $type = intval($_POST['scanType']); $eInfo['message'] = $type; $scanSettings = WsdWPScanSettings::getSettings(); $scanProgress = $scanSettings['SCAN_PROGRESS']; $scanState = $scanSettings['SCAN_STATE']; $scanType = $scanSettings['SCAN_TYPE']; $result = WsdWpScanner::registerScan($type); if (-1 == $result) {