$a->admin';
$string['emailpasswordconfirmationsubject'] = '$a: Change password confirmation';
$string['emailpasswordconfirmmaybesent'] = '<p>If you supplied a correct username or email address then an email should have been sent to you.</p>
- <p>It contains easy instructions to confirm and complete this password change.\r
+ <p>It contains easy instructions to confirm and complete this password change.
If you continue to have difficulty, please contact the site administrator.</p>';
$string['emailpasswordconfirmsent'] = 'An email should have been sent to your address at <b>$a</b>.
<br />It contains easy instructions to confirm and complete this password change.
$string['missingname'] = 'Missing name';
$string['missingnewpassword'] = 'Missing new password';
$string['missingpassword'] = 'Missing password';
+$string['missingrecaptchachallengefield'] = 'Missing reCAPTCHA challenge field';
$string['missingreqreason'] = 'Missing reason';
$string['missingshortname'] = 'Missing short name';
$string['missingshortsitename'] = 'Missing short site name';
}else{
$mform->setDefault('country', '');
}
-
+
if (signup_captcha_enabled()) {
$mform->addElement('recaptcha', 'recaptcha_element', get_string('recaptcha', 'auth'), array('https' => $CFG->loginhttps));
$mform->setHelpButton('recaptcha_element', array('recaptcha', get_string('recaptcha', 'auth')));
if (!check_password_policy($data['password'], $errmsg)) {
$errors['password'] = $errmsg;
}
-
+
if (signup_captcha_enabled()) {
- $recaptcha_element = $this->_form->getElement('recaptcha_element');
- $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;
+ $recaptcha_element = $this->_form->getElement('recaptcha_element');
+ if (!empty($this->_form->_submitValues['recaptcha_challenge_field'])) {
+ $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;
+ }
+ } else {
+ $errors['recaptcha'] = get_string('missingrecaptchachallengefield');
}
}
- return $errors;
+ return $errors;
+
+
}
}