Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MetaGer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open-source
MetaGer
Commits
172b0fd3
Commit
172b0fd3
authored
6 years ago
by
Dominik Hebeler
Browse files
Options
Downloads
Patches
Plain Diff
Fixed Botprotection
parent
cab04187
No related branches found
Branches containing commit
No related tags found
2 merge requests
!1382
Development
,
!1379
Development
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/Http/Controllers/HumanVerification.php
+1
-0
1 addition, 0 deletions
app/Http/Controllers/HumanVerification.php
app/Http/Middleware/HumanVerification.php
+4
-5
4 additions, 5 deletions
app/Http/Middleware/HumanVerification.php
with
5 additions
and
5 deletions
app/Http/Controllers/HumanVerification.php
+
1
−
0
View file @
172b0fd3
...
@@ -51,6 +51,7 @@ class HumanVerification extends Controller
...
@@ -51,6 +51,7 @@ class HumanVerification extends Controller
->
with
(
'id'
,
$id
)
->
with
(
'id'
,
$id
)
->
with
(
'url'
,
$url
)
->
with
(
'url'
,
$url
)
->
with
(
'image'
,
$captcha
[
"img"
]);
->
with
(
'image'
,
$captcha
[
"img"
]);
}
}
public
static
function
remove
(
Request
$request
)
public
static
function
remove
(
Request
$request
)
...
...
This diff is collapsed.
Click to expand it.
app/Http/Middleware/HumanVerification.php
+
4
−
5
View file @
172b0fd3
...
@@ -35,7 +35,7 @@ class HumanVerification
...
@@ -35,7 +35,7 @@ class HumanVerification
* If someone that uses a bot finds this out we
* If someone that uses a bot finds this out we
* might have to change it at some point.
* might have to change it at some point.
*/
*/
if
(
$request
->
filled
(
'password'
)
||
$request
->
filled
(
'key'
)
||
$request
->
filled
(
'appversion'
)
||
!
env
(
'BOT_PROTECTION'
,
false
))
{
if
(
$request
->
has
(
'password'
)
||
$request
->
has
(
'key'
)
||
$request
->
has
(
'appversion'
)
||
!
env
(
'BOT_PROTECTION'
,
false
))
{
$update
=
false
;
$update
=
false
;
return
$next
(
$request
);
return
$next
(
$request
);
}
}
...
@@ -126,10 +126,8 @@ class HumanVerification
...
@@ -126,10 +126,8 @@ class HumanVerification
# The user currently isn't locked
# The user currently isn't locked
# We have different security gates:
# We have different security gates:
# 50
, 75, 85, >=90
=> Captcha validated Result Pages
# 50
and then every 25
=> Captcha validated Result Pages
# If the user shows activity on our result page the counter will be deleted
# If the user shows activity on our result page the counter will be deleted
# Maybe I'll add a ban if the user reaches 100
if
(
$user
[
"unusedResultPages"
]
===
50
||
(
$user
[
"unusedResultPages"
]
>
50
&&
$user
[
"unusedResultPages"
]
%
25
===
0
))
{
if
(
$user
[
"unusedResultPages"
]
===
50
||
(
$user
[
"unusedResultPages"
]
>
50
&&
$user
[
"unusedResultPages"
]
%
25
===
0
))
{
$user
[
"locked"
]
=
true
;
$user
[
"locked"
]
=
true
;
}
}
...
@@ -138,8 +136,8 @@ class HumanVerification
...
@@ -138,8 +136,8 @@ class HumanVerification
}
catch
(
\Illuminate\Database\QueryException
$e
)
{
}
catch
(
\Illuminate\Database\QueryException
$e
)
{
// Failure in contacting metager3.de
// Failure in contacting metager3.de
}
finally
{
}
finally
{
// Update the user in the database
if
(
$update
)
{
if
(
$update
)
{
// Update the user in the database
if
(
$newUser
)
{
if
(
$newUser
)
{
DB
::
table
(
'humanverification'
)
->
insert
(
DB
::
table
(
'humanverification'
)
->
insert
(
[
[
...
@@ -171,5 +169,6 @@ class HumanVerification
...
@@ -171,5 +169,6 @@ class HumanVerification
}
}
$request
->
request
->
add
([
'verification_id'
=>
$user
[
"uid"
],
'verification_count'
=>
$user
[
"unusedResultPages"
]]);
$request
->
request
->
add
([
'verification_id'
=>
$user
[
"uid"
],
'verification_count'
=>
$user
[
"unusedResultPages"
]]);
return
$next
(
$request
);
return
$next
(
$request
);
}
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment