Subversion Repositories taios

Rev

Rev 484 | 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
 
493 tom 12
if (($page->isUserAdmin($page->getLoggedInUser()) || $post->author->ID == $page->getLoggedInUser()->ID) && $post && $page->isUserNormal($page->getLoggedInUser())) {
13
    $page->query("DELETE FROM ForumPosts WHERE ID = ?", array($id));
295 tom 14
    $page->redirect('index.php');
493 tom 15
} else {
16
    if (!$post) {
295 tom 17
        $page->drawError('No such forum post, #' . $id);
493 tom 18
    } else {
295 tom 19
        $page->drawError('You do not have permission to access this page.');
20
    }
21
}
22
 
23
?>