Check if user is logged in in 1.0.1
-
I want to check if the visitor is logged in, I can’t find a function that works in version 1.0.1 (such as
bb_is_user_logged_in()
,is_user_logged_in()
,bb_is_logged_in()
andis_logged_in()
). All of those functions raise the “Call to undefined function” error.I am trying to make my forum private, redirecting all users that are not logged in to the login page. The following code is in my
functions.php
theme file:if(!preg_match("/bb-login.php/", $_SERVER["SCRIPT_NAME"]) && !bb_is_user_logged_in()) {
header("Location: " . $bb->uri . "bb-login.php");
die("Authorisation required.");
}
Any help is appreciated.
- You must be logged in to reply to this topic.