/** * Unban this user. */ public function unban() { return unban_user($this->guid); }
<?php if (isset($_POST["user_to_ban"])) { if (!isset($_POST["ban_reason"])) { apologize("Must provide a reason for the ban."); } if (ban_user($_POST["user_to_ban"], $_POST["ban_reason"]) === false) { apologize("Something went wrong."); } } elseif (isset($_POST["user_to_unban"])) { if (!isset($_POST["unban_reason"])) { apologize("Must provide a reason for the ban."); } if (unban_user($_POST["user_to_unban"], $_POST["unban_reason"]) === false) { apologize("Something went wrong."); } } // assoc array $bans = get_site_bans(); render_mult(["admin_common.php", "user_bans.php"], ["title" => $title . " - Banned users", "bans" => $bans]);
include $config['template_path'] . "navigation.php"; /** * Include admin navigation */ include $config['template_path'] . "admin/navigation.php"; /** * Include admin settings page */ include $config['template_path'] . "admin/settings.php"; } else { if ($action == "users") { if (isset($_GET['ban'])) { $result = ban_user($_GET['ban']); } else { if (isset($_GET['unban'])) { $result = unban_user($_GET['unban']); } else { if (isset($_POST['edit'])) { // User data if (alpha($_GET['edit'], 'numeric')) { $update_user_data = user_data($_GET['edit']); // If no email we just don't update it. if ($_POST['username'] != "") { // Make sure we aren't just submitting the same email. if ($_POST['username'] != $update_user_data['username']) { if (alpha($_POST['username'], 'alpha-underscore')) { update_user($update_user_data['id'], false, 'username', $_POST['username']); } else { $error = lang_parse('error_invalid_chars', array(lang('username'))); } }
} $sql = "UPDATE ttf_user SET perm='user' WHERE user_id='{$user_id}'"; if (!($result = mysql_query($sql))) { showerror(); } else { $messages[] = $user["username"] . " is now unbanned."; } } else { if ($user["perm"] != 'banned') { $messages[] = "<span class=\"error\">This user is not banned.</span>"; } else { $messages[] = "<span class=\"error\">This user is invalid.</span>"; } } return $messages; } if ($_GET["action"] == "ban") { message($ttf_label, $ttf_msg["resultstitl"], ban_user($user_id)); } else { if ($_GET["action"] == "unban") { message($ttf_label, $ttf_msg["resultstitl"], unban_user($user_id)); } else { message($ttf_label, $ttf_msg["fatal_error"], $ttf_msg["noactnspec"]); } } /////////////////////////////////////////////////////////////////////////////// // // this is a mess.. clean it up! // /////////////////////////////////////////////////////////////////////////////// require_once "include_footer.php";