<?php /** * Check if current user is banner */ $banned = UserBan::IsBanned($_SERVER['REMOTE_ADDR']); /** * Die if user is banned. No output is necessary here. */ if ($banned) { die; } /** * Check if $_GET variables are set. We need them for the user * to register the first time. */ $get_check = Post::GCheck(array('name', 'email')); if ($get_check) { /** * If variables are set, register new user with passed variables */ $usercheck = new RegisterUser($_GET['name'], $_GET['email']); } else { /** * No variables have been passed, so we assume that user is allready registered * The script will just update the user in the database */ $usercheck = new RegisterUser(); }
<?php $perms = new Permission(); if (!$perms->IsAllowed('banned')) { Exceptions::PrintOut("You do not have access to the Banned area"); } /** * List banned users */ $ban = UserBan::ListBanned(); include 'views/template/banned.html';
<?php $perms = new Permission(); if (!$perms->IsAllowed('banned')) { Exceptions::PrintOut("You do not have access to the Banned area"); } /** * Check for $_GET variable "id" */ $delcheck = Post::GCheck(array("id")); /** * If variable is set, delete the user and return to page */ if ($delcheck) { UserBan::BanDelete($_GET['id']); header("Location: index.php?page=UserBan"); }
<?php $perms = new Permission(); if (!$perms->IsAllowed('banned')) { Exceptions::PrintOut("You do not have access to the Banned area"); } /** * Check if $_POST variable user has been set and ban the user. */ $check = Post::Check(array("user")); if ($check) { UserBan::BanUser($_POST['user']); }