mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-21 13:55:51 +00:00
save
This commit is contained in:
@@ -23,7 +23,7 @@ export class InactivityGuard implements CanActivate {
|
|||||||
|
|
||||||
console.log('hire inactinity!', state.url)
|
console.log('hire inactinity!', state.url)
|
||||||
|
|
||||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
if ((this.platform.is('desktop') || this.platform.is('mobileweb')) && (SessionStore?.user?.Inactivity) ) {
|
||||||
if(this.p.userPermission(this.p.permissionList.Agenda.access) || this.p.userPermission(this.p.permissionList.Gabinete.access)){
|
if(this.p.userPermission(this.p.permissionList.Agenda.access) || this.p.userPermission(this.p.permissionList.Gabinete.access)){
|
||||||
this.router.navigate(['/home/events']);
|
this.router.navigate(['/home/events']);
|
||||||
}
|
}
|
||||||
@@ -64,29 +64,33 @@ export class InactivityGuard implements CanActivate {
|
|||||||
}//Mobile or Tablet without session
|
}//Mobile or Tablet without session
|
||||||
else {
|
else {
|
||||||
|
|
||||||
if(this.p.userPermission(this.p.permissionList.Agenda.access) || this.p.userPermission(this.p.permissionList.Gabinete.access)){
|
if((SessionStore?.user?.Inactivity)) {
|
||||||
this.router.navigate(['/home/events']);
|
if(this.p.userPermission(this.p.permissionList.Agenda.access) || this.p.userPermission(this.p.permissionList.Gabinete.access)){
|
||||||
|
this.router.navigate(['/home/events']);
|
||||||
|
}
|
||||||
|
else if(this.p.userPermission(this.p.permissionList.Chat.access) && this.p.userPermission(this.p.permissionList.Actions.access)){
|
||||||
|
this.router.navigate(['/home/chat']);
|
||||||
|
}
|
||||||
|
else if(this.p.userPermission(this.p.permissionList.Actions.access)){
|
||||||
|
this.router.navigate(['/home/publications']);
|
||||||
|
} else {
|
||||||
|
this.alertController.create({
|
||||||
|
cssClass: 'my-custom-class',
|
||||||
|
header: 'Utilizador sem acesso a aplicação',
|
||||||
|
buttons: [{
|
||||||
|
text: 'Ok',
|
||||||
|
handler: () => {
|
||||||
|
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
}).then( async (alertPopup)=>{
|
||||||
|
await alertPopup.present();
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
else if(this.p.userPermission(this.p.permissionList.Chat.access) && this.p.userPermission(this.p.permissionList.Actions.access)){
|
|
||||||
this.router.navigate(['/home/chat']);
|
|
||||||
}
|
|
||||||
else if(this.p.userPermission(this.p.permissionList.Actions.access)){
|
|
||||||
this.router.navigate(['/home/publications']);
|
|
||||||
} else {
|
|
||||||
this.alertController.create({
|
|
||||||
cssClass: 'my-custom-class',
|
|
||||||
header: 'Utilizador sem acesso a aplicação',
|
|
||||||
buttons: [{
|
|
||||||
text: 'Ok',
|
|
||||||
handler: () => {
|
|
||||||
|
|
||||||
}
|
|
||||||
}]
|
|
||||||
}).then( async (alertPopup)=>{
|
|
||||||
await alertPopup.present();
|
|
||||||
})
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,18 +21,20 @@ export class LoginGuard implements CanActivate {
|
|||||||
|
|
||||||
|
|
||||||
if(SessionStore.exist && SessionStore.user.Inactivity && SessionStore.user.LoginPreference != 'Pin' ) {
|
if(SessionStore.exist && SessionStore.user.Inactivity && SessionStore.user.LoginPreference != 'Pin' ) {
|
||||||
|
// enter app
|
||||||
this.router.navigate(['/home/events']);
|
this.router.navigate(['/home/events']);
|
||||||
return false
|
return false
|
||||||
} else if(SessionStore.exist && !SessionStore.user.Inactivity && SessionStore.user.LoginPreference == 'Pin' && SessionStore.forceToLoginWithForceToLogInWithPassword && !this.platform.is('desktop') && !this.platform.is('mobileweb')) {
|
} else if(SessionStore.exist && !SessionStore.user.Inactivity && SessionStore.user.LoginPreference == 'Pin' && SessionStore.forceToLoginWithForceToLogInWithPassword && !this.platform.is('desktop') && !this.platform.is('mobileweb')) {
|
||||||
|
// login with password while has pin
|
||||||
SessionStore.forceToLoginWithForceToLogInWithPassword = false
|
SessionStore.forceToLoginWithForceToLogInWithPassword = false
|
||||||
return true
|
return true
|
||||||
} else if(SessionStore.exist && SessionStore.user.Inactivity && !SessionStore.hasPin && !this.platform.is('desktop') && !this.platform.is('mobileweb') ) {
|
} else if(SessionStore.exist && !this.platform.is('desktop') && !this.platform.is('mobileweb') ) {
|
||||||
|
// go to pin page
|
||||||
this.router.navigate(['/pin']);
|
this.router.navigate(['/pin']);
|
||||||
return false
|
return false
|
||||||
} else if(SessionStore.exist && !SessionStore.user.Inactivity && SessionStore.user.LoginPreference == 'Pin' && !this.platform.is('desktop') && !this.platform.is('mobileweb')) {
|
} else if(SessionStore.exist && !SessionStore.user.Inactivity && SessionStore.user.LoginPreference == 'Pin' && !this.platform.is('desktop') && !this.platform.is('mobileweb')) {
|
||||||
this.router.navigate(['/inactivity']);
|
this.router.navigate(['/inactivity']);
|
||||||
return false
|
return false
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user