diff --git a/forms/common-themes/src/main/resources/theme/base/admin/resources/js/app.js b/forms/common-themes/src/main/resources/theme/base/admin/resources/js/app.js
index f45453c744..1fe34408b1 100755
--- a/forms/common-themes/src/main/resources/theme/base/admin/resources/js/app.js
+++ b/forms/common-themes/src/main/resources/theme/base/admin/resources/js/app.js
@@ -908,8 +908,6 @@ module.config([ '$routeProvider', function($routeProvider) {
},
controller : 'ProtocolListCtrl'
})
-
-
.when('/server-info', {
templateUrl : resourceUrl + '/partials/server-info.html'
})
@@ -917,8 +915,14 @@ module.config([ '$routeProvider', function($routeProvider) {
templateUrl : resourceUrl + '/partials/home.html',
controller : 'LogoutCtrl'
})
- .otherwise({
+ .when('/notfound', {
templateUrl : resourceUrl + '/partials/notfound.html'
+ })
+ .when('/forbidden', {
+ templateUrl : resourceUrl + '/partials/forbidden.html'
+ })
+ .otherwise({
+ templateUrl : resourceUrl + '/partials/pagenotfound.html'
});
} ]);
@@ -942,29 +946,6 @@ module.config(function($httpProvider) {
});
-module.factory('errorInterceptor', function($q, $window, $rootScope, $location, Notifications, Auth) {
- return function(promise) {
- return promise.then(function(response) {
- return response;
- }, function(response) {
- if (response.status == 401) {
- Auth.authz.logout();
- } else if (response.status == 403) {
- Notifications.error("Forbidden");
- } else if (response.status == 404) {
- Notifications.error("Not found");
- } else if (response.status) {
- if (response.data && response.data.errorMessage) {
- Notifications.error(response.data.errorMessage);
- } else {
- Notifications.error("An unexpected server error has occurred");
- }
- }
- return $q.reject(response);
- });
- };
-});
-
module.factory('spinnerInterceptor', function($q, $window, $rootScope, $location) {
return function(promise) {
return promise.then(function(response) {
@@ -992,6 +973,29 @@ module.factory('spinnerInterceptor', function($q, $window, $rootScope, $location
};
});
+module.factory('errorInterceptor', function($q, $window, $rootScope, $location, Notifications, Auth) {
+ return function(promise) {
+ return promise.then(function(response) {
+ return response;
+ }, function(response) {
+ if (response.status == 401) {
+ Auth.authz.logout();
+ } else if (response.status == 403) {
+ $location.path('/forbidden');
+ } else if (response.status == 404) {
+ $location.path('/notfound');
+ } else if (response.status) {
+ if (response.data && response.data.errorMessage) {
+ Notifications.error(response.data.errorMessage);
+ } else {
+ Notifications.error("An unexpected server error has occurred");
+ }
+ }
+ return $q.reject(response);
+ });
+ };
+});
+
// collapsable form fieldsets
module.directive('collapsable', function() {
return function(scope, element, attrs) {
diff --git a/forms/common-themes/src/main/resources/theme/base/admin/resources/js/controllers/realm.js b/forms/common-themes/src/main/resources/theme/base/admin/resources/js/controllers/realm.js
index 97c1bdaa7a..387aa53b32 100755
--- a/forms/common-themes/src/main/resources/theme/base/admin/resources/js/controllers/realm.js
+++ b/forms/common-themes/src/main/resources/theme/base/admin/resources/js/controllers/realm.js
@@ -121,12 +121,8 @@ module.controller('RealmDropdownCtrl', function($scope, Realm, Current, Auth, $l
$scope.changeRealm = function(selectedRealm) {
$location.url("/realms/" + selectedRealm);
- };
-
- $scope.showNav = function() {
- var show = Current.realms.length > 0;
- return Auth.loggedIn && show;
}
+
$scope.refresh = function() {
Current.refresh();
}
diff --git a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/forbidden.html b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/forbidden.html
new file mode 100755
index 0000000000..6a0d5bfcb9
--- /dev/null
+++ b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/forbidden.html
@@ -0,0 +1,7 @@
+
\ No newline at end of file
diff --git a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/menu.html b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/menu.html
index 76ace6b93f..66f58c909e 100755
--- a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/menu.html
+++ b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/menu.html
@@ -26,8 +26,8 @@
+
+
+ Select realm...
+
+
+
+
Add Realm
@@ -45,6 +56,7 @@