[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[5524] trunk



Revision: 5524
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=5524&view=rev
Author:   einhverfr
Date:     2013-01-09 10:02:29 +0000 (Wed, 09 Jan 2013)
Log Message:
-----------
Fixing handling for unknown browsers, inlining javascript for logout, to be merged for branches/1.3

Modified Paths:
--------------
    trunk/Changelog
    trunk/LedgerSMB/Scripts/login.pm
    trunk/UI/logout.html

Removed Paths:
-------------
    trunk/UI/logout/epiphany.js
    trunk/UI/logout/firefox.js
    trunk/UI/logout/iexplore.js
    trunk/UI/logout/konqueror.js
    trunk/UI/logout/opera.js
    trunk/UI/logout/safari.js

Modified: trunk/Changelog
===================================================================
--- trunk/Changelog	2013-01-09 09:51:05 UTC (rev 5523)
+++ trunk/Changelog	2013-01-09 10:02:29 UTC (rev 5524)
@@ -98,6 +98,7 @@
 * Fixed admin passwd reset ineffective (Chris T, bug 3599803)
 * Fixed stylesheet cannot be set on preferences screen (Chris T, 3599804)
 * Moved Fixes.sql to top of LOADORDER to fix some upgrade issues (Chris T)
+* Fixing handling of unknown browsers in logout (Chris T, 3599930)
 
 Changelog for 1.3.27
 * Detect whether ledgersmb.conf exists during Makefile.PL run and create if

Modified: trunk/LedgerSMB/Scripts/login.pm
===================================================================
--- trunk/LedgerSMB/Scripts/login.pm	2013-01-09 09:51:05 UTC (rev 5523)
+++ trunk/LedgerSMB/Scripts/login.pm	2013-01-09 10:02:29 UTC (rev 5524)
@@ -130,14 +130,6 @@
 
 sub logout {
     my ($request) = @_;    
-    @{$request->{scripts}} = 
-                  qw(UI/logout/iexplore.js 
-                     UI/logout/firefox.js
-                     UI/logout/opera.js
-                     UI/logout/safari.js
-                     UI/logout/konqueror.js
-                     UI/logout/epiphany.js
-                   );
     $request->{callback}   = "";
     $request->{endsession} = 1;
     if($request->{dbh}){LedgerSMB::Session::destroy($request);}#if logout on already logged out session

Deleted: trunk/UI/logout/epiphany.js
===================================================================
--- trunk/UI/logout/epiphany.js	2013-01-09 09:51:05 UTC (rev 5523)
+++ trunk/UI/logout/epiphany.js	2013-01-09 10:02:29 UTC (rev 5524)
@@ -1 +0,0 @@
-// Logout routines for Epiphany go here

Deleted: trunk/UI/logout/firefox.js
===================================================================
--- trunk/UI/logout/firefox.js	2013-01-09 09:51:05 UTC (rev 5523)
+++ trunk/UI/logout/firefox.js	2013-01-09 10:02:29 UTC (rev 5524)
@@ -1,13 +0,0 @@
-try{
-var agt=navigator.userAgent.toLowerCase();
-if (agt.indexOf("firefox") != -1) {
-	var xhre = new XMLHttpRequest() ;
-        xhre.open("GET",window.location,true,"logout","logout");
-        xhre.send("");
-        xhre.abort();
-        //be aware, sometimes get-request reaches server despite abort.
-        // LedgerSMB::Auth::DB::get_credentials can have $auth=logout:logout
-}
-}
-catch (e) {
-}

Deleted: trunk/UI/logout/iexplore.js
===================================================================
--- trunk/UI/logout/iexplore.js	2013-01-09 09:51:05 UTC (rev 5523)
+++ trunk/UI/logout/iexplore.js	2013-01-09 10:02:29 UTC (rev 5524)
@@ -1,9 +0,0 @@
-try{
-var agt=navigator.userAgent.toLowerCase();
-if (agt.indexOf("msie") != -1) {
-// IE clear HTTP Authentication
-    document.execCommand("ClearAuthenticationCache");
-}
-}
-catch (e) {
-}

Deleted: trunk/UI/logout/konqueror.js
===================================================================
--- trunk/UI/logout/konqueror.js	2013-01-09 09:51:05 UTC (rev 5523)
+++ trunk/UI/logout/konqueror.js	2013-01-09 10:02:29 UTC (rev 5524)
@@ -1 +0,0 @@
-// logout routines for Konqueror go here

Deleted: trunk/UI/logout/opera.js
===================================================================
--- trunk/UI/logout/opera.js	2013-01-09 09:51:05 UTC (rev 5523)
+++ trunk/UI/logout/opera.js	2013-01-09 10:02:29 UTC (rev 5524)
@@ -1 +0,0 @@
-// Logout routines for Opera go here

Deleted: trunk/UI/logout/safari.js
===================================================================
--- trunk/UI/logout/safari.js	2013-01-09 09:51:05 UTC (rev 5523)
+++ trunk/UI/logout/safari.js	2013-01-09 10:02:29 UTC (rev 5524)
@@ -1 +0,0 @@
-// logout routines for Safari go here

Modified: trunk/UI/logout.html
===================================================================
--- trunk/UI/logout.html	2013-01-09 09:51:05 UTC (rev 5523)
+++ trunk/UI/logout.html	2013-01-09 10:02:29 UTC (rev 5524)
@@ -1,5 +1,32 @@
-<?lsmb INCLUDE 'ui-header.html' include_script = scripts ?> 
+<?lsmb INCLUDE 'ui-header.html' ?> 
 <?lsmb PROCESS elements.html ?> 
+<!-- 
+  I am inlining the Javascript to clear credentials here.  Normally we try to
+  separate this out into different files, one file per language but in this 
+  case this makes localization of the Opera error message essentially impossible
+  so for this reason going to inline this functionality here. - Chris T -->
+<script>
+try{
+var agt=navigator.userAgent.toLowerCase();
+if (agt.indexOf("msie") != -1) {
+// IE clear HTTP Authentication
+    document.execCommand("ClearAuthenticationCache");
+}
+if (agt.indexOf("opera") != -1){ 
+   alert("<?lsmb text('Opera detected.  To complete this logout, please close your browser window or clear private/authentication information') ?>");
+}
+if (agt.indexOf("msie") == -1) {
+	var xhre = new XMLHttpRequest() ;
+        xhre.open("GET",window.location,true,"logout","logout");
+        xhre.send("");
+        xhre.abort();
+        //be aware, sometimes get-request reaches server despite abort.
+        // LedgerSMB::Auth::DB::get_credentials can have $auth=logout:logout
+}
+}
+catch (e) {
+}
+</script>
 <body>
 <h1 class="info">
    <?lsmb IF reason == 'timeout';

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.