diff options
Diffstat (limited to 'delpersondo.php')
| -rw-r--r-- | delpersondo.php | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/delpersondo.php b/delpersondo.php new file mode 100644 index 0000000..0af06c7 --- /dev/null +++ b/delpersondo.php @@ -0,0 +1,70 @@ +<?php +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ +?> +<?php +/* vim: set ts=4 sw=4 et : */ + +require_once __DIR__ . "/check_auth.php"; +require_once __DIR__ . "/../includes/common.php"; + +if (!isset($_POST['id']) || !is_numeric($_POST['id']) || intval($_POST['id'] < 1)) { + echo "Ungültiger Aufruf (@1)."; + exit(0); +} +if (!isset($_POST['what'])) { + echo "Ungültiger Aufruf (@2)."; + exit(0); +} +$what = $_POST['what']; + +if ($what === 'orga') { + $sql = "DELETE FROM Personen_Organisationen WHERE Person=? LIMIT 20;"; + $stmt = $mysqli->prepare($sql); + $stmt->bind_param("i", $_POST['id']); + $stmt->execute(); + echo $mysqli->affected_rows; + $stmt->reset(); +} else if ($what === 'event') { + $sql = "DELETE FROM event_participants WHERE persid=? LIMIT 500;"; + $stmt = $mysqli->prepare($sql); + $stmt->bind_param("i", $_POST['id']); + $stmt->execute(); + echo $mysqli->affected_rows; + $stmt->reset(); +} else if ($what === 'email') { + $sql = "DELETE FROM mails WHERE persid=? LIMIT 1000;"; + $stmt = $mysqli->prepare($sql); + $stmt->bind_param("i", $_POST['id']); + $stmt->execute(); + echo $mysqli->affected_rows; + $stmt->reset(); +} else if ($what === 'emailrewrite') { + $sql = "UPDATE mails SET persid=NULL WHERE persid=? LIMIT 1000;"; + $stmt = $mysqli->prepare($sql); + $stmt->bind_param("i", $_POST['id']); + $stmt->execute(); + echo $mysqli->affected_rows; + $stmt->reset(); +} else if ($what === 'person') { + $sql = "DELETE FROM Personen WHERE ID=? LIMIT 1;"; + $stmt = $mysqli->prepare($sql); + $stmt->bind_param("i", $_POST['id']); + $stmt->execute(); + echo $mysqli->affected_rows; + $stmt->reset(); +} else { + echo "Ungültiger Aufruf (@2)."; +} + +exit(0); +?> |
