diff options
Diffstat (limited to 'htdocs/moderate/schedule/delete.php')
-rw-r--r-- | htdocs/moderate/schedule/delete.php | 49 |
1 files changed, 49 insertions, 0 deletions
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 @@ +<?php + +/* Foursquare Community Site + * + * Copyright (C) 2011 Foursquare Church. + * + * Developers: Jesse Morgan <jmorgan@foursquarestaff.com> + * + */ + +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 "<h3>Delete Users</h3>"; + +if ($user !== false) { + echo "<p>Are you sure you want to delete " . $user->getName() ."?</p>" + . "<p><a href=\"delete.php?id=". $user->getId() ."&confirmed\">Yes</a>" + . " <a href=\"index.php\">No</a></p>"; + +} else { + echo "<p>No user to delete.</p>"; +} + +require_once('../src/footer.inc.php'); + +?> + |