Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
open-source
MetaGer
Commits
51965b64
Commit
51965b64
authored
Jun 04, 2019
by
Dominik Hebeler
Browse files
Testing new script
parent
85267ea6
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
app/Http/Controllers/StartpageController.php
View file @
51965b64
...
...
@@ -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
];
}
}
routes/web.php
View file @
51965b64
...
...
@@ -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'
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment