From e121bbebe3ccd990b66a7b04289adf481a4aa2af Mon Sep 17 00:00:00 2001 From: Jesse Morgan Date: Tue, 30 Aug 2011 12:29:19 -0700 Subject: Working on the moderation schedule iterator --- htdocs/moderate/schedule/delete.php | 49 +++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 htdocs/moderate/schedule/delete.php (limited to 'htdocs/moderate/schedule/delete.php') diff --git a/htdocs/moderate/schedule/delete.php b/htdocs/moderate/schedule/delete.php new file mode 100644 index 0000000..76b8866 --- /dev/null +++ b/htdocs/moderate/schedule/delete.php @@ -0,0 +1,49 @@ + + * + */ + +require_once('../../src/base.inc.php'); + +// Verify User is admin +if (!isset($_SESSION['currentUser']) or !$_SESSION['currentUser']->isAdmin()) { + header('Location: ' . buildUrl('moderate/')); + exit; +} + +$error = ''; + +$user = false; +if (isset($_GET['id']) and is_numeric($_GET['id'])) { + $user = User::getById($_GET['id']); + + if ($user !== false and isset($_GET['confirmed'])) { + $user->delete(); + + header('Location: index.php'); + } + +} + +require_once('../src/header.inc.php'); + +echo "

Delete Users

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

Are you sure you want to delete " . $user->getName() ."?

" + . "

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

"; + +} else { + echo "

No user to delete.

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