summaryrefslogtreecommitdiff
path: root/files/www/cgi-bin/splash_click
diff options
context:
space:
mode:
Diffstat (limited to 'files/www/cgi-bin/splash_click')
-rwxr-xr-xfiles/www/cgi-bin/splash_click7
1 files changed, 5 insertions, 2 deletions
diff --git a/files/www/cgi-bin/splash_click b/files/www/cgi-bin/splash_click
index 32fce2e..b868658 100755
--- a/files/www/cgi-bin/splash_click
+++ b/files/www/cgi-bin/splash_click
@@ -1,6 +1,6 @@
#!/bin/sh
-echo -en "Status: 302 Temporary Redirect\r\n"
-echo -en "Location: http://www.freifunk-jena.de\r\n"
+echo -en "Status: 200 OK\r\n"
+echo -en "Content-Type: text/html\r\n"
echo -en "\r\n"
. $IPKG_INSTROOT/etc/functions.sh
@@ -14,12 +14,15 @@ is_ip() {
}
#check if user is alredy splashed
config_foreach is_ip user
+targeturl=$(echo $QUERY_STRING | sed 's/+/ /g; s/%/\\x/g')
+sed "s/targeturl/"$targeturl"/g" /www/iframe.html
if [ $ISSPLASHED -eq 1 ]; then
exit
fi
#User is now free to go
iptables -t nat -I ffj_splash 1 -s $REMOTE_HOST -j ACCEPT
+
uci add splash_users user
uci set splash_users.@user[-1].ip=$REMOTE_HOST
uci set splash_users.@user[-1].time=`date +%s`
contact: Jan Huwald // Impressum