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
d32f93b8
Commit
d32f93b8
authored
Jul 23, 2022
by
Dominik Hebeler
Browse files
reduced expiration to 6 hours
parent
7b825b9f
Changes
1
Hide whitespace changes
Inline
Side-by-side
metager/app/Models/Verification/Verification.php
View file @
d32f93b8
...
...
@@ -40,7 +40,7 @@ abstract class Verification
'unusedResultPages'
=>
0
,
'whitelist'
=>
false
,
'locked'
=>
false
,
"expiration"
=>
now
()
->
add
Week
s
(
2
),
"expiration"
=>
now
()
->
add
Hour
s
(
6
),
];
$this
->
users
[
$this
->
uid
]
=
$this
->
user
;
}
else
{
...
...
@@ -103,30 +103,21 @@ abstract class Verification
function
saveUser
()
{
$userList
=
Cache
::
get
(
$this
->
cache_prefix
.
"."
.
$this
->
id
,
[]);
$expiration_short
=
now
()
->
addHours
(
6
);
$expiration_long
=
now
()
->
addWeeks
(
2
);
$expiration
=
now
()
->
addHours
(
6
);
$cache_expiration
=
$expiration_short
;
// Todo remove setting expiration for all users
// Just added to apply the new expiration policy to all existing entries
// Will not be needed in the future
foreach
(
$userList
as
$index
=>
$user
)
{
if
(
$user
[
"whitelist"
]
===
true
)
{
$cache_expiration
=
$expiration_long
;
if
(
$expiration_long
<
$user
[
"expiration"
])
{
$userList
[
$index
][
"expiration"
]
=
$expiration_long
;
}
}
else
if
(
$expiration_short
<
$user
[
"expiration"
])
{
$userList
[
$index
][
"expiration"
]
=
$expiration_short
;
if
(
$expiration
<
$user
[
"expiration"
])
{
$userList
[
$index
][
"expiration"
]
=
$expiration
;
}
}
if
(
$this
->
isWhiteListed
()
===
true
)
{
$this
->
user
[
"expiration"
]
=
$expiration_long
;
}
else
{
$this
->
user
[
"expiration"
]
=
$expiration_short
;
}
$this
->
user
[
"expiration"
]
=
$expiration
;
$userList
[
$this
->
uid
]
=
$this
->
user
;
Cache
::
put
(
$this
->
cache_prefix
.
"."
.
$this
->
id
,
$userList
,
$
cache_
expiration
);
Cache
::
put
(
$this
->
cache_prefix
.
"."
.
$this
->
id
,
$userList
,
$expiration
);
$this
->
users
=
$userList
;
}
...
...
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