Skip to content

Commit

Permalink
MDL-61261 badges: Add email validation during backpack configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
sarjona committed Feb 2, 2018
1 parent a409707 commit 8d7c385
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions badges/backpack_form.php
Expand Up @@ -61,10 +61,10 @@ public function definition() {
array('class' => 'notconnected', 'id' => 'connection-status'));
$mform->addElement('static', 'status', get_string('status'), $status);
$mform->addElement('hidden', 'email', $this->_customdata['email']);
$mform->setType('email', PARAM_RAW_TRIMMED);
$mform->setType('email', PARAM_EMAIL);
$mform->hardFreeze(['email']);
$status = html_writer::tag('span', $this->_customdata['email'], []);
$mform->addElement('static', 'emailverify', get_string('email'), $status);
$emailverify = html_writer::tag('span', s($this->_customdata['email']), []);
$mform->addElement('static', 'emailverify', get_string('email'), $emailverify);
$buttonarray = [];
$buttonarray[] = &$mform->createElement('submit', 'submitbutton',
get_string('backpackconnectionresendemail', 'badges'));
Expand All @@ -80,7 +80,7 @@ public function definition() {
$mform->addElement('text', 'email', get_string('email'), 'maxlength="100" size="30"');
$mform->addHelpButton('email', 'backpackemail', 'badges');
$mform->addRule('email', get_string('required'), 'required', null, 'client');
$mform->setType('email', PARAM_RAW_TRIMMED);
$mform->setType('email', PARAM_EMAIL);
$this->add_action_buttons(false, get_string('backpackconnectionconnect', 'badges'));
}
}
Expand Down

0 comments on commit 8d7c385

Please sign in to comment.