|
|
|
@ -27,7 +27,6 @@ export default function AppRun($rootScope, $window, $injector, $location, $log, |
|
|
|
// ie11 fix
|
|
|
|
} |
|
|
|
|
|
|
|
var unauthorizedDialog = null; |
|
|
|
var forbiddenDialog = null; |
|
|
|
|
|
|
|
$rootScope.iframeMode = false; |
|
|
|
@ -125,11 +124,17 @@ export default function AppRun($rootScope, $window, $injector, $location, $log, |
|
|
|
reloadUserFromPublicId(); |
|
|
|
} else if (to.module === 'private') { |
|
|
|
evt.preventDefault(); |
|
|
|
/* |
|
|
|
if (to.url === '/home' || to.url === '/') { |
|
|
|
$state.go('login', params); |
|
|
|
} else { |
|
|
|
showUnauthorizedDialog(); |
|
|
|
} |
|
|
|
*/ |
|
|
|
var redirectParams = {}; |
|
|
|
redirectParams.toName = to.name; |
|
|
|
redirectParams.params = params; |
|
|
|
$state.go('login', redirectParams); |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
@ -159,31 +164,6 @@ export default function AppRun($rootScope, $window, $injector, $location, $log, |
|
|
|
userService.gotoDefaultPlace(params); |
|
|
|
} |
|
|
|
|
|
|
|
function showUnauthorizedDialog() { |
|
|
|
if (unauthorizedDialog === null) { |
|
|
|
$translate(['access.unauthorized-access', |
|
|
|
'access.unauthorized-access-text', |
|
|
|
'access.unauthorized', |
|
|
|
'action.cancel', |
|
|
|
'action.sign-in']).then(function (translations) { |
|
|
|
if (unauthorizedDialog === null) { |
|
|
|
unauthorizedDialog = $mdDialog.confirm() |
|
|
|
.title(translations['access.unauthorized-access']) |
|
|
|
.textContent(translations['access.unauthorized-access-text']) |
|
|
|
.ariaLabel(translations['access.unauthorized']) |
|
|
|
.cancel(translations['action.cancel']) |
|
|
|
.ok(translations['action.sign-in']); |
|
|
|
$mdDialog.show(unauthorizedDialog).then(function () { |
|
|
|
unauthorizedDialog = null; |
|
|
|
$state.go('login'); |
|
|
|
}, function () { |
|
|
|
unauthorizedDialog = null; |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
function showForbiddenDialog() { |
|
|
|
if (forbiddenDialog === null) { |
|
|
|
$translate(['access.access-forbidden', |
|
|
|
|