(root)/projects/delete-project-do.php - Rev 492
Rev 484 |
Blame |
Compare with Previous |
Last modification |
View Log
| RSS feed
<?php
require '../_taios.php';
$page = new Taios_Page
('Delete Project', '../');
$page->checkLoggedIn();
$id = $page->getGetID();
$project = $page->getProject($id);
if (($page->isUserAdmin($page->getLoggedInUser()) || $page->getLoggedInUser()->ID == $project->author->ID) && $project) {
$page->query("DELETE FROM Projects WHERE ID = ?", array($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.');
}
}
?>