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

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



Revision: 6517
          http://sourceforge.net/p/ledger-smb/code/6517
Author:   einhverfr
Date:     2014-01-18 06:57:39 +0000 (Sat, 18 Jan 2014)
Log Message:
-----------
Fix for logout on Chrome.

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

Modified: trunk/LedgerSMB/Scripts/login.pm
===================================================================
--- trunk/LedgerSMB/Scripts/login.pm	2014-01-18 01:56:30 UTC (rev 6516)
+++ trunk/LedgerSMB/Scripts/login.pm	2014-01-18 06:57:39 UTC (rev 6517)
@@ -143,6 +143,23 @@
     $template->render($request);
 }
 
+=head2 logout_js
+
+This is a stup for a js logout feature.  It allows javascript to log out by 
+requiring only bogus credentials (logout:logout).
+
+=cut
+
+sub logout_js {
+    my $request = shift @_;
+    my $creds = LedgerSMB::Auth::get_credentials();
+    LedgerSMB::Auth::credential_prompt 
+        unless ($creds->{password} eq 'logout') 
+               and ($creds->{login} eq 'logout');
+    logout($request);
+}
+    
+
 eval { do "scripts/custom/login.pl"};
 
 =back

Modified: trunk/LedgerSMB.pm
===================================================================
--- trunk/LedgerSMB.pm	2014-01-18 01:56:30 UTC (rev 6516)
+++ trunk/LedgerSMB.pm	2014-01-18 06:57:39 UTC (rev 6517)
@@ -330,7 +330,7 @@
     #HV  why not trying _db_init also in case of login authenticate? quid logout-function?
     if ($self->{script} eq 'login.pl' &&
         ($self->{action} eq 'authenticate'  || $self->{action} eq '__default' 
-		|| !$self->{action})){
+		|| !$self->{action} || ($self->{action} eq 'logout_js'))){
         return $self;
     }
     if ($self->{script} eq 'setup.pl'){

Modified: trunk/UI/logout.html
===================================================================
--- trunk/UI/logout.html	2014-01-18 01:56:30 UTC (rev 6516)
+++ trunk/UI/logout.html	2014-01-18 06:57:39 UTC (rev 6517)
@@ -17,7 +17,7 @@
 }
 if (agt.indexOf("msie") == -1) {
 	var xhre = new XMLHttpRequest() ;
-        xhre.open("GET",window.location,true,"logout","logout");
+        xhre.open("GET",'login.pl?action=logout_js',true,"logout","logout");
         xhre.send("");
         xhre.abort();
         //be aware, sometimes get-request reaches server despite abort.

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


------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
Ledger-smb-commits mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-commits