I'm setting up a captive portal in which a user would be able to access the web only after a login. The tools I'm using are apache and squid.
It seems that this could be achieved configuring iptables and editing dinamically its rules from a server-side language like in this tutorial.
Are there other/simpler/better options?
For instance, what about letting the traffic flow first in the apache server, where I can handle the login and then forward the requests to the squid through mod_proxy? Is this a reasonable alternative or it has heavy downsides?