function unban_user($uname, $comment = null) { if (!($u = get_user($uname))) { apologize("Invalid username."); } if (!am_admin()) { apologize("Access Denied."); } if (!is_banned($u)) { apologize("User is not currently banned."); } if (is_deleted($u)) { apologize("User does not exist."); } return change_user_status($u["user_id"], $_SESSION["user"]["user_id"], "NORMAL", "UNBAN", $comment); }
function get_user_by_id($uid, $show_deleted = false) { return ($u = query("SELECT * FROM users WHERE user_id = ?", $uid)) && ($show_deleted || !is_deleted($u[0])) ? $u[0] : false; }
function recycle_article($dbc, $article_id) { $deleted = is_deleted($dbc, $article_id) ? 0 : 1; $query = "update article set deleted = '" . $deleted . "' where id = '{$article_id}'"; mysqli_query($dbc, $query) or die('Error querying database:'); }