MDL-53244 login: Add error message for recaptcha
authorMathew May <mathewm@hotmail.co.nz>
Fri, 8 Sep 2017 01:09:29 +0000 (13:09 +1200)
committerMathew May <mathewm@hotmail.co.nz>
Fri, 8 Sep 2017 01:09:29 +0000 (13:09 +1200)
login/signup_form.php

index f7b9e21..246ecf7 100644 (file)
@@ -130,10 +130,10 @@ class login_signup_form extends moodleform implements renderable, templatable {
                 $challenge_field = $this->_form->_submitValues['recaptcha_challenge_field'];
                 $response_field = $this->_form->_submitValues['recaptcha_response_field'];
                 if (true !== ($result = $recaptcha_element->verify($challenge_field, $response_field))) {
-                    $errors['recaptcha'] = $result;
+                    $errors['recaptcha_element'] = get_string('incorrectpleasetryagain', 'auth');
                 }
             } else {
-                $errors['recaptcha'] = get_string('missingrecaptchachallengefield');
+                $errors['recaptcha_element'] = get_string('missingrecaptchachallengefield');
             }
         }