[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/security/browser/ Fix issue 239. Logout feature for Basic HTTP auth.

Florent Xicluna laxyf at yahoo.fr
Tue Sep 5 09:30:05 EDT 2006


Log message for revision 69976:
  Fix issue 239. Logout feature for Basic HTTP auth.

Changed:
  U   Zope3/trunk/src/zope/app/security/browser/logout.pt
  U   Zope3/trunk/src/zope/app/security/browser/redirect.pt

-=-
Modified: Zope3/trunk/src/zope/app/security/browser/logout.pt
===================================================================
--- Zope3/trunk/src/zope/app/security/browser/logout.pt	2006-09-05 13:27:07 UTC (rev 69975)
+++ Zope3/trunk/src/zope/app/security/browser/logout.pt	2006-09-05 13:30:04 UTC (rev 69976)
@@ -1,5 +1,25 @@
 <html metal:use-macro="context/@@standard_macros/page"
     i18n:domain="zope">
+  <head>
+    <metal:block fill-slot="headers">
+      <script type="text/javascript"><!--
+        // clear HTTP Authentication
+        try {
+          if (window.XMLHttpRequest) {
+            var xmlhttp = new XMLHttpRequest();
+            // Send invalid credentials, then abort
+            xmlhttp.open("GET", "/@@", true, "logout", "logout");
+            xmlhttp.send("");
+            xmlhttp.abort();
+          } else if (document.execCommand) {
+            // IE specific command
+            document.execCommand("ClearAuthenticationCache");
+          }
+        } catch(e) { }
+        //-->
+      </script>
+    </metal:block>
+  </head>
   <body>
   <div metal:fill-slot="body">
   

Modified: Zope3/trunk/src/zope/app/security/browser/redirect.pt
===================================================================
--- Zope3/trunk/src/zope/app/security/browser/redirect.pt	2006-09-05 13:27:07 UTC (rev 69975)
+++ Zope3/trunk/src/zope/app/security/browser/redirect.pt	2006-09-05 13:30:04 UTC (rev 69976)
@@ -4,6 +4,22 @@
     <metal:block fill-slot="headers">
       <meta http-equiv="refresh" content="0;url=./"
         tal:attributes="content string:0;;url=${view/request/nextURL}" />
+      <script type="text/javascript"><!--
+        // clear HTTP Authentication
+        try {
+          if (window.XMLHttpRequest) {
+            var xmlhttp = new XMLHttpRequest();
+            // Send invalid credentials, then abort
+            xmlhttp.open("GET", "/@@", true, "logout", "logout");
+            xmlhttp.send("");
+            xmlhttp.abort();
+          } else if (document.execCommand) {
+            // IE specific command
+            document.execCommand("ClearAuthenticationCache");
+          }
+        } catch(e) { }
+        //-->
+      </script>
     </metal:block>
   </head>
   <body>



More information about the Zope3-Checkins mailing list