External Captive Portal. Is it actually possible?
-
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.
-
@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 :
2style.css, custom.css mac-block.html etc
you can use them with the names captiveportal- 2style.css etc@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.