Verified Commit 6bb169e8 authored by Alex ORLUC's avatar Alex ORLUC

FEAT #10887 TIME 1 handle authMode

parent 802e4402
......@@ -174,6 +174,7 @@
"administration": "Administration",
"confirmMsg": "Are you sure",
"yes": "Yes",
"no": "No"
"no": "No",
"ldapEnabled": "LDAP enabled"
}
}
......@@ -174,6 +174,7 @@
"administration": "Administration",
"confirmMsg": "Voulez-vous effectuer cette action",
"yes": "Oui",
"no": "Non"
"no": "Non",
"ldapEnabled": "LDAP activé"
}
}
......@@ -16,7 +16,12 @@ import { TranslateService } from '@ngx-translate/core';
export class AppComponent {
constructor(private translate: TranslateService, public http: HttpClient, public signaturesService: SignaturesContentService, public sanitizer: DomSanitizer, private cookieService: CookieService, public notificationService: NotificationService) {
this.http.get('../rest/connection')
.subscribe((data: any) => {
this.signaturesService.authMode = data.connection;
}, (err: any) => {
this.notificationService.handleErrors(err);
});
if (this.cookieService.check('maarchParapheurLang')) {
const cookieInfoLang = this.cookieService.get('maarchParapheurLang');
translate.setDefaultLang(cookieInfoLang);
......
......@@ -7,7 +7,8 @@
</mat-form-field>
<mat-form-field class="input-row">
<input id="password" name="password" matInput placeholder="{{'lang.password' | translate}}" type="password" [(ngModel)]="newLogin.password">
<mat-hint align="end"><a routerLink="/forgot-password" class="forgotPwdLink">{{'lang.forgotPassword' | translate}} ?</a></mat-hint>
<mat-hint align="end" *ngIf="signaturesService.authMode === 'default'"><a routerLink="/forgot-password" class="infoLogin">{{'lang.forgotPassword' | translate}} ?</a></mat-hint>
<mat-hint align="end" *ngIf="signaturesService.authMode === 'ldap'"><span class="infoLogin">{{'lang.ldapEnabled' | translate}}</span></mat-hint>
</mat-form-field>
<button type="submit" mat-button [disabled]="newLogin.id == '' || newLogin.password == '' || loadingConnexion">{{labelButton | translate}}</button>
</form>
......
......@@ -37,7 +37,7 @@ footer {
opacity: 0.5;
}
.forgotPwdLink {
.infoLogin {
font-weight: bold;
color: #135F7F;
text-decoration: none;
......
......@@ -37,7 +37,7 @@
<input name="nom" matInput placeholder="{{'lang.lastname' | translate}}"
[(ngModel)]="profileInfo.lastname" required>
</mat-form-field>
<mat-accordion>
<mat-accordion *ngIf="signaturesService.authMode === 'default'">
<mat-expansion-panel (closed)="showPassword=false" (opened)="changePasswd()"
#passwordContent>
<mat-expansion-panel-header>
......
......@@ -3,6 +3,7 @@ import { Injectable } from '@angular/core';
@Injectable()
export class SignaturesContentService {
authMode: string = '';
userLogged: any = {};
mainDocumentId = 0;
signaturesContent: any[] = [];
......@@ -57,6 +58,7 @@ export class SignaturesContentService {
}
reset() {
this.authMode = '';
this.userLogged = {};
this.mainDocumentId = 0;
this.signaturesContent = [];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment