OK, firstly we modified the login.html page to redirect to our login page script:
*****login.html****
<html>
<title>...</title>
body>
<form name="redirect" action="
https://yoururl/scriptname.cgi" method="post">
<input type="hidden" name="mac" value="$(mac)">
<input type="hidden" name="ip" value="$(ip)">
<input type="hidden" name="user" value="$(username)">
<input type="hidden" name="link-login" value="$(link-login)">
<input type="hidden" name="origurl" value="$(link-orig)">
<input type="hidden" name="error" value="$(error)">
<input type="hidden" name="hostname" value="$(hostname)">
<input type="hidden" name="identity" value="$(identity)">
<input type="hidden" name="chapid" value="$(chap-id)">
<input type="hidden" name="chapchallenge" value="$(chap-challenge)">
</form>
<script language="JavaScript">
<!--
document.redirect.submit();
//-->
</script>
</body>
</html>
****************
This page redirects to our cgi script running on our webserver, don't forget you need to allow access to your webserver using the walled garden feature in the hotspot.
Once we are running our cgi script we bring in the parameters passed from the login.html page using the appropriate cgi commands and use them in our script. If we need to proceed past that script we build another webpage with CGI from within the script and use a form in the webpage that submits the parameters we need to carry through as hidden fields.
Here is an excerpt from the script we redirect to from the login.html page which shows the type of html page we are generating, you just need to keep passing the parameters through and reading them with the next script for as long as you need to. We end up running about 3 scripts before the user finally gets logged in, and the login details are captured by one of our scripts and then passed to the hotspot for authentication. Scripts are great tools as you can do so much with them, for example we log all access by hotspot and userID, not to mention that fact that we can log every time one of our customers ads appear and manage our advertising so much better doing it this way, because ultimately the user clicks their way through which means you can use popups and stuff if you want as it is all user initiated.
This is how we get the parameters to use in our scripts and pass onto other scripts, standard perl CGI
**** CGI Script ****
##### Get field values parsed from login page
$$mac = param("mac");
$$ipaddress = param("ip");
$$user = param("user");
$$loginurl = param("link-login");
$$origurl = param("origurl");
$$hserror = param("error");
$$hostname = param("hostname");
$$id = param("identity");
$$chapid = param("chapid");
$$chapchallenge = param("chapchallenge");
*******************
*** Here is example of the html form generated inside the script for eventual login****
<input type="text" name="username" value="">
<input type="password" name="password" value="">
<input type="hidden" name="domain" value="">
<input type="hidden" name="dst" value="
https://yourauthserver/yourscript.cgi">
I hope this helps, I have spent hundreds of hours getting our systems perfect, there is a lot of mucking around, and when you use CGI to generate your pages it does get a bit time consuming getting all your pages looking right as it's all hand coded
Regards
Paul