/[smecontribs]/rpms/trac/contribs7/trac-0.10.4-TrueHttpBasicAuthenticationLogout.patch
ViewVC logotype

Contents of /rpms/trac/contribs7/trac-0.10.4-TrueHttpBasicAuthenticationLogout.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.3 - (show annotations) (download)
Tue Nov 25 16:20:36 2008 UTC (16 years ago) by slords
Branch: MAIN
CVS Tags: trac-0_10_5-1_el4_sme, HEAD
Changes since 1.2: +0 -0 lines
Restore

1 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
2 --- trac-0.10.3.1/htdocs/js/trac.js 2007-03-09 04:23:17.000000000 +1030
3 +++ mezzanine_patched_trac-0.10.3.1/htdocs/js/trac.js 2007-04-03 08:16:22.000000000 +0930
4 @@ -129,3 +129,46 @@
5 addLinks(container.getElementsByTagName('h' + lvl));
6 }
7 }
8 +
9 +
10 +function clearAuthenticationCache(page) {
11 + // Default to a non-existing page (give error 500).
12 + // An empty page is better, here.
13 + if (!page) page = '.force_logout';
14 + try{
15 + var agt=navigator.userAgent.toLowerCase();
16 + if (agt.indexOf("msie") != -1) {
17 + // IE clear HTTP Authentication
18 + document.execCommand("ClearAuthenticationCache");
19 + }
20 + else {
21 + // Let's create an xmlhttp object
22 + var xmlhttp = createXMLObject();
23 + // Let's prepare invalid credentials
24 + xmlhttp.open("GET", page, true, "logout", "logout");
25 + // Let's send the request to the server
26 + xmlhttp.send("");
27 + // Let's abort the request
28 + xmlhttp.abort();
29 + }
30 + } catch(e) {
31 + // There was an error
32 + return;
33 + }
34 +}
35 +
36 +function createXMLObject() {
37 + try {
38 + if (window.XMLHttpRequest) {
39 + xmlhttp = new XMLHttpRequest();
40 + }
41 + // code for IE
42 + else if (window.ActiveXObject) {
43 + xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
44 + }
45 + } catch (e) {
46 + xmlhttp=false
47 + }
48 + return xmlhttp;
49 +}
50 +
51 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
52 --- trac-0.10.3.1/trac/web/auth.py 2007-03-09 04:23:18.000000000 +1030
53 +++ mezzanine_patched_trac-0.10.3.1/trac/web/auth.py 2007-04-03 08:25:22.000000000 +0930
54 @@ -85,7 +85,8 @@
55 if req.authname and req.authname != 'anonymous':
56 yield ('metanav', 'login', 'logged in as %s' % req.authname)
57 yield ('metanav', 'logout',
58 - html.A('Logout', href=req.href.logout()))
59 + html.A('Logout', href=req.href.logout(),
60 + onclick="clearAuthenticationCache(\'%s\')" % req.href.logout()))
61 else:
62 yield ('metanav', 'login',
63 html.A('Login', href=req.href.login()))

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed