Rev 296 | Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
295 | tom | 1 | <?php |
2 | |||
3 | require '../_taios.php'; |
||
4 | |||
5 | $page = new Taios_Page('Delete Post', '../'); |
||
6 | |||
7 | $page->checkLoggedIn(); |
||
8 | |||
9 | $id = $page->getGetID(); |
||
10 | $post = $page->getForumPost($id); |
||
11 | |||
12 | if (($page->isUserAdmin($page->getLoggedInUser()) || $post->author->ID == $page->getLoggedInUser()->ID) && $post) |
||
13 | { |
||
14 | $page->query('DELETE FROM ForumCategories WHERE ID = ' . $id); |
||
15 | $page->redirect('index.php'); |
||
16 | } |
||
17 | else |
||
18 | { |
||
19 | if (!$post) |
||
20 | { |
||
21 | $page->drawError('No such forum post, #' . $id); |
||
22 | } |
||
23 | else |
||
24 | { |
||
25 | $page->drawError('You do not have permission to access this page.'); |
||
26 | } |
||
27 | } |
||
28 | |||
29 | ?> |
||
30 |