function bb_block_current_user() { global $bbdb; if ($id = bb_get_current_user_info('id')) { bb_update_usermeta($id, $bbdb->prefix . 'been_blocked', 1); } // Just for logging. bb_logout(); bb_die(__("You've been blocked. If you think a mistake has been made, contact this site's administrator.")); }
$redirect_to = $re; } // Fallback to site root if (empty($re)) { $re = bb_get_uri(); } /** Handle logout *************************************************************/ // User is logged in if (bb_is_user_logged_in()) { // Logout requested if (isset($_GET['logout'])) { $_GET['action'] = 'logout'; } // Check logout action if (isset($_GET['action']) && 'logout' === $_GET['action']) { bb_logout(); } bb_safe_redirect($re); exit; } /** Handle login **************************************************************/ // Do we allow login by email address $email_login = bb_get_option('email_login'); // Get the user from the login details if (empty($_POST['log'])) { $_POST['log'] = !empty($_POST['user_login']) ? $_POST['user_login'] : ''; } if (empty($_POST['pwd'])) { $_POST['pwd'] = !empty($_POST['password']) ? $_POST['password'] : ''; } if (empty($_POST['rememberme'])) {