OPNsense Forum

Archive => 16.7 Legacy Series => Topic started by: tux.JCC on November 01, 2017, 04:13:51 pm

Title: Captive Portal - PHP custom template
Post by: tux.JCC on November 01, 2017, 04:13:51 pm
Hello!

We trying to use a template with an index.html that POST some data to a backend written in PHP, this is working on a pfSense 2.2.X but on OPN simply don't execute the PHP code. I already tried to load fastcgi on the lighty conf file but still not working... any clues?
Title: Re: Captive Portal - PHP custom template
Post by: AdSchellevis on November 01, 2017, 06:46:40 pm
Our captive portal is a very different solution then the one pfSense has, scripting (other then Javascript in the browser) is not allowed on the pages served to the end user for security reasons.

You best read the docs first for a better understanding of the theme functionality https://docs.opnsense.org/manual/captiveportal.html

Custom functionality has to be hooked into the API, just like the authentication is done (for reference https://github.com/opnsense/core/blob/master/src/opnsense/mvc/app/controllers/OPNsense/CaptivePortal/Api/AccessController.php)