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
485f804b
Commit
485f804b
authored
5 years ago
by
Dominik Hebeler
Browse files
Options
Downloads
Patches
Plain Diff
deleting works again
parent
1a94a3e8
No related branches found
Branches containing commit
No related tags found
2 merge requests
!1520
Development
,
!1519
Resolve "Humanverification seems to be not resetting"
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.env.example
+2
-0
2 additions, 0 deletions
.env.example
app/Http/Controllers/HumanVerification.php
+8
-4
8 additions, 4 deletions
app/Http/Controllers/HumanVerification.php
with
10 additions
and
4 deletions
.env.example
+
2
−
0
View file @
485f804b
...
...
@@ -4,6 +4,8 @@ APP_LOG_LEVEL=debug
APP_KEY=
APP_URL=http://localhost
BOT_PROTECTION=true
DB_CONNECTION=mysql
DB_HOST=mgdb
DB_PORT=3306
...
...
This diff is collapsed.
Click to expand it.
app/Http/Controllers/HumanVerification.php
+
8
−
4
View file @
485f804b
...
...
@@ -92,9 +92,9 @@ class HumanVerification extends Controller
public
static
function
removeGet
(
Request
$request
,
$mm
,
$password
,
$url
)
{
$url
=
base64_decode
(
str_replace
(
"<<SLASH>>"
,
"/"
,
$url
));
# If the user is correct and the password is we will delete any entry in the database
$requiredPass
=
md5
(
$mm
.
Carbon
::
NOW
()
->
day
.
$url
.
env
(
"PROXY_PASSWORD"
));
if
(
HumanVerification
::
checkId
(
$request
,
$mm
)
&&
$requiredPass
===
$password
)
{
HumanVerification
::
removeUser
(
$request
,
$mm
);
}
...
...
@@ -126,8 +126,13 @@ class HumanVerification extends Controller
$changed
=
true
;
}
}
if
(
$changed
)
{
Cache
::
put
(
HumanVerification
::
PREFIX
.
"."
.
$user
[
"id"
],
$userList
,
now
()
->
addWeeks
(
2
));
if
(
sizeof
(
$newUserList
)
>
0
)
{
Cache
::
put
(
HumanVerification
::
PREFIX
.
"."
.
$user
[
"id"
],
$newUserList
,
now
()
->
addWeeks
(
2
));
}
else
{
Cache
::
forget
(
HumanVerification
::
PREFIX
.
"."
.
$user
[
"id"
],
$newUserList
);
}
}
}
...
...
@@ -152,11 +157,10 @@ class HumanVerification extends Controller
$sum
=
0
;
foreach
(
$userlist
as
$uidTmp
=>
$userTmp
)
{
if
(
!
empty
(
$userTmp
)
&&
!
empty
(
$userTmp
[
"whitelist"
])
&&
!
$userTmp
[
"whitelist"
])
{
if
(
!
empty
(
$userTmp
)
&&
gettype
(
$userTmp
[
"whitelist"
])
===
"boolean"
&&
!
$userTmp
[
"whitelist"
])
{
$sum
+=
intval
(
$userTmp
[
"unusedResultPages"
]);
}
}
# Check if we have to whitelist the user or if we can simply delete the data
if
(
$user
[
"unusedResultPages"
]
<
$sum
&&
!
$user
[
"whitelist"
])
{
# Whitelist
...
...
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