Exemplo n.º 1
0
<?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();
}
Exemplo n.º 2
0
<?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';
Exemplo n.º 3
0
<?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");
}
Exemplo n.º 4
0
<?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']);
}