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
28dad569
Commit
28dad569
authored
May 17, 2021
by
Dominik Hebeler
Browse files
humanverification working again
parent
4b9c0f16
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
app/Http/Controllers/Assoziator.php
View file @
28dad569
...
...
@@ -21,7 +21,12 @@ class Assoziator extends Controller
];
$url
=
"https://metager.de/meta/meta.ger3?"
.
http_build_query
(
$params
,
""
,
"&"
,
PHP_QUERY_RFC3986
);
$url
=
route
(
"resultpage"
,
$params
);
# Special Case for local development as the port forwarding does not work within docker
if
(
env
(
"APP_ENV"
,
""
)
===
"local"
&&
stripos
(
$url
,
"http://localhost:8080"
)
===
0
){
$url
=
str_replace
(
"http://localhost:8080"
,
"http://nginx"
,
$url
);
}
$ch
=
curl_init
();
...
...
@@ -41,6 +46,11 @@ class Assoziator extends Controller
));
$response
=
curl_exec
(
$ch
);
if
(
curl_errno
(
$ch
)){
abort
(
500
,
curl_error
(
$ch
));
}
$responseCode
=
curl_getinfo
(
$ch
,
CURLINFO_HTTP_CODE
);
curl_close
(
$ch
);
...
...
app/Http/Middleware/HumanVerification.php
View file @
28dad569
...
...
@@ -17,7 +17,7 @@ class HumanVerification
* @param \Closure $next
* @return mixed
*/
public
function
handle
(
$request
,
Closure
$next
,
$isAsso
=
false
)
public
function
handle
(
$request
,
Closure
$next
)
{
if
(
$request
->
filled
(
"loadMore"
)
&&
Cache
::
has
(
$request
->
input
(
"loadMore"
)))
{
return
$next
(
$request
);
...
...
@@ -48,11 +48,9 @@ class HumanVerification
*/
//use parameter for middleware to skip this when using associator
if
(
!
$isAsso
){
if
(
!
env
(
'BOT_PROTECTION'
,
false
)
||
app
(
'App\Models\Key'
)
->
getStatus
())
{
$update
=
false
;
return
$next
(
$request
);
}
if
(
!
env
(
'BOT_PROTECTION'
,
false
)
||
app
(
'App\Models\Key'
)
->
getStatus
())
{
$update
=
false
;
return
$next
(
$request
);
}
# Get all Users of this IP
...
...
routes/web.php
View file @
28dad569
...
...
@@ -42,7 +42,7 @@ Route::group(
->
with
(
'css'
,
[
mix
(
'css/asso/style.css'
)])
->
with
(
'darkcss'
,
[
mix
(
'css/asso/dark.css'
)]);
});
Route
::
get
(
'asso/meta.ger3'
,
'Assoziator@asso'
)
->
middleware
(
'browserverification:assoresults'
,
'humanverification
:true
'
)
->
name
(
"assoresults"
);
Route
::
get
(
'asso/meta.ger3'
,
'Assoziator@asso'
)
->
middleware
(
'browserverification:assoresults'
,
'humanverification'
)
->
name
(
"assoresults"
);
Route
::
get
(
'impressum'
,
function
()
{
return
view
(
'impressum'
)
...
...
Write
Preview
Supports
Markdown
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