Skip to content
GitLab
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
4b01570c
Commit
4b01570c
authored
Mar 04, 2019
by
Dominik Hebeler
Browse files
Fixed a bug in redis connection
parent
cec37ace
Changes
2
Show whitespace changes
Inline
Side-by-side
app/Http/Controllers/HumanVerification.php
View file @
4b01570c
...
...
@@ -17,7 +17,7 @@ class HumanVerification extends Controller
public
static
function
captcha
(
Request
$request
,
Hasher
$hasher
,
$id
,
$url
=
null
)
{
$redis
=
Redis
::
connection
(
'
REDIS_CACHE_HOST
'
);
$redis
=
Redis
::
connection
(
'
redisCache
'
);
if
(
$url
!=
null
)
{
$url
=
base64_decode
(
str_replace
(
"<<SLASH>>"
,
"/"
,
$url
));
...
...
@@ -107,7 +107,7 @@ class HumanVerification extends Controller
private
static
function
removeUser
(
$request
,
$uid
)
{
$redis
=
Redis
::
conection
(
'
REDIS_CACHE_HOST
'
);
$redis
=
Redis
::
conection
(
'
redisCache
'
);
$id
=
hash
(
"sha512"
,
$request
->
ip
());
$userList
=
$redis
->
smembers
(
HumanVerification
::
PREFIX
.
"."
.
$id
);
...
...
app/Http/Middleware/HumanVerification.php
View file @
4b01570c
...
...
@@ -24,7 +24,7 @@ class HumanVerification
$user
=
null
;
$update
=
true
;
$prefix
=
"humanverification"
;
$redis
=
Redis
::
connection
(
'
REDIS_CACHE_HOST
'
);
$redis
=
Redis
::
connection
(
'
redisCache
'
);
try
{
$id
=
hash
(
"sha512"
,
$request
->
ip
());
$uid
=
hash
(
"sha512"
,
$request
->
ip
()
.
$_SERVER
[
"AGENT"
]);
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment