Skip to content
Snippets Groups Projects
Commit 729a2340 authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

logging the lock reason

parent e0f2813f
No related branches found
No related tags found
1 merge request!1994Resolve "CSP Verification"
...@@ -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 {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment