журнал (shhh) wrote in changelog,
журнал
shhh
changelog

[livejournal] r22566: LJSUP-12918: There is no redirect when l...

Committer: nnikulochkina
LJSUP-12918: There is no redirect when logging OpenID use livejournal user form
U   trunk/cgi-bin/LJ/Identity/OpenID.pm
U   trunk/htdocs/identity/callback-openid.bml
Modified: trunk/cgi-bin/LJ/Identity/OpenID.pm
===================================================================
--- trunk/cgi-bin/LJ/Identity/OpenID.pm	2012-08-03 13:47:36 UTC (rev 22565)
+++ trunk/cgi-bin/LJ/Identity/OpenID.pm	2012-08-03 13:53:21 UTC (rev 22566)
@@ -80,6 +80,7 @@
     $errs ||= [];
     my $returl = $opts{'returl'} || $LJ::SITEROOT;
     my $returl_fail = $opts{'returl_fail'} || $returl || $LJ::SITEROOT;
+    my $forwhat = $opts{'forwhat'} || '';
 
     my $csr = $class->consumer;
     my $url = LJ::Request->post_param('openid:url');
@@ -110,7 +111,8 @@
     my $check_url = $claimed_id->check_url(
         return_to => "$LJ::SITEROOT/identity/callback-openid.bml?" .
                      'ret=' . LJ::Text->eurl($returl) . '&' .
-                     'ret_fail=' . LJ::Text->eurl($returl_fail),
+                     'ret_fail=' . LJ::Text->eurl($returl_fail) . '&' .
+                     'forwhat=' . LJ::Text->eurl($forwhat),
         trust_root => "$LJ::SITEROOT/",
         delayed_return => 1,
     );

Modified: trunk/htdocs/identity/callback-openid.bml
===================================================================
--- trunk/htdocs/identity/callback-openid.bml	2012-08-03 13:47:36 UTC (rev 22565)
+++ trunk/htdocs/identity/callback-openid.bml	2012-08-03 13:53:21 UTC (rev 22566)
@@ -69,6 +69,17 @@
     LJ::set_remote($u);
 
     my $returl = LJ::Request->get_param('ret') || $LJ::SITEROOT;
+    
+    my $forwhat = LJ::Request->get_param('forwhat');
+
+    if($forwhat && $forwhat ne 'login') {
+        my $url;
+        eval {
+            ($url) = LJ::Identity::OpenID->unpack_forwhat($forwhat);
+        };
+        $returl = $url if $url;
+    }
+
     return LJ::Request->redirect($returl);
 
 }

Tags: bml, livejournal, nikulochkina, nnikulochkina, 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