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 ?


  • Moderator

    Change the line:

    require("globals.inc");

    to

    require_once("globals.inc");



  • Thanks a lot!!!

    That solved it.