Subversion Repositories taios

Rev

Rev 295 | 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
 
12
if (($page->isUserAdmin($page->getLoggedInUser()) || $post->author->ID == $page->getLoggedInUser()->ID) && $post)
13
{
296 tom 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