Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    External Captive Portal. Is it actually possible?

    Scheduled Pinned Locked Moved Captive Portal
    2 Posts 2 Posters 368 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R
      rt050
      last edited by

      Hi there,

      I've been trying for the last 6 hours to get an external captive portal up and running.

      Why may you ask? Well, I require my captive portal to capture user's email addresses and store it in an SQL database.

      Whilst making the site and connecting the DB was the easy part, actually implementing it into Pfsense is giving me such a headache.

      There are three components:

      • index.php (the splash page)
      • process.php (connection to db etc)
      • success.php - the page where the user then clicks connect and lives happily ever after.

      I've attempted both ways in doing this:

      1 - All pages stored on Pfsense

      • Uploaded the form to custom page on captive portal section
      • Uploaded process.php & success.php to file manager

      I assume the pages uploaded to file manager are located in the same folder as the splash index page? I've updated the page links on my index page so they should point to the correct place e.g."captiveportal-success.php".

      Unfortunately the above does not work, nor can I get a database connection but I'm almost sure it's because the symlinks are wrong.

      2 - Externally hosted splash

      • All three pages are on my web server
      • All data writes into the DB

      Now, my question for this second method is how do I then return the required form to Pfsense to then complete the authentication? (I.E. $PORTAL_REDIRURL$ etc)

      Has anybody managed an external portal without going crazy?

      To note, I've added my webserver etc to allowed hostnames and IPs.

      GertjanG 1 Reply Last reply Reply Quote 0
      • GertjanG
        Gertjan @rt050
        last edited by Gertjan

        @rt050 said in External Captive Portal. Is it actually possible?:

        but I'm almost sure it's because the symlinks are wrong.

        When you upload these files :

        1912b189-e60d-4477-9fb6-8feccf8517aa-image.png

        2style.css, custom.css mac-block.html etc
        you can use them with the names captiveportal- 2style.css etc

        67c4e090-d618-4249-9c4c-255861c32807-image.png

        @rt050 said in External Captive Portal. Is it actually possible?:

        nor can I get a database connection

        what database ?
        MySQL ?
        in the good old days, the PHP MYSQL extension could be installed easily.*
        These days, when you install the FreeRadius pfSense package, you'll get the PHP MYSQL extension also. No need to actually use FreeRadius.

        @rt050 said in External Captive Portal. Is it actually possible?:

        the page where the user then clicks connect and lives happily ever after.

        Do they ?
        Already years ago, its was nearly "impossible" to ask for people's mail address so they would gain access to my hotel portal. They wouldn't fall for it back then and now even less.
        These days, here in Europe, collecting private info is 'not done' as you need to deal with all kind of administrative barriers to be able to store things like email addresses. It's just to much of a hassle.

        No "help me" PM's please. Use the forum, the community will thank you.
        Edit : and where are the logs ??

        1 Reply Last reply Reply Quote 0
        • First post
          Last post
        Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.