From 6a0a660a22d8a102f9358f805a22cbfe49f545bb Mon Sep 17 00:00:00 2001 From: Russ Handorf Date: Tue, 1 Mar 2016 22:42:28 -0500 Subject: [PATCH] testing for Chris --- server/sohoinput.php | 58 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 server/sohoinput.php diff --git a/server/sohoinput.php b/server/sohoinput.php new file mode 100644 index 0000000..d36df57 --- /dev/null +++ b/server/sohoinput.php @@ -0,0 +1,58 @@ + $element) { + #fwrite($fh, "Param: $index; Value: $element\n"); + #foreach ($element as $item => $value) { + #fwrite($fh, "Param: $item; Value: $value\n"); + #if ($item == "type" ) { + #fwrite($fh, "$value\n"); + #} + #} +#} + +for($i=0; $i 0) { + open_database("localhost","kismet","asdfqwerty","wireless","update beacon set CHANNEL='".$input[$i][channel]."', RSSI='".$input[$i][rssi]."', LASTSEEN=UNIX_TIMESTAMP(NOW()) where SSID='".$input[$i][ssid]."' and BSSID='".$input[$i][bssid]."'"); + } else { + open_database("localhost","kismet","asdfqwerty","wireless","insert into beacon set SSID='".$input[$i][ssid]."', BSSID='".$input[$i][bssid]."', LASTSEEN=UNIX_TIMESTAMP(NOW()), CHANNEL='".$input[$i][channel]."', RSSI='".$input[$i][rssi]."'"); + } + break; + + case 50: + $query=open_database("localhost","kismet","asdfqwerty","wireless","select LASTSEEN from probe where BSSID='".$input[$i][bssid_mac]."' and MAC='".$input[$i][client_mac]."'"); + if (mysql_numrows($query) > 0) { + open_database("localhost","kismet","asdfqwerty","wireless","update probe set CHANNEL='".$input[$i][channel]."', RSSI='".$input[$i][rssi]."', LASTSEEN=UNIX_TIMESTAMP(NOW()) where BSSID='".$input[$i][bssid_mac]."' and MAC='".$input[$i][client_mac]."'"); + } else { + open_database("localhost","kismet","asdfqwerty","wireless","insert into probe set BSSID='".$input[$i][bssid_mac]."', MAC='".$input[$i][client_mac]."', LASTSEEN=UNIX_TIMESTAMP(NOW()), CHANNEL='".$input[$i][channel]."', RSSI='".$input[$i][rssi]."'"); + } + break; + + case 40: + $query=open_database("localhost","kismet","asdfqwerty","wireless","select LASTSEEN from probe where BSSID='".$input[$i][bssid_mac]."' and MAC='".$input[$i][client_mac]."'"); + if (mysql_numrows($query) > 0) { + open_database("localhost","kismet","asdfqwerty","wireless","update probe set CHANNEL='".$input[$i][channel]."', RSSI='".$input[$i][rssi]."', LASTSEEN=UNIX_TIMESTAMP(NOW()) where BSSID='".$input[$i][bssid_mac]."' and MAC='".$input[$i][client_mac]."'"); + } else { + open_database("localhost","kismet","asdfqwerty","wireless","insert into probe set BSSID='".$input[$i][bssid_mac]."', MAC='".$input[$i][client_mac]."', LASTSEEN=UNIX_TIMESTAMP(NOW()), CHANNEL='".$input[$i][channel]."', RSSI='".$input[$i][rssi]."'"); + } + + break; + } +} + +fclose($fh); +?> -- 2.34.1