$n['body'] = trim($_POST['body']); } // analysis (optional) if (isset($_POST['analysis']) && trim($_POST['analysis']) != '') { $n['analysis'] = trim($_POST['analysis']); } // site (optional) if (isset($_POST['site']) && trim($_POST['site']) != '') { $n['site'] = trim($_POST['site']); } // no errors? if ($errors == '') { // fill in a couple more things $n['reportinguser'] = $_SERVER['PHP_AUTH_USER']; $n['reportingip'] = getenv('REMOTE_ADDR'); $irtdb->addFollowup($_REQUEST['i'], $n); header("REFRESH: 0;idetail.php?i=" . $_REQUEST['i'] . "#latest"); } } // we'll use this to display 'default' values function dv($field) { if (!isset($_REQUEST[$field])) { return; } echo htmlentities($_REQUEST[$field]); } // emits "selected" if $_REQUEST[$name] has $value function sv($name, $value) { if ($_REQUEST[$name] == $value) {
// this is special -- need to create a followup. $h['body'] = trim($_POST['hotlist']); $h['type'] = "hotlist"; } $incidentid = 0; // no errors? if ($errors == '') { // fill in a couple more things $i['reportinguser'] = $_SERVER['PHP_AUTH_USER']; $i['reportingip'] = getenv('REMOTE_ADDR'); $incidentid = $irtdb->addIncident($i); if ($incidentid > 0) { if (!empty($h)) { $h['reportinguser'] = $_SERVER['PHP_AUTH_USER']; $h['reportingip'] = getenv('REMOTE_ADDR'); $irtdb->addFollowup($incidentid, $h); } if (!empty($s)) { $s['reportinguser'] = $_SERVER['PHP_AUTH_USER']; $s['reportingip'] = getenv('REMOTE_ADDR'); $irtdb->addFollowup($incidentid, $s); } } header("REFRESH: 0;idetail.php?i={$incidentid}"); } } // here's our fake incident /*$i['name'] = 'test incident 2'; $i['description'] = 'another test incident'; $i['initialmsg'] = 'youve got warez!'; $i['initialts'] = time() - 36000;