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

FEAT #10887 TIME 1 handle authMode

parent 802e4402
No related branches found
No related tags found
No related merge requests found
...@@ -174,6 +174,7 @@ ...@@ -174,6 +174,7 @@
"administration": "Administration", "administration": "Administration",
"confirmMsg": "Are you sure", "confirmMsg": "Are you sure",
"yes": "Yes", "yes": "Yes",
"no": "No" "no": "No",
"ldapEnabled": "LDAP enabled"
} }
} }
...@@ -174,6 +174,7 @@ ...@@ -174,6 +174,7 @@
"administration": "Administration", "administration": "Administration",
"confirmMsg": "Voulez-vous effectuer cette action", "confirmMsg": "Voulez-vous effectuer cette action",
"yes": "Oui", "yes": "Oui",
"no": "Non" "no": "Non",
"ldapEnabled": "LDAP activé"
} }
} }
...@@ -16,7 +16,12 @@ import { TranslateService } from '@ngx-translate/core'; ...@@ -16,7 +16,12 @@ import { TranslateService } from '@ngx-translate/core';
export class AppComponent { export class AppComponent {
constructor(private translate: TranslateService, public http: HttpClient, public signaturesService: SignaturesContentService, public sanitizer: DomSanitizer, private cookieService: CookieService, public notificationService: NotificationService) { 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')) { if (this.cookieService.check('maarchParapheurLang')) {
const cookieInfoLang = this.cookieService.get('maarchParapheurLang'); const cookieInfoLang = this.cookieService.get('maarchParapheurLang');
translate.setDefaultLang(cookieInfoLang); translate.setDefaultLang(cookieInfoLang);
......
...@@ -7,7 +7,8 @@ ...@@ -7,7 +7,8 @@
</mat-form-field> </mat-form-field>
<mat-form-field class="input-row"> <mat-form-field class="input-row">
<input id="password" name="password" matInput placeholder="{{'lang.password' | translate}}" type="password" [(ngModel)]="newLogin.password"> <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> </mat-form-field>
<button type="submit" mat-button [disabled]="newLogin.id == '' || newLogin.password == '' || loadingConnexion">{{labelButton | translate}}</button> <button type="submit" mat-button [disabled]="newLogin.id == '' || newLogin.password == '' || loadingConnexion">{{labelButton | translate}}</button>
</form> </form>
......
...@@ -37,7 +37,7 @@ footer { ...@@ -37,7 +37,7 @@ footer {
opacity: 0.5; opacity: 0.5;
} }
.forgotPwdLink { .infoLogin {
font-weight: bold; font-weight: bold;
color: #135F7F; color: #135F7F;
text-decoration: none; text-decoration: none;
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
<input name="nom" matInput placeholder="{{'lang.lastname' | translate}}" <input name="nom" matInput placeholder="{{'lang.lastname' | translate}}"
[(ngModel)]="profileInfo.lastname" required> [(ngModel)]="profileInfo.lastname" required>
</mat-form-field> </mat-form-field>
<mat-accordion> <mat-accordion *ngIf="signaturesService.authMode === 'default'">
<mat-expansion-panel (closed)="showPassword=false" (opened)="changePasswd()" <mat-expansion-panel (closed)="showPassword=false" (opened)="changePasswd()"
#passwordContent> #passwordContent>
<mat-expansion-panel-header> <mat-expansion-panel-header>
......
...@@ -3,6 +3,7 @@ import { Injectable } from '@angular/core'; ...@@ -3,6 +3,7 @@ import { Injectable } from '@angular/core';
@Injectable() @Injectable()
export class SignaturesContentService { export class SignaturesContentService {
authMode: string = '';
userLogged: any = {}; userLogged: any = {};
mainDocumentId = 0; mainDocumentId = 0;
signaturesContent: any[] = []; signaturesContent: any[] = [];
...@@ -57,6 +58,7 @@ export class SignaturesContentService { ...@@ -57,6 +58,7 @@ export class SignaturesContentService {
} }
reset() { reset() {
this.authMode = '';
this.userLogged = {}; this.userLogged = {};
this.mainDocumentId = 0; this.mainDocumentId = 0;
this.signaturesContent = []; this.signaturesContent = [];
......
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