summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2014-05-07 19:24:32 -0400
committerEndi S. Dewata <edewata@redhat.com>2014-05-12 19:07:07 -0400
commit504a01433b5a6a67f843d6ea1f85865212c53141 (patch)
tree665b56d9e9f7aad328e73e5e97b3c6ebae7969bb /base
parent6dcdd25b49f64b2a23f1dfd78ff6f6333fd2daea (diff)
downloadpki-504a01433b5a6a67f843d6ea1f85865212c53141.tar.gz
pki-504a01433b5a6a67f843d6ea1f85865212c53141.tar.xz
pki-504a01433b5a6a67f843d6ea1f85865212c53141.zip
Added logout support for IE.
The TPS UI logout functionality has been modified to clear the authentication credential cache on IE. Ticket #903
Diffstat (limited to 'base')
-rw-r--r--base/server/share/webapps/pki/js/pki-ui.js16
-rw-r--r--base/tps-tomcat/shared/webapps/tps/index.html2
-rw-r--r--base/tps-tomcat/shared/webapps/tps/ui/index.html14
3 files changed, 28 insertions, 4 deletions
diff --git a/base/server/share/webapps/pki/js/pki-ui.js b/base/server/share/webapps/pki/js/pki-ui.js
index 9a1d2e593..d4e270601 100644
--- a/base/server/share/webapps/pki/js/pki-ui.js
+++ b/base/server/share/webapps/pki/js/pki-ui.js
@@ -46,6 +46,22 @@ var PKI = {
}
return newContent;
+ },
+ logout: function(options) {
+ options = options || {};
+ if (window.crypto && typeof window.crypto.logout === "function") { // Firefox
+ window.crypto.logout();
+ if (options.success) options.success.call();
+
+ } else {
+ var result = document.execCommand("ClearAuthenticationCache", false);
+ if (result) { // IE
+ if (options.success) options.success.call();
+
+ } else { // logout not supported
+ if (options.error) options.error.call();
+ }
+ }
}
};
diff --git a/base/tps-tomcat/shared/webapps/tps/index.html b/base/tps-tomcat/shared/webapps/tps/index.html
index c511f147b..c48da3307 100644
--- a/base/tps-tomcat/shared/webapps/tps/index.html
+++ b/base/tps-tomcat/shared/webapps/tps/index.html
@@ -31,7 +31,7 @@ $(function() {
window.location.href = "/tps/ui";
},
error: function() {
- if (window.crypto) window.crypto.logout();
+ PKI.logout();
}
});
e.preventDefault();
diff --git a/base/tps-tomcat/shared/webapps/tps/ui/index.html b/base/tps-tomcat/shared/webapps/tps/ui/index.html
index edf3f3092..d1fa78b67 100644
--- a/base/tps-tomcat/shared/webapps/tps/ui/index.html
+++ b/base/tps-tomcat/shared/webapps/tps/ui/index.html
@@ -317,13 +317,21 @@ $(function() {
});
router.route("logout", "logout", function() {
+ // destroy server session
account.logout({
success: function() {
- if (window.crypto) window.crypto.logout();
- window.location.href = "/tps";
+ // clear browser cache
+ PKI.logout({
+ success: function() {
+ window.location.href = "/tps";
+ },
+ error: function() {
+ alert("Logout failed. Please close the browser.");
+ }
+ });
},
error: function() {
- alert("Logout failed");
+ alert("Logout failed. Please close the browser.");
}
});
});