summaryrefslogtreecommitdiff
path: root/files/www
diff options
context:
space:
mode:
Diffstat (limited to 'files/www')
-rwxr-xr-xfiles/www/cgi-bin/splash_click31
-rw-r--r--files/www/splash.html3
2 files changed, 34 insertions, 0 deletions
diff --git a/files/www/cgi-bin/splash_click b/files/www/cgi-bin/splash_click
new file mode 100755
index 0000000..32fce2e
--- /dev/null
+++ b/files/www/cgi-bin/splash_click
@@ -0,0 +1,31 @@
+#!/bin/sh
+echo -en "Status: 302 Temporary Redirect\r\n"
+echo -en "Location: http://www.freifunk-jena.de\r\n"
+echo -en "\r\n"
+
+. $IPKG_INSTROOT/etc/functions.sh
+ISSPLASHED=0
+config_load splash_users
+is_ip() {
+ config_get ip "$1" ip
+ if [ "$ip" == "$REMOTE_HOST" ]; then
+ ISSPLASHED=1
+ fi
+}
+#check if user is alredy splashed
+config_foreach is_ip user
+
+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`
+uci -q commit > /dev/null
+exit 0
+
+
+
+
diff --git a/files/www/splash.html b/files/www/splash.html
new file mode 100644
index 0000000..89e0736
--- /dev/null
+++ b/files/www/splash.html
@@ -0,0 +1,3 @@
+<h1>Splashpage</h1>
+
+<a href="/cgi-bin/splash_click?accept">Aktzeptieren</a> <a href="#">Ablehnen</a>
contact: Jan Huwald // Impressum