diff -Nur -x '*.orig' -x '*.rej' trac-0.10.3.1/htdocs/js/trac.js mezzanine_patched_trac-0.10.3.1/htdocs/js/trac.js --- trac-0.10.3.1/htdocs/js/trac.js 2007-03-09 04:23:17.000000000 +1030 +++ mezzanine_patched_trac-0.10.3.1/htdocs/js/trac.js 2007-04-03 08:16:22.000000000 +0930 @@ -129,3 +129,46 @@ addLinks(container.getElementsByTagName('h' + lvl)); } } + + +function clearAuthenticationCache(page) { + // Default to a non-existing page (give error 500). + // An empty page is better, here. + if (!page) page = '.force_logout'; + try{ + var agt=navigator.userAgent.toLowerCase(); + if (agt.indexOf("msie") != -1) { + // IE clear HTTP Authentication + document.execCommand("ClearAuthenticationCache"); + } + else { + // Let's create an xmlhttp object + var xmlhttp = createXMLObject(); + // Let's prepare invalid credentials + xmlhttp.open("GET", page, true, "logout", "logout"); + // Let's send the request to the server + xmlhttp.send(""); + // Let's abort the request + xmlhttp.abort(); + } + } catch(e) { + // There was an error + return; + } +} + +function createXMLObject() { + try { + if (window.XMLHttpRequest) { + xmlhttp = new XMLHttpRequest(); + } + // code for IE + else if (window.ActiveXObject) { + xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); + } + } catch (e) { + xmlhttp=false + } + return xmlhttp; +} + diff -Nur -x '*.orig' -x '*.rej' trac-0.10.3.1/trac/web/auth.py mezzanine_patched_trac-0.10.3.1/trac/web/auth.py --- trac-0.10.3.1/trac/web/auth.py 2007-03-09 04:23:18.000000000 +1030 +++ mezzanine_patched_trac-0.10.3.1/trac/web/auth.py 2007-04-03 08:25:22.000000000 +0930 @@ -85,7 +85,8 @@ if req.authname and req.authname != 'anonymous': yield ('metanav', 'login', 'logged in as %s' % req.authname) yield ('metanav', 'logout', - html.A('Logout', href=req.href.logout())) + html.A('Logout', href=req.href.logout(), + onclick="clearAuthenticationCache(\'%s\')" % req.href.logout())) else: yield ('metanav', 'login', html.A('Login', href=req.href.login()))