Skip to content

Commit

Permalink
MDL-57021 passwords: only use unmask field with shared secrets
Browse files Browse the repository at this point in the history
When a user is entering a password which isn't returned back to them
then its not correct to use the unmask element - this element was
designed for places where we are storing shared secrets.
  • Loading branch information
danpoltawski committed Jun 15, 2017
1 parent 4c6063b commit dd58863
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion enrol/guest/locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function definition() {
$heading = $plugin->get_instance_name($instance);
$mform->addElement('header', 'guestheader', $heading);

$mform->addElement('passwordunmask', 'guestpassword', get_string('password', 'enrol_guest'));
$mform->addElement('password', 'guestpassword', get_string('password', 'enrol_guest'));

$this->add_action_buttons(false, get_string('submit'));

Expand Down
2 changes: 1 addition & 1 deletion enrol/self/locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function definition() {

if ($instance->password) {
// Change the id of self enrolment key input as there can be multiple self enrolment methods.
$mform->addElement('passwordunmask', 'enrolpassword', get_string('password', 'enrol_self'),
$mform->addElement('password', 'enrolpassword', get_string('password', 'enrol_self'),
array('id' => 'enrolpassword_'.$instance->id));
$context = context_course::instance($this->instance->courseid);
$keyholders = get_users_by_capability($context, 'enrol/self:holdkey', user_picture::fields('u'));
Expand Down
2 changes: 1 addition & 1 deletion login/signup_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function definition() {
if (!empty($CFG->passwordpolicy)){
$mform->addElement('static', 'passwordpolicyinfo', '', print_password_policy());
}
$mform->addElement('passwordunmask', 'password', get_string('password'), 'maxlength="32" size="12"');
$mform->addElement('password', 'password', get_string('password'), 'maxlength="32" size="12"');
$mform->setType('password', core_user::get_property_type('password'));
$mform->addRule('password', get_string('missingpassword'), 'required', null, 'client');

Expand Down

0 comments on commit dd58863

Please sign in to comment.