MDL-77007 auth: Remove auth-yui-passwordunmask

This was used as part of the auth_config.php configuration system for
the auth subsystem, which was deprecated in Moodle 3.3.

It has never had any other uses in core.

Whilst it would be ideal to deprecate it by replacing with an
alternative, it would be impossible to test.
This commit is contained in:
Andrew Nicols 2023-01-24 14:22:17 +08:00
parent 6a5512c999
commit 8fb8bfaf35
2 changed files with 1 additions and 42 deletions

View File

@ -3,6 +3,7 @@ information provided here is intended especially for developers.
=== 4.2 ===
* Support for configuration with the deprecated auth_config.php file has been removed.
* The moodle-auth-passwordunmask YUI module has been removed. Any uses should be replaced with core_form/passwordunmask.
=== 3.9 ===

View File

@ -1,42 +0,0 @@
YUI.add('moodle-auth-passwordunmask', function(Y) {
var PASSWORDUNMASK = function() {
PASSWORDUNMASK.superclass.constructor.apply(this, arguments);
}
Y.extend(PASSWORDUNMASK, Y.Base, {
// Initialize checkboxes.
initializer : function(params) {
this.add_checkboxes();
},
// Create checkboxes for all unmasking passwords.
add_checkboxes : function() {
Y.all('#authmenu input[type=password]').each(function(node) {
var checkboxlabel = M.util.get_string('unmaskpassword', 'core_form');
var elementid = node.get('id');
var elementname = node.get('name');
// Retain unmask div from previous implementation.
var unmaskdiv = Y.Node.create('<div id="'+elementid+'unmaskdiv" class="unmask"></div>');
// Add checkbox for unmasking to unmaskdiv.
var unmaskchb = Y.Node.create('<input id="'+elementid+'unmask" type="checkbox" name="'+elementname+'unmask">');
unmaskdiv.appendChild(unmaskchb);
//Attach event using static javascript function for unmasking password.
unmaskchb.on('click', function() {unmaskPassword(elementid);});
// Add label for checkbox to unmaskdiv.
var unmasklabel = Y.Node.create('<label for="'+elementid+'unmask">'+checkboxlabel+'</label>');
unmaskdiv.appendChild(unmasklabel);
// Insert unmask div in the same div as password input.
node.get('parentNode').insert(unmaskdiv, node.get('lastNode'));
});
return;
}
});
M.auth = M.auth || {};
M.auth.passwordunmask = function(params) {
return new PASSWORDUNMASK(params);
}
}, '@VERSION@', {requires:['base', 'node']});