MDL-55564 output: Use template for password autofill hack

Part of MDL-55071
This commit is contained in:
Frederic Massart
2016-09-23 10:53:55 +01:00
committed by Dan Poltawski
parent d3c35f934a
commit cd7a164bdf
2 changed files with 25 additions and 1 deletions
@@ -0,0 +1,23 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
Snippet to prevent browsers from autofilling password fields.
}}
<div class="hide">
<input type="text" class="ignoredirty" />
<input type="password" class="ignoredirty" />
</div>
+2 -1
View File
@@ -3744,5 +3744,6 @@ function get_formatted_help_string($identifier, $component, $ajax = false, $a =
* @return string HTML to prevent password autofill
*/
function prevent_form_autofill_password() {
return '<div class="hide"><input type="text" class="ignoredirty" /><input type="password" class="ignoredirty" /></div>';
global $OUTPUT;
return $OUTPUT->render_from_template('core/prevent_form_autofill_password', []);
}