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
729a2340
Commit
729a2340
authored
2 years ago
by
Dominik Hebeler
Browse files
Options
Downloads
Patches
Plain Diff
logging the lock reason
parent
e0f2813f
No related branches found
Branches containing commit
No related tags found
1 merge request
!1994
Resolve "CSP Verification"
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
metager/app/Http/Middleware/HumanVerification.php
+13
-5
13 additions, 5 deletions
metager/app/Http/Middleware/HumanVerification.php
with
13 additions
and
5 deletions
metager/app/Http/Middleware/HumanVerification.php
+
13
−
5
View file @
729a2340
...
@@ -6,8 +6,6 @@ use App;
...
@@ -6,8 +6,6 @@ use App;
use
App\Models\Verification\HumanVerification
as
ModelsHumanVerification
;
use
App\Models\Verification\HumanVerification
as
ModelsHumanVerification
;
use
Cache
;
use
Cache
;
use
Closure
;
use
Closure
;
use
Cookie
;
use
Log
;
use
URL
;
use
URL
;
use
App\QueryTimer
;
use
App\QueryTimer
;
use
App\SearchSettings
;
use
App\SearchSettings
;
...
@@ -64,7 +62,6 @@ class HumanVerification
...
@@ -64,7 +62,6 @@ class HumanVerification
// The specific user
// The specific user
$user
=
null
;
$user
=
null
;
$update
=
true
;
/** @var ModelsHumanVerification */
/** @var ModelsHumanVerification */
$user
=
App
::
make
(
ModelsHumanVerification
::
class
);
$user
=
App
::
make
(
ModelsHumanVerification
::
class
);
...
@@ -87,7 +84,7 @@ class HumanVerification
...
@@ -87,7 +84,7 @@ class HumanVerification
$user
->
saveUser
();
$user
->
saveUser
();
\App\Http\Controllers\HumanVerification
::
logCaptcha
(
$request
);
\App\Http\Controllers\HumanVerification
::
logCaptcha
(
$request
);
\app
()
->
make
(
QueryTimer
::
class
)
->
observeEnd
(
self
::
class
);
\app
()
->
make
(
QueryTimer
::
class
)
->
observeEnd
(
self
::
class
);
$this
->
logCaptcha
(
$request
);
$this
->
logCaptcha
(
$request
,
$user
);
echo
redirect
()
->
route
(
'captcha_show'
,
[
"url"
=>
URL
::
full
(),
"key"
=>
$user
->
key
]);
// TODO uncomment
echo
redirect
()
->
route
(
'captcha_show'
,
[
"url"
=>
URL
::
full
(),
"key"
=>
$user
->
key
]);
// TODO uncomment
return
;
return
;
}
}
...
@@ -99,13 +96,24 @@ class HumanVerification
...
@@ -99,13 +96,24 @@ class HumanVerification
return
$next
(
$request
);
return
$next
(
$request
);
}
}
private
function
logCaptcha
(
\Illuminate\Http\Request
$request
)
private
function
logCaptcha
(
\Illuminate\Http\Request
$request
,
ModelsHumanVerification
$user
)
{
{
$log
=
[
$log
=
[
now
()
->
format
(
"Y-m-d H:i:s"
),
now
()
->
format
(
"Y-m-d H:i:s"
),
$request
->
input
(
"eingabe"
),
$request
->
input
(
"eingabe"
),
"js="
.
\app
()
->
make
(
SearchSettings
::
class
)
->
javascript_enabled
,
"js="
.
\app
()
->
make
(
SearchSettings
::
class
)
->
javascript_enabled
,
];
];
$locked_verificators
=
array
();
foreach
(
$user
->
getVerificators
()
as
$verificator
)
{
if
(
$verificator
->
isLocked
())
{
$locked_verificator
=
$verificator
::
class
;
$locked_verificator
=
substr
(
$locked_verificator
,
\strrpos
(
$locked_verificator
,
"
\\
"
)
+
1
);
$locked_verificators
[]
=
$locked_verificator
;
}
}
if
(
!
empty
(
$locked_verificators
))
{
$log
[]
=
"verificators="
.
implode
(
","
,
$locked_verificators
);
}
$file_path
=
\storage_path
(
"logs/metager/captcha_show.csv"
);
$file_path
=
\storage_path
(
"logs/metager/captcha_show.csv"
);
$fh
=
fopen
(
$file_path
,
"a"
);
$fh
=
fopen
(
$file_path
,
"a"
);
try
{
try
{
...
...
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