Skip to content
Snippets Groups Projects
Verified Commit 78162edf authored by Alex ORLUC's avatar Alex ORLUC
Browse files

FIX #8489 add required password if enable auth

parent 9e677a2a
No related branches found
No related tags found
No related merge requests found
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
<div class="form-group" [style.opacity]="sendmail.type != 'smtp' ? '0.5' : '1'"> <div class="form-group" [style.opacity]="sendmail.type != 'smtp' ? '0.5' : '1'">
<div class="col-md-12"> <div class="col-md-12">
<mat-slide-toggle color="primary" name="SMTPAuth" [(ngModel)]="sendmail.auth" <mat-slide-toggle color="primary" name="SMTPAuth" [(ngModel)]="sendmail.auth"
[disabled]="sendmail.type != 'smtp'"(change)="cleanAuthInfo()">{{lang.enableAuth}}</mat-slide-toggle> [disabled]="sendmail.type != 'smtp'"(change)="cleanAuthInfo($event)">{{lang.enableAuth}}</mat-slide-toggle>
</div> </div>
</div> </div>
<div class="form-group" [style.opacity]="sendmail.type != 'smtp' ? '0.5' : '1'"> <div class="form-group" [style.opacity]="sendmail.type != 'smtp' ? '0.5' : '1'">
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
<div class="col-md-12"> <div class="col-md-12">
<mat-form-field> <mat-form-field>
<input name="password" [type]="hidePassword ? 'password' : 'text'" [(ngModel)]="sendmail.password" <input name="password" [type]="hidePassword ? 'password' : 'text'" [(ngModel)]="sendmail.password"
[disabled]="!sendmail.auth || sendmail.type != 'smtp'" matInput placeholder="{{passwordLabel}}"> [disabled]="!sendmail.auth || sendmail.type != 'smtp'" matInput [placeholder]="sendmail.passwordAlreadyExists === true ? this.lang.passwordModification : this.lang.password" [required]="!sendmail.passwordAlreadyExists">
<mat-icon color="primary" style="cursor: pointer;" matSuffix (click)="hidePassword = !hidePassword" <mat-icon color="primary" style="cursor: pointer;" matSuffix (click)="hidePassword = !hidePassword"
class="fa fa-2x" [ngClass]="[hidePassword ? 'fa-eye-slash' : 'fa-eye']"></mat-icon> class="fa fa-2x" [ngClass]="[hidePassword ? 'fa-eye-slash' : 'fa-eye']"></mat-icon>
</mat-form-field> </mat-form-field>
......
...@@ -104,11 +104,6 @@ export class SendmailAdministrationComponent implements OnInit { ...@@ -104,11 +104,6 @@ export class SendmailAdministrationComponent implements OnInit {
this.sendmail = data.configuration.value this.sendmail = data.configuration.value
this.sendmailClone = JSON.parse(JSON.stringify(this.sendmail)); this.sendmailClone = JSON.parse(JSON.stringify(this.sendmail));
this.smtpTypeDesc = this.lang[this.sendmail.type + 'Desc']; this.smtpTypeDesc = this.lang[this.sendmail.type + 'Desc'];
if (this.sendmail.passwordAlreadyExists === true) {
this.passwordLabel = this.lang.passwordModification;
} else {
this.passwordLabel = this.lang.password;
}
this.loading = false; this.loading = false;
}, (err) => { }, (err) => {
...@@ -190,7 +185,9 @@ export class SendmailAdministrationComponent implements OnInit { ...@@ -190,7 +185,9 @@ export class SendmailAdministrationComponent implements OnInit {
}); });
} }
cleanAuthInfo() { cleanAuthInfo(event: any) {
this.sendmail.passwordAlreadyExists = false;
this.sendmail.user = ''; this.sendmail.user = '';
this.sendmail.password = ''; this.sendmail.password = '';
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment