From 280daa7f3f858ecfef9c91ffd5dea1007f021048 Mon Sep 17 00:00:00 2001
From: rsanchez <rsanchez@curisit.net>
Date: Sun, 19 Mar 2017 11:29:37 +0000
Subject: [PATCH] #3527 fix - Added applications and some minor refactoring

---
 securis/src/main/webapp/src/app/menu.component.ts |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/securis/src/main/webapp/src/app/menu.component.ts b/securis/src/main/webapp/src/app/menu.component.ts
index 0e5cd83..8866068 100644
--- a/securis/src/main/webapp/src/app/menu.component.ts
+++ b/securis/src/main/webapp/src/app/menu.component.ts
@@ -1,8 +1,10 @@
+import { LocaleService } from './common/i18n';
+import { LocalStorageService } from 'angular-2-local-storage';
 import { Observable } from 'rxjs/Observable';
 import { BaseRequestOptions, Http } from '@angular/http';
 import { Component, ViewChild } from '@angular/core';
 import { UserService } from './user.service';
-import { Router } from '@angular/router';
+import { ActivatedRoute, Router } from '@angular/router';
 import { TdNavigationDrawerComponent } from '@covalent/core'
 
 
@@ -13,8 +15,12 @@
 
   @ViewChild('mainMenu') mainMenu: TdNavigationDrawerComponent;
 
+  userFullName: string;
 
   constructor(private userService: UserService,
+              private store: LocalStorageService,
+              private $L: LocaleService,
+              private route: ActivatedRoute,
               private router: Router) {
   }
 
@@ -23,8 +29,12 @@
         let isLoggedIn = authOk.valueOf();
         if (!isLoggedIn) {
           this.router.navigateByUrl('public/login');
+          this.userFullName = null;
         } else {
-          this.router.navigate(['packs']);
+          if (this.route.firstChild == null) {
+            this.router.navigate(['packs']);
+          }
+          this.userFullName = this.store.get<string>("user_full_name");
         }
       }  , 
       err => /* Show message */ this.router.navigateByUrl('public/login'));  

--
Gitblit v1.3.2