Андрей (andy) wrote in changelog,
Андрей
andy
changelog

[ljcom] r9407: LJSUP-6577 (Can't login with FB in IE8)

Committer: ailyin
LJSUP-6577 (Can't login with FB in IE8)
U   trunk/cgi-bin/LJ/Identity/Facebook.pm
U   trunk/cgi-bin/LJ/Talk/Author/Facebook.pm
U   trunk/htdocs/identity/callback-facebook.bml
Modified: trunk/cgi-bin/LJ/Identity/Facebook.pm
===================================================================
--- trunk/cgi-bin/LJ/Identity/Facebook.pm	2010-08-26 07:43:47 UTC (rev 9406)
+++ trunk/cgi-bin/LJ/Identity/Facebook.pm	2010-08-26 08:01:01 UTC (rev 9407)
@@ -28,12 +28,10 @@
 sub attempt_login {
     my ($class, $errs, %opts) = @_;
 
-    my $returl = $opts{'returl'} || $LJ::SITEROOT;
-    my $returl_fail = $opts{'returl_fail'} || $returl || $LJ::SITEROOT;
+    my $forwhat = $opts{'forwhat'} || 'login';
 
     my $callback_url = "$LJ::SITEROOT/identity/callback-facebook.bml?" .
-                       'ret=' . LJ::Text->eurl($returl) . '&' .
-                       'ret_fail=' . LJ::Text->eurl($returl_fail);
+                       'forwhat=' . $forwhat;
 
     my $addr = 'https://graph.facebook.com/oauth/authorize?' .
                "client_id=$LJ::FACEBOOK_CONNECT_CLIENT_ID&" .

Modified: trunk/cgi-bin/LJ/Talk/Author/Facebook.pm
===================================================================
--- trunk/cgi-bin/LJ/Talk/Author/Facebook.pm	2010-08-26 07:43:47 UTC (rev 9406)
+++ trunk/cgi-bin/LJ/Talk/Author/Facebook.pm	2010-08-26 08:01:01 UTC (rev 9407)
@@ -84,13 +84,10 @@
         return;
     }
 
-    my $returl = "$LJ::SITEROOT/talkpost_do.bml?" .
-                 'jid=' . $journalu->id . '&' .
-                 "pendcid=$pendcid";
+    my $journalid = $journalu->id;
 
     LJ::Identity::Facebook->attempt_login($errret,
-        'returl'      => $returl,
-        'returl_fail' => $returl . '&failed=1',
+        'forwhat' => "comment-$journalid-$pendcid",
     );
 }
 

Modified: trunk/htdocs/identity/callback-facebook.bml
===================================================================
--- trunk/htdocs/identity/callback-facebook.bml	2010-08-26 07:43:47 UTC (rev 9406)
+++ trunk/htdocs/identity/callback-facebook.bml	2010-08-26 08:01:01 UTC (rev 9407)
@@ -9,10 +9,24 @@
     # user will unlikely ever need to see this
     $title = 'Facebook Landing Page';
 
-    my $returl = LJ::Request->get_param('ret') || $LJ::SITEROOT;
-    my $returl_fail = LJ::Request->get_param('ret_fail') ||
-                      $returl ||$LJ::SITEROOT;
+    my $forwhat = LJ::Request->get_param('forwhat') || 'login';
 
+    my ($returl, $returl_fail);
+    if ($forwhat eq 'login') {
+        $returl = $LJ::SITEROOT;
+        $returl_fail = "$LJ::SITEROOT/identity/login.bml?type=facebook"
+    } elsif ($forwhat =~ /^comment-(\d+)-(\d+)$/) {
+        my ($journalid, $pendcid) = ($1, $2);
+
+        $returl = "$LJ::SITEROOT/talkpost_do.bml?" .
+                  "jid=$journalid&" .
+                  "pendcid=$pendcid";
+        $returl_fail = $returl . '&failed=1';
+    } else {
+        warn "invalid forwhat passed: $forwhat";
+        return LJ::Lang::ml('error.invalidform');
+    }
+
     unless (LJ::Identity::Facebook->enabled) {
         return 'This feature is disabled.';
     }
@@ -31,8 +45,7 @@
     }
 
     my $selfurl = "$LJ::SITEROOT/identity/callback-facebook.bml?" .
-                  'ret=' . LJ::Text->eurl($returl) . '&' .
-                  'ret_fail=' . LJ::Text->eurl($returl_fail);
+                  'forwhat=' . $forwhat;
 
     my $addr = 'https://graph.facebook.com/oauth/access_token?' .
                "client_id=$LJ::FACEBOOK_CONNECT_CLIENT_ID&" .

Tags: andy, bml, ljcom, pm
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments