You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ranger.apache.org by ni...@apache.org on 2021/09/29 13:05:01 UTC

[ranger] branch ranger-2.2 updated: RANGER-3455 : [Logout-Ranger] Should either be disabled/ should redirect to knox logout page

This is an automated email from the ASF dual-hosted git repository.

ni3galave pushed a commit to branch ranger-2.2
in repository https://gitbox.apache.org/repos/asf/ranger.git


The following commit(s) were added to refs/heads/ranger-2.2 by this push:
     new e192fd1  RANGER-3455 : [Logout-Ranger] Should either be disabled/ should redirect to knox logout page
e192fd1 is described below

commit e192fd1eeeb43ddf9bb3e027e52bac146ddfcb94
Author: Nitin Galave <ni...@apache.org>
AuthorDate: Tue Sep 28 19:08:46 2021 +0530

    RANGER-3455 : [Logout-Ranger] Should either be disabled/ should redirect to knox logout page
---
 security-admin/src/main/webapp/scripts/controllers/Controller.js  | 2 +-
 security-admin/src/main/webapp/scripts/controllers/NController.js | 2 +-
 security-admin/src/main/webapp/scripts/views/common/ProfileBar.js | 7 ++++++-
 3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/security-admin/src/main/webapp/scripts/controllers/Controller.js b/security-admin/src/main/webapp/scripts/controllers/Controller.js
index 5fc7e9f..aab73b6 100755
--- a/security-admin/src/main/webapp/scripts/controllers/Controller.js
+++ b/security-admin/src/main/webapp/scripts/controllers/Controller.js
@@ -33,7 +33,7 @@ define(function(require) {
         initialize: function(options) {
             console.log("initialize a Controller Controller");
             if (App.userProfile && App.userProfile.get('configProperties') && App.userProfile.get('configProperties').inactivityTimeout
-                && App.userProfile.get('configProperties').inactivityTimeout != -1) {
+                && App.userProfile.get('configProperties').inactivityTimeout > 0) {
                 XAUtil.setIdealActivityTime()
                 $('#contentBody').on("click mousemove keyup mousedown scroll keypress", function(e){
                     // do preload here
diff --git a/security-admin/src/main/webapp/scripts/controllers/NController.js b/security-admin/src/main/webapp/scripts/controllers/NController.js
index 612b0f2..2598035 100644
--- a/security-admin/src/main/webapp/scripts/controllers/NController.js
+++ b/security-admin/src/main/webapp/scripts/controllers/NController.js
@@ -32,7 +32,7 @@ define(function(require) {
         initialize: function(options) {
             console.log("initialize a Controller Controller");
             if (App.userProfile && App.userProfile.get('configProperties') && App.userProfile.get('configProperties').inactivityTimeout
-                && App.userProfile.get('configProperties').inactivityTimeout != -1) {
+                && App.userProfile.get('configProperties').inactivityTimeout > 0) {
                 XAUtil.setIdealActivityTime()
                 $('#contentBody').on("click mousemove keyup mousedown scroll keypress", function(e){
                     // do preload here
diff --git a/security-admin/src/main/webapp/scripts/views/common/ProfileBar.js b/security-admin/src/main/webapp/scripts/views/common/ProfileBar.js
index 8a85303..d4ca108 100644
--- a/security-admin/src/main/webapp/scripts/views/common/ProfileBar.js
+++ b/security-admin/src/main/webapp/scripts/views/common/ProfileBar.js
@@ -98,7 +98,12 @@ define(function(require){
 					if (localStorage.getItem('idleTimerLoggedOut') == "true" && resp == "true") {
 						window.location.replace('index.html?action=timeout');
 					} else {
-						that.onLogout(resp);
+						if (App.userProfile && App.userProfile.get('configProperties') && App.userProfile.get('configProperties').inactivityTimeout
+							&& App.userProfile.get('configProperties').inactivityTimeout > 0 && resp == "true") {
+								window.location.replace('index.html?action=timeout');
+						} else {
+							that.onLogout(resp);
+						}
 					}
 				},
 				error : function(jqXHR, textStatus, err ) {