Ejemplo n.º 1
0
    Notification::banned($ban);
    BootstrapSkin::displayInternalFooter();
    die;
} elseif ($action == "unban") {
    global $smarty;
    if (!isset($_GET['id']) || $_GET['id'] == "") {
        BootstrapSkin::displayAlertBox("The ID parameter appears to be missing! This is probably a bug.", "alert-error", "Ahoy There! Something's not right...", true, false);
        BootstrapSkin::displayInternalFooter();
        die;
    }
    if (!User::getCurrent()->isAdmin() && !User::getCurrent()->isCheckuser()) {
        BootstrapSkin::displayAccessDenied();
        BootstrapSkin::displayInternalFooter();
        die;
    }
    $ban = Ban::getActiveId($_GET['id']);
    if ($ban == false) {
        BootstrapSkin::displayAlertBox("The specified ban ID is not currently active or doesn't exist!", "alert-error", "", false, false);
        BootstrapSkin::displayInternalFooter();
        die;
    }
    if (isset($_GET['confirmunban']) && $_GET['confirmunban'] == "true") {
        if (!isset($_POST['unbanreason']) || $_POST['unbanreason'] == "") {
            BootstrapSkin::displayAlertBox("You must enter an unban reason!", "alert-error", "", false, false);
            BootstrapSkin::displayInternalFooter();
            die;
        } else {
            $database = gGetDb();
            $database->transactionally(function () use($database, $ban) {
                $ban->setActive(0);
                $ban->save();