Changeset 450 for scripts/splash
- Timestamp:
- Aug 31, 2011 1:37:39 AM (9 months ago)
- Location:
- scripts/splash
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
scripts/splash/index.php
r369 r450 2 2 3 3 //Configuration 4 $path_to_unlock_script = " /etc/ff/splash.sh";4 $path_to_unlock_script = "sudo /etc/ff/splash.sh"; 5 5 6 6 //Script … … 11 11 if(empty($_POST['accept'])) { 12 12 $browser_agent = getenv("HTTP_USER_AGENT"); 13 $Browser = checkBrowser(getenv("HTTP_USER_AGENT")); 14 15 16 $myFile = "./agent.log"; 17 $fh = fopen($myFile, 'w') or die("can't open file"); 18 $stringData = date('H:m Y-m-d').": agent: $browser_agent, browser: $Browser, referer: $_SERVER[HTTP_REFERER]\n"; 19 fwrite($fh, $stringData); 20 fclose($fh); 21 22 13 $Browser = checkBrowser($browser_agent); 14 15 //Write agent log for debugging information 16 $myFile = "./agent.log"; 17 $fh = fopen($myFile, 'a') or die("can't open file"); 18 $stringData = date('H:m Y-m-d')."- ip address: \"$_SERVER[REMOTE_ADDR]\" agent: \"$browser_agent\", browser: \"$Browser\", referer: \"$_SERVER[HTTP_REFERER]\"\n"; 19 fwrite($fh, $stringData); 20 fclose($fh); 23 21 24 22 //Redirekt fpr MOBILE devices 25 23 if ($Browser != "OTHER" OR empty($browser_agent)) { 26 /*unlockAndRedirect*/($path_to_unlock_script); 24 /*unlockAndRedirect*/ 25 unlockAndRedirect($path_to_unlock_script); 27 26 } else { 28 27 //Splashpage for other (bigger) devices -
scripts/splash/splash.sh
r341 r450 20 20 echo "splashing $3 and adding $2" >>/var/log/splash.log 21 21 echo $2 >> /etc/ff/macs 22 iptables -t nat -A PREROUTING -p tcp -s $3 ! -d 78.46.28.198--dport 80 -j DNAT --to-destination 10.18.0.122 /sbin/iptables -t nat -A PREROUTING -p tcp -s $3 ! -d 91.121.204.103 --dport 80 -j DNAT --to-destination 10.18.0.1 23 23 fi 24 24 25 25 if [ "$1" = "del" ]; then 26 26 echo "$3 went away" >>/var/log/splash.log 27 iptables -t nat -D PREROUTING -p tcp -s $3 ! -d 78.46.28.198--dport 80 -j DNAT --to-destination 10.18.0.127 /sbin/iptables -t nat -D PREROUTING -p tcp -s $3 ! -d 91.121.204.103 --dport 80 -j DNAT --to-destination 10.18.0.1 28 28 fi 29 29 30 30 31 31 if [ "$1" = "delete" ]; then 32 #echo "$2 desplashed" >>/var/log/fflog33 sudo iptables -t nat -D PREROUTING -p tcp -s $2 ! -d 78.46.28.198--dport 80 -j DNAT --to-destination 10.18.0.132 echo "$2 desplashed" >>/var/log/fflog 33 /sbin/iptables -t nat -D PREROUTING -p tcp -s $2 ! -d 91.121.204.103 --dport 80 -j DNAT --to-destination 10.18.0.1 34 34 fi 35 35
Note: See TracChangeset
for help on using the changeset viewer.
