mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 05:07:41 +00:00
GUACAMOLE-680: Display status message upon logout (rather than immediately reauthenticating).
The former behavior (immediately reauthenticating) typically results in the login screen appearing, but will also instantly sign the user back in if a single sign-on solution is being used. This results in the logout action appearing to have no effect when SSO is involved.
This commit is contained in:
@@ -167,10 +167,7 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
|
||||
className : "logout button",
|
||||
callback : function logoutCallback() {
|
||||
authenticationService.logout()
|
||||
['catch'](requestService.IGNORE)
|
||||
['finally'](function logoutComplete() {
|
||||
$location.url('/');
|
||||
});
|
||||
['catch'](requestService.IGNORE);
|
||||
}
|
||||
};
|
||||
|
||||
|
@@ -25,6 +25,7 @@ angular.module('index').controller('indexController', ['$scope', '$injector',
|
||||
|
||||
// Required services
|
||||
var $document = $injector.get('$document');
|
||||
var $route = $injector.get('$route');
|
||||
var $window = $injector.get('$window');
|
||||
var clipboardService = $injector.get('clipboardService');
|
||||
var guacNotification = $injector.get('guacNotification');
|
||||
@@ -50,6 +51,13 @@ angular.module('index').controller('indexController', ['$scope', '$injector',
|
||||
*/
|
||||
$scope.loginHelpText = null;
|
||||
|
||||
/**
|
||||
* Whether the user has selected to log back in after having logged out.
|
||||
*
|
||||
* @type boolean
|
||||
*/
|
||||
$scope.reAuthenticating = false;
|
||||
|
||||
/**
|
||||
* The credentials that the authentication service is has already accepted,
|
||||
* pending additional credentials, if any. If the user is logged in, or no
|
||||
@@ -94,6 +102,11 @@ angular.module('index').controller('indexController', ['$scope', '$injector',
|
||||
*/
|
||||
LOADING : 'loading',
|
||||
|
||||
/**
|
||||
* The user has manually logged out.
|
||||
*/
|
||||
LOGGED_OUT : 'loggedOut',
|
||||
|
||||
/**
|
||||
* The application has fully loaded and the user has logged in
|
||||
*/
|
||||
@@ -256,6 +269,13 @@ angular.module('index').controller('indexController', ['$scope', '$injector',
|
||||
|
||||
});
|
||||
|
||||
// Replace the overall user interface with an informational message if the
|
||||
// user has manually logged out
|
||||
$scope.$on('guacLogout', function loggedOut() {
|
||||
$scope.applicationState = ApplicationState.LOGGED_OUT;
|
||||
$scope.reAuthenticating = false;
|
||||
});
|
||||
|
||||
// Ensure new pages always start with clear keyboard state
|
||||
$scope.$on('$routeChangeStart', function routeChanging() {
|
||||
keyboard.reset();
|
||||
|
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
.logged-out-modal guac-modal {
|
||||
background: white;
|
||||
z-index: 20;
|
||||
}
|
@@ -140,13 +140,7 @@ angular.module('navigation').directive('guacUserMenu', [function guacUserMenu()
|
||||
*/
|
||||
$scope.logout = function logout() {
|
||||
authenticationService.logout()
|
||||
['catch'](requestService.IGNORE)
|
||||
['finally'](function logoutComplete() {
|
||||
if ($location.path() !== '/')
|
||||
$location.url('/');
|
||||
else
|
||||
$route.reload();
|
||||
});
|
||||
['catch'](requestService.IGNORE);
|
||||
};
|
||||
|
||||
/**
|
||||
|
@@ -40,6 +40,17 @@
|
||||
</head>
|
||||
<body ng-cloak translate-cloak ng-class="page.bodyClassName" ng-switch="applicationState">
|
||||
|
||||
<!-- Manually logged-out -->
|
||||
<div class="logged-out-modal" ng-switch-when="loggedOut">
|
||||
<guac-modal>
|
||||
<p translate="APP.INFO_LOGGED_OUT"></p>
|
||||
<p>
|
||||
<button translate="APP.ACTION_LOGIN_AGAIN" ng-disabled="reAuthenticating"
|
||||
ng-click="reAuthenticate()"></button>
|
||||
</p>
|
||||
</guac-modal>
|
||||
</div>
|
||||
|
||||
<!-- Absolute fatal error -->
|
||||
<div class="fatal-page-error-modal" ng-switch-when="fatalError">
|
||||
<guac-modal>
|
||||
|
@@ -15,6 +15,7 @@
|
||||
"ACTION_DELETE_SESSIONS" : "Kill Sessions",
|
||||
"ACTION_DOWNLOAD" : "Download",
|
||||
"ACTION_LOGIN" : "Login",
|
||||
"ACTION_LOGIN_AGAIN" : "Re-login",
|
||||
"ACTION_LOGOUT" : "Logout",
|
||||
"ACTION_MANAGE_CONNECTIONS" : "Connections",
|
||||
"ACTION_MANAGE_PREFERENCES" : "Preferences",
|
||||
@@ -44,6 +45,7 @@
|
||||
"FORMAT_DATE_TIME_PRECISE" : "yyyy-MM-dd HH:mm:ss",
|
||||
|
||||
"INFO_ACTIVE_USER_COUNT" : "Currently in use by {USERS} {USERS, plural, one{user} other{users}}.",
|
||||
"INFO_LOGGED_OUT" : "You have been logged out.",
|
||||
|
||||
"TEXT_ANONYMOUS_USER" : "Anonymous",
|
||||
"TEXT_HISTORY_DURATION" : "{VALUE} {UNIT, select, second{{VALUE, plural, one{second} other{seconds}}} minute{{VALUE, plural, one{minute} other{minutes}}} hour{{VALUE, plural, one{hour} other{hours}}} day{{VALUE, plural, one{day} other{days}}} other{}}",
|
||||
|
Reference in New Issue
Block a user