Subversion Repositories taios

Rev

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

<?php

require '../_taios.php';

$page = new Taios_Page('Delete Project', '../');

$page->checkLoggedIn();
$id = $page->getPostID();
$project = $page->getProject($id);

if (($page->isUserAdmin($page->getLoggedInUser()) || $page->getLoggedInUser()->ID == $project->author->ID) && $project)
{
    $page->query('DELETE FROM Projects WHERE ID = ' . $id);
    $page->redirect('index.php');
}
else
{
    if (!$project)
    {
        $page->drawError('No such project, #' . $id);
    }
    else
    {
        $page->drawError('You do not have permission to access this page.');
    }
}

?>