Captiveportal pre-auth redirect URL not working in 2.3
-
After upgrading to 2.3, CP doesn't work when using pre-auth redirect URL.
This is what is shown in the browser.:
Fatal error: Cannot redeclare platform_booting() (previously declared in /etc/inc/globals.inc:208) in /etc/inc/globals.inc on line 208 Call Stack: 0.0001 226464 1. {main}() /usr/local/captiveportal/index.php:0 0.0223 2982888 2. portal_reply_page() /usr/local/captiveportal/index.php:262 0.0223 2983160 3. get_include_contents() /etc/inc/captiveportal.inc:1943 0.0223 3001008 4. include('/var/etc/captiveportal_guest.html') /etc/inc/pfsense-utils.inc:2356 PHP ERROR: Type: 1, File: /etc/inc/globals.inc, Line: 208, Message: Cannot redeclare platform_booting() (previously declared in /etc/inc/globals.inc:208)
I have this in the top of my portal page.:
require("globals.inc");
$request_uri = urldecode(str_replace("/index.php?redirurl=", "", $_SERVER["REQUEST_URI"]));
$portal_redirurl = urldecode("$PORTAL_REDIRURL$");
if(!stristr(urldecode("$PORTAL_REDIRURL$"), $request_uri)) {
Header("Location: $PORTAL_REDIRURL$");
exit;
}
?>Any idea what's missing after the upgrade ?
-
Change the line:
require("globals.inc");
to
require_once("globals.inc");
-
Thanks a lot!!!
That solved it.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register LoginPrivacy Policy · Cookie Policy