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

SF.net SVN: ledger-smb:[6518] branches/1.3



Revision: 6518
          http://sourceforge.net/p/ledger-smb/code/6518
Author:   einhverfr
Date:     2014-01-18 07:01:19 +0000 (Sat, 18 Jan 2014)
Log Message:
-----------
Fixing logout for Chrome

Modified Paths:
--------------
    branches/1.3/LedgerSMB.pm
    branches/1.3/UI/logout.html
    branches/1.3/scripts/login.pl

Modified: branches/1.3/LedgerSMB.pm
===================================================================
--- branches/1.3/LedgerSMB.pm	2014-01-18 06:57:39 UTC (rev 6517)
+++ branches/1.3/LedgerSMB.pm	2014-01-18 07:01:19 UTC (rev 6518)
@@ -332,7 +332,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: branches/1.3/UI/logout.html
===================================================================
--- branches/1.3/UI/logout.html	2014-01-18 06:57:39 UTC (rev 6517)
+++ branches/1.3/UI/logout.html	2014-01-18 07:01:19 UTC (rev 6518)
@@ -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.

Modified: branches/1.3/scripts/login.pl
===================================================================
--- branches/1.3/scripts/login.pl	2014-01-18 06:57:39 UTC (rev 6517)
+++ branches/1.3/scripts/login.pl	2014-01-18 07:01:19 UTC (rev 6518)
@@ -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

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