* Checking permissions */ require_once "../auth/login_check.php"; loginCheck(OPEN_PROFILE_ADMINISTRATOR); require_once "../lib/Form.php"; Form::compareToken($returnLocation); require_once "../lib/Check.php"; /** * Retrieving post vars */ $idUser = intval($_POST["id_user"]); /** * Delete user */ require_once "../model/Query/User.php"; $userQ = new Query_User(); if (!$userQ->select($idUser)) { $userQ->close(); FlashMsg::add(_("That user does not exist."), OPEN_MSG_ERROR); header("Location: " . $returnLocation); exit; } $user = $userQ->fetch(); $userQ->delete($idUser); $userQ->close(); unset($userQ); /** * Redirect to $returnLocation to avoid reload problem */ FlashMsg::add(sprintf(_("User, %s, has been deleted."), $user->getLogin())); header("Location: " . $returnLocation);
/** * Controlling vars */ $tab = "admin"; $nav = "users"; /** * Checking permissions */ require_once "../auth/login_check.php"; loginCheck(OPEN_PROFILE_ADMINISTRATOR); require_once "../lib/Form.php"; require_once "../model/Query/User.php"; $userQ = new Query_User(); $userQ->selectLogins(); $userArray = null; while ($user = $userQ->fetch()) { $userArray[$user->getIdMember() . OPEN_SEPARATOR . $user->getLogin()] = $user->getLogin(); } $userQ->freeResult(); /** * Show page */ $title = _("Users"); require_once "../layout/header.php"; /** * Breadcrumb */ $links = array(_("Admin") => "../admin/index.php", $title => ""); echo HTML::breadcrumb($links, "icon icon_user"); unset($links); $legend = _("Create New User");