Rev 471 | Go to most recent revision | Details | Compare with Previous | 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 | |||
471 | muzer | 12 | if (($page->isUserAdmin($page->getLoggedInUser()) || $post->author->ID == $page->getLoggedInUser()->ID) && $post && $page->isUserNormal($page->getLoggedInUser())) |
295 | tom | 13 | { |
484 | muzer | 14 | $page->query('DELETE FROM ForumPosts WHERE ID = "' . $id . '"'); |
295 | tom | 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 |