Commit 51965b64 authored by Dominik Hebeler's avatar Dominik Hebeler

Testing new script

parent 85267ea6
......@@ -115,4 +115,28 @@ class StartpageController extends Controller
->with('link', $link)
->with('password', $password);
}
public function testTor()
{
if ($this->IsTorExitPoint()) {
die(var_dump("Willkommen Tor"));
} else {
die(var_dump("Willkommen Normal"));
}
}
private function IsTorExitPoint()
{
if (gethostbyname($this->ReverseIPOctets($_SERVER['REMOTE_ADDR']) . "." . $_SERVER['SERVER_PORT'] . "." . $this->ReverseIPOctets($_SERVER['SERVER_ADDR']) . ".ip-port.exitlist.torproject.org") == "127.0.0.2") {
return true;
} else {
return false;
}
}
private function ReverseIPOctets($inputip)
{
$ipoc = explode(".", $inputip);
return $ipoc[3] . "." . $ipoc[2] . "." . $ipoc[1] . "." . $ipoc[0];
}
}
......@@ -22,6 +22,8 @@ Route::group(
Route::get('/', 'StartpageController@loadStartPage');
Route::get('test2', 'StartpageController@testTor');
Route::get('asso', function () {
return view('assoziator.asso')
->with('title', trans('titles.asso'))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment