summaryrefslogtreecommitdiff
path: root/handler/admin/AutoDelete.php
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2024-01-31 06:11:00 +0300
committerEvgeny Zinoviev <me@ch1p.io>2024-01-31 20:45:40 +0300
commitc0dc531ebefd8912819f3b6c8bda1fed3c7e750c (patch)
tree2c75aa9df182260aef09faf4befd81a4c2b9c5e2 /handler/admin/AutoDelete.php
parent48d688cdf7f9eae1bf11b8a6f0e5b98687c604cb (diff)
make it simple, but not simpler
Diffstat (limited to 'handler/admin/AutoDelete.php')
-rw-r--r--handler/admin/AutoDelete.php34
1 files changed, 0 insertions, 34 deletions
diff --git a/handler/admin/AutoDelete.php b/handler/admin/AutoDelete.php
deleted file mode 100644
index 80c8eef..0000000
--- a/handler/admin/AutoDelete.php
+++ /dev/null
@@ -1,34 +0,0 @@
-<?php
-
-namespace handler\admin;
-
-use csrf;
-use NotFoundException;
-use pages;
-use posts;
-use RedirectResponse;
-use Response;
-
-class AutoDelete extends AdminRequestHandler {
-
- public function get(): Response {
- list($name) = $this->input('short_name');
-
- $post = posts::getPostByName($name);
- if ($post) {
- csrf::check('delpost'.$post->id);
- posts::delete($post);
- return new RedirectResponse('/');
- }
-
- $page = pages::getPageByName($name);
- if ($page) {
- csrf::check('delpage'.$page->shortName);
- pages::delete($page);
- return new RedirectResponse('/');
- }
-
- throw new NotFoundException();
- }
-
-} \ No newline at end of file