/projects/delete-project-do.php |
---|
0,0 → 1,28 |
<?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.'); |
} |
} |
?> |
/projects/index.php |
---|
49,7 → 49,7 |
write('</table>'); |
if ($page->isUserAdmin($page->getLoggedInUser()) || $user->ID == $project->author->ID) |
{ |
write('<p><a href="edit-project.php?id=' . $project->ID . '">Edit Project</a> · <a href="delete-project.php?id=' . $project->ID . '">Delete Project</a></p>'); |
write('<p><a href="edit-project.php?id=' . $project->ID . '">Edit Project</a> · <a href="delete-project-do.php?id=' . $project->ID . '">Delete Project</a></p>'); |
} |
write('<br />'); |
} |