function Attack_atter_deleteall() { $attid = param_num("id"); if (!$attid) { $this->_header(); } $attplan = attack_get($attid); $steps = $_SESSION['steps']; if ($steps['deleteallatter']) { unset($steps['deleteallatter']); $_SESSION['steps'] = $steps; $this->forms['information']['action'] = ""; $this->forms['information']['url'] = $this->backtracking->backlink(); $this->forms['information']['title'] = "alle Angreifer löschen"; $this->forms['information']['message'] = "Angreifer wurden gelöscht!"; $this->forms['information']['style'] = "green"; $this->show('message_information', "alle Angreifer löschen"); } if ($_POST['send']) { if ($_REQUEST['yes_x']) { $sids = split(",", urldecode($_REQUEST['sids'])); if (!count($sids)) { $this->_header(); } atter_delete_bysid($attid, $sids); #save step $steps['deleteallatter'] = 1; $_SESSION['steps'] = $steps; $this->_header("attplan.php?action=deleteallatter&id={$attid}&send"); } else { $this->_header(); } } else { $sids = $_REQUEST['sids']; if (empty($sids)) { $this->_header(); } if (!is_array($sids)) { $sids = split(",", urldecode($sids)); } if (!count($sids)) { $this->_header(); } $scans = getScansBySid($sids); foreach ($scans as $scan) { if ($gala != $scan['gala']) { if ($gala) { $message[$gala] = join(", ", $message[$gala]); } $gala = $scan['gala']; } $message[$gala][] = "(" . $scan['gala'] . ":" . $scan['pos'] . ") " . $scan['nick']; } if ($gala) { $message[$gala] = join(", ", $message[$gala]); } $this->forms['information']['url'] = "attplan.php?id={$attid}&sids=" . urlencode(join(",", $sids)); $this->forms['information']['action'] = "deleteallatter"; $this->forms['information']['title'] = "alle Angreifer löschen"; $this->forms['information']['message'] = "\n <b>" . $attplan['title'] . "</b><br><br>\n zu folgenden Zielen werden die Angreifer gelöscht:<br>" . join("<br>", $message); $this->forms['information']['style'] = "red"; $this->show('message_question', "alle Angreifer löschen"); } }
function targets_delete_bysid($sids) { if (!$sids) { return; } if (!is_array($sids)) { $sids = array($sids); } // Atter löschen atter_delete_bysid($sids); // Targets löschen return query("\n delete from attack_target\n where\n sid IN (" . join(",", $sids) . ")\n "); }