- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
01-28-2013 06:59 AM
Hi all,
I would to make a log-out page for captive portal. which working by inject an CLI command to PAN with client IP.
for example
clear user-cache ip 192.168.5.200
1. what php code can I use to collect client IP address ?
2. what php code can I inject API to PAN ?
Thank you.
03-10-2013 12:20 PM
Hi,
Not sure if this helps, but what we've done in this scenario is implement a little javascript heartbeat function on the (captive portal) destination server such that users close the page to trigger a logout() function (via window.onbeforeunload), which in turn clears the user-ip mapping in the palo via the restful api call..
https://HOSTNAME/api/?type=op&cmd=<clear><user-cache><ip>USER_IP</ip></user-cache></clear>&key=APIKEY
I wont post any example code here as what weve used is a little more convoluted (in that we use websockets to push messages via an AMQP broker that has workers proxying api calls to the palo) but please let me know if you want further details..
cheers
damian
Click Accept as Solution to acknowledge that the answer to your question has been provided.
The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!
These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!
The LIVEcommunity thanks you for your participation!