]> git.agnieray.net Git - galette.git/commitdiff
Check captcha from controller; refs #1441
authorJohan Cwiklinski <johan@x-tnd.be>
Fri, 12 Jun 2020 10:31:12 +0000 (12:31 +0200)
committerJohan Cwiklinski <johan@x-tnd.be>
Fri, 12 Jun 2020 10:31:37 +0000 (12:31 +0200)
galette/lib/Galette/Controllers/Crud/MembersController.php

index 2fc018966c88b51d2dde01dc44b7e9e82e3f4f6a..f58ef0284a9a24704b7fa84ff6f3c3208f6540a7 100644 (file)
@@ -1504,6 +1504,17 @@ class MembersController extends CrudController
         $warning_detected = [];
         $error_detected = [];
 
+        //check captcha
+        if (isset($args['self'])) {
+            if (
+                !$post['mdp_crypt']
+                || !$post['mdp_adh']
+                || !crypt($post['mdp_adh'], $post['mdp_crypt']) == $post['mdp_crypt']
+            ) {
+                $error_detected[] = __('Please repeat in the field the password shown in the image.');
+            }
+        }
+
         // new or edit
         $adherent['id_adh'] = get_numeric_form_value('id_adh', '');
         if ($this->login->isAdmin() || $this->login->isStaff() || $this->login->isGroupManager()) {