MDL-36721 do not store passwords in config logs
This commit is contained in:
+27
-1
@@ -1660,11 +1660,21 @@ abstract class admin_setting {
|
||||
rebuild_course_cache(0, true);
|
||||
}
|
||||
|
||||
add_to_config_log($name, $oldvalue, $value, $this->plugin);
|
||||
$this->add_to_config_log($name, $oldvalue, $value);
|
||||
|
||||
return true; // BC only
|
||||
}
|
||||
|
||||
/**
|
||||
* Log config changes if necessary.
|
||||
* @param string $name
|
||||
* @param string $oldvalue
|
||||
* @param string $value
|
||||
*/
|
||||
protected function add_to_config_log($name, $oldvalue, $value) {
|
||||
add_to_config_log($name, $oldvalue, $value, $this->plugin);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns current value of this setting
|
||||
* @return mixed array or string depending on instance, NULL means not set yet
|
||||
@@ -2161,6 +2171,22 @@ class admin_setting_configpasswordunmask extends admin_setting_configtext {
|
||||
parent::__construct($name, $visiblename, $description, $defaultsetting, PARAM_RAW, 30);
|
||||
}
|
||||
|
||||
/**
|
||||
* Log config changes if necessary.
|
||||
* @param string $name
|
||||
* @param string $oldvalue
|
||||
* @param string $value
|
||||
*/
|
||||
protected function add_to_config_log($name, $oldvalue, $value) {
|
||||
if ($value !== '') {
|
||||
$value = '********';
|
||||
}
|
||||
if ($oldvalue !== '' and $oldvalue !== null) {
|
||||
$oldvalue = '********';
|
||||
}
|
||||
parent::add_to_config_log($name, $oldvalue, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns XHTML for the field
|
||||
* Writes Javascript into the HTML below right before the last div
|
||||
|
||||
Reference in New Issue
Block a user