MDL-67950 core: check_password_policy only fires when passwordpolicy = 1

This commit is contained in:
Brendan Heywood 2020-02-19 09:46:21 +11:00
parent 2c0b08c5a7
commit 648e20ab6d
2 changed files with 10 additions and 9 deletions

View File

@ -5006,16 +5006,16 @@ function check_password_policy($password, &$errmsg, $user = null) {
if (!check_consecutive_identical_characters($password, $CFG->maxconsecutiveidentchars)) {
$errmsg .= '<div>'. get_string('errormaxconsecutiveidentchars', 'auth', $CFG->maxconsecutiveidentchars) .'</div>';
}
}
// Fire any additional password policy functions from plugins.
// Plugin functions should output an error message string or empty string for success.
$pluginsfunction = get_plugins_with_function('check_password_policy');
foreach ($pluginsfunction as $plugintype => $plugins) {
foreach ($plugins as $pluginfunction) {
$pluginerr = $pluginfunction($password, $user);
if ($pluginerr) {
$errmsg .= '<div>'. $pluginerr .'</div>';
// Fire any additional password policy functions from plugins.
// Plugin functions should output an error message string or empty string for success.
$pluginsfunction = get_plugins_with_function('check_password_policy');
foreach ($pluginsfunction as $plugintype => $plugins) {
foreach ($plugins as $pluginfunction) {
$pluginerr = $pluginfunction($password, $user);
if ($pluginerr) {
$errmsg .= '<div>'. $pluginerr .'</div>';
}
}
}
}

View File

@ -32,6 +32,7 @@ information provided here is intended especially for developers.
* The database drivers (moodle_database and subclasses) don't need to implement get_columns() anymore.
They have to implement fetch_columns instead.
* Added function cleanup_after_drop to the database_manager class to take care of all the cleanups that need to be done after a table is dropped.
* The 'xxxx_check_password_policy' callback now only fires if $CFG->passwordpolicy is true
=== 3.8 ===
* Add CLI option to notify all cron tasks to stop: admin/cli/cron.php --stop