Skip to content
Snippets Groups Projects
Commit 51965b64 authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

Testing new script

parent 85267ea6
No related branches found
No related tags found
1 merge request!1436Development
...@@ -115,4 +115,28 @@ class StartpageController extends Controller ...@@ -115,4 +115,28 @@ class StartpageController extends Controller
->with('link', $link) ->with('link', $link)
->with('password', $password); ->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( ...@@ -22,6 +22,8 @@ Route::group(
Route::get('/', 'StartpageController@loadStartPage'); Route::get('/', 'StartpageController@loadStartPage');
Route::get('test2', 'StartpageController@testTor');
Route::get('asso', function () { Route::get('asso', function () {
return view('assoziator.asso') return view('assoziator.asso')
->with('title', trans('titles.asso')) ->with('title', trans('titles.asso'))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment