From 0720091ca73b9714aab2b38c3682c15a0cbd4533 Mon Sep 17 00:00:00 2001 From: Jesse Morgan Date: Thu, 2 Jun 2011 17:20:54 -0700 Subject: Added pages --- htdocs/moderate/pages/delete.php | 49 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 htdocs/moderate/pages/delete.php (limited to 'htdocs/moderate/pages/delete.php') diff --git a/htdocs/moderate/pages/delete.php b/htdocs/moderate/pages/delete.php new file mode 100644 index 0000000..91ee209 --- /dev/null +++ b/htdocs/moderate/pages/delete.php @@ -0,0 +1,49 @@ + + * + */ + +require_once('../../src/base.inc.php'); + +// Verify User is admin +if (!$_SESSION['currentUser']->isAdmin()) { + header('Location: ' . buildUrl('moderate/')); + exit; +} + +$error = ''; + +$page = false; +if (isset($_GET['id']) and is_numeric($_GET['id'])) { + $page = Page::getById($_GET['id']); + + if ($page !== false and isset($_GET['confirmed'])) { + $page->delete(); + + header('Location: index.php'); + } + +} + +require_once('../src/header.inc.php'); + +echo "

Delete Pages

"; + +if ($page !== false) { + echo "

Are you sure you want to delete " . $page->getTitle() ."?

" + . "

getId() ."&confirmed\">Yes" + . " No

"; + +} else { + echo "

No page to delete.

"; +} + +require_once('../src/footer.inc.php'); + +?> + -- cgit v1.2.3