Skip to content
Extraits de code Groupes Projets
Valider 28066b5c rédigé par Stefan Giehl's avatar Stefan Giehl Validation de Matthieu Aubry
Parcourir les fichiers

do not show smtp password in html (#11428)

parent 615b7c64
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -132,6 +132,12 @@ class Controller extends ControllerAdmin
$mail['type'] = Common::getRequestVar('mailType', '');
$mail['username'] = Common::unsanitizeInputValue(Common::getRequestVar('mailUsername', ''));
$mail['password'] = Common::unsanitizeInputValue(Common::getRequestVar('mailPassword', ''));
if (!array_key_exists('mailPassword', $_POST)) {
// use old password if it wasn't set in request
$mail['password'] = Config::getInstance()->mail['password'];
}
$mail['encryption'] = Common::getRequestVar('mailEncryption', '');
Config::getInstance()->mail = $mail;
......
......@@ -17,21 +17,28 @@
var self = this;
this.isLoading = false;
this.passwordChanged = false;
this.save = function () {
this.isLoading = true;
piwikApi.withTokenInUrl();
piwikApi.post({module: 'CoreAdminHome', action: 'setMailSettings'}, {
var mailSettings = {
mailUseSmtp: this.enabled ? '1' : '0',
mailPort: this.mailPort,
mailHost: this.mailHost,
mailType: this.mailType,
mailUsername: this.mailUsername,
mailPassword: this.mailPassword,
mailEncryption: this.mailEncryption,
}).then(function (success) {
mailEncryption: this.mailEncryption
};
if (this.passwordChanged) {
mailSettings.mailPassword = this.mailPassword;
}
piwikApi.withTokenInUrl();
piwikApi.post({module: 'CoreAdminHome', action: 'setMailSettings'}, mailSettings)
.then(function (success) {
self.isLoading = false;
......
......@@ -130,8 +130,9 @@
<div piwik-field uicontrol="password" name="mailPassword"
ng-model="mailSettings.mailPassword"
ng-change="mailSettings.passwordChanged = true"
title="{{ 'General_SmtpPassword'|translate|e('html_attr') }}"
value="{{ mail.password }}" inline-help="{{ help|e('html_attr') }}">
value="{{ mail.password ? '******' }}" inline-help="{{ help|e('html_attr') }}">
</div>
<div piwik-field uicontrol="select" name="mailEncryption"
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter