function deleteConfirmPost() { $currentUserId = ModelFacade::getLoggedInUser()->id; if (isset($_POST['deleteAccount']) && $_POST['deleteAccount'] == "confirm") { ModelFacade::DeleteUser($currentUserId); ModelFacade::logout(); header("location: /Signup.php?delAccount=success"); } else { header("location: /Index.php"); } }
public static function kickIfBannedOrDeleted() { if (ModelFacade::checkLoggedIn()) { $userObj = ModelFacade::getLoggedInUser(); $test = $userObj->checkIfBannedOrDeleted(); if ($test) { ModelFacade::logout(); header("Location: /Login.php"); } } }
<?php /** * Created by PhpStorm. * User: sinisterdeath * Date: 8/2/2015 * Time: 5:50 PM */ //Require Model require "/Model/ModelFacade.php"; ModelFacade::logout(); ModelFacade::redirectUnauthorised();