Subversion Repositories taios

Rev

Rev 213 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
212 tom 1
<?php
2
 
3
require '../_taios.php';
4
 
5
$page = new Taios_Page('Delete Project', '../');
6
 
7
$page->checkLoggedIn();
213 tom 8
$id = $page->getGetID();
212 tom 9
$project = $page->getProject($id);
10
 
11
if (($page->isUserAdmin($page->getLoggedInUser()) || $page->getLoggedInUser()->ID == $project->author->ID) && $project)
12
{
484 muzer 13
    $page->query('DELETE FROM Projects WHERE ID = "' . $id . '"');
212 tom 14
    $page->redirect('index.php');
15
}
16
else
17
{
18
    if (!$project)
19
    {
20
        $page->drawError('No such project, #' . $id);
21
    }
22
    else
23
    {
24
        $page->drawError('You do not have permission to access this page.');
25
    }
26
}
27
 
28
?>