From bb43ba42de9ede8b02e708e65dcd469705bf4b4b Mon Sep 17 00:00:00 2001
From: Dominik Hebeler <dominik@suma-ev.de>
Date: Thu, 6 Jun 2019 15:59:19 +0200
Subject: [PATCH] removed dow

---
 app/Http/Controllers/HumanVerification.php    | 37 +------------------
 resources/lang/de/captcha.php                 |  2 +-
 resources/lang/en/captcha.php                 |  2 +-
 resources/lang/es/captcha.php                 |  2 +-
 .../views/humanverification/captcha.blade.php |  1 -
 5 files changed, 4 insertions(+), 40 deletions(-)

diff --git a/app/Http/Controllers/HumanVerification.php b/app/Http/Controllers/HumanVerification.php
index 19943670a..671147738 100644
--- a/app/Http/Controllers/HumanVerification.php
+++ b/app/Http/Controllers/HumanVerification.php
@@ -8,7 +8,6 @@ use Illuminate\Hashing\BcryptHasher as Hasher;
 use Illuminate\Http\Request;
 use Illuminate\Support\Facades\Redis;
 use Input;
-use LaravelLocalization;
 
 class HumanVerification extends Controller
 {
@@ -27,41 +26,7 @@ class HumanVerification extends Controller
         }
 
         if ($request->getMethod() == 'POST') {
-            # Check if Weekday matches
-            $weekdays = [
-                'de' => [
-                    'montag',
-                    'dienstag',
-                    'mittwoch',
-                    'donnerstag',
-                    'freitag',
-                    'samstag',
-                    'sonntag',
-                ],
-                'en' => [
-                    'monday',
-                    'tuesday',
-                    'wednesday',
-                    'thursday',
-                    'friday',
-                    'saturday',
-                    'sunday',
-                ],
-                'es' => [
-                    'lunes',
-                    'martes',
-                    'miércoles',
-                    'jueves',
-                    'viernes',
-                    'sábado',
-                    'domingo',
-                ],
-            ];
-            $lang = LaravelLocalization::getCurrentLocale();
-            $dow = Carbon::now()->dayOfWeek;
-
-            $dowCheck = strtolower(trim($request->input('dw', ''))) === $weekdays[$lang][$dow - 1];
-
+            $dowCheck = true;
             # Temp remove later
             # Check for recent Spams
             if (\preg_match("/eingabe=[\\d]{3}\s*chan.*$/si", $url)) {
diff --git a/resources/lang/de/captcha.php b/resources/lang/de/captcha.php
index 3a1ac2e11..28a9e6854 100644
--- a/resources/lang/de/captcha.php
+++ b/resources/lang/de/captcha.php
@@ -3,7 +3,7 @@ return [
     '1' => 'Entschuldigen Sie die Störung',
     '2' => 'Sie befinden sich in einem Netzwerk aus dem wir verstärkt automatisierte Anfragen erhalten. Keine Sorge: Das bedeutet nicht unbedingt, dass diese Anfragen von Ihrem PC kommen.',
     '3' => 'Allerdings können wir Ihre Anfragen nicht von denen des "Robots" unterscheiden. Zum Schutz der von uns abgefragten Suchmaschinen müssen wir aber sicherstellen, dass diese nicht mit (automatisierten) Abfragen überflutet werden.',
-    '4' => 'Bitte geben Sie deshalb die Zeichen aus dem Bild in die erste Eingabebox und den heutigen Wochentag in die zweite Eingabebox ein und bestätigen Sie mit "OK" um zur Ergebnisseite zu gelangen.',
+    '4' => 'Bitte geben Sie deshalb die Zeichen aus dem Bild in die Eingabebox und bestätigen Sie mit "OK" um zur Ergebnisseite zu gelangen.',
     '5' => 'Captcha eingeben',
     '6' => 'Wochentag eingeben',
     '7' => 'Sollten Sie diese Nachricht häufiger sehen oder handelt es sich dabei um einen Irrtum, schicken Sie uns gerne eine Nachricht über unser <a href=":url">Kontaktformular</a>.',
diff --git a/resources/lang/en/captcha.php b/resources/lang/en/captcha.php
index 6dbd03d8a..d9f0a4cfc 100644
--- a/resources/lang/en/captcha.php
+++ b/resources/lang/en/captcha.php
@@ -3,7 +3,7 @@ return [
     '1' => 'Sorry to bother you',
     '2' => 'You are in a network from which we increasingly receive automated requests. Do not worry: this does not necessarily mean that these requests come from your PC.',
     '3' => 'However, we can not distinguish your requests from those of the "robot". To protect the search engines we query, we must ensure that they are not flooded with (automated) queries.',
-    '4' => 'Therefore, please enter the characters from the picture in the first input box and today\'s day of the week in the second input box and confirm with "OK" to get to the result page.',
+    '4' => 'Please enter the characters from the picture in the input box and confirm with "OK" to get to the result page.',
     '5' => 'Enter captcha',
     '6' => 'Enter weekday',
     '7' => 'If you see this message more often, or if it is a mistake, feel free to send a message via our <a href=":url"> contact form </a>.',
diff --git a/resources/lang/es/captcha.php b/resources/lang/es/captcha.php
index 88ef414ae..1b9d3c18c 100644
--- a/resources/lang/es/captcha.php
+++ b/resources/lang/es/captcha.php
@@ -3,7 +3,7 @@ return [
     '1' => 'Perdon por la molestia',
     '2' => 'Estás en una red desde la que recibimos cada vez más consultas automáticas. No se preocupe: esto no significa necesariamente que estas solicitudes provengan de su PC.',
     '3' => 'Sin embargo, no podemos distinguir sus peticiones de las del "robot". Para proteger los motores de búsqueda que consultamos, debemos asegurarnos de que no estén inundados de consultas (automatizadas).',
-    '4' => 'Por lo tanto, ingrese los caracteres de la imagen en el primer cuadro de entrada y el día de la semana de hoy en el segundo cuadro de entrada y confirme con "OK" para acceder a la página de resultados.',
+    '4' => 'Ingrese los caracteres de la imagen en el cuadro de entrada y confirme con "OK" para llegar a la página de resultados.',
     '5' => 'Entrar en captcha',
     '6' => 'Entrar en día laborable',
     '7' => 'Si ve este mensaje con más frecuencia o si es un error, puede enviar un mensaje a través de nuestro <a href=":url"> formulario de contacto </a>.',
diff --git a/resources/views/humanverification/captcha.blade.php b/resources/views/humanverification/captcha.blade.php
index 98be1b756..7ab225496 100644
--- a/resources/views/humanverification/captcha.blade.php
+++ b/resources/views/humanverification/captcha.blade.php
@@ -15,7 +15,6 @@
         <p><font color="red">{{$errorMessage}}</font></p>
         @endif
         <p><input type="text" class="form-control" name="captcha" placeholder="@lang('captcha.5')" autofocus></p>
-        <p><input type="text" class="form-control" name="dw" placeholder="@lang('captcha.6')"></p>
         <p><button type="submit" class="btn btn-success" name="check">OK</button></p>
     </form>
     <p>@lang('captcha.7', ['url' => LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), 'kontakt')])</p>
-- 
GitLab