ssafronova (ssafronova) wrote in changelog,
ssafronova
ssafronova
changelog

[livejournal] r17809: LJINT-362: Comments for side projects - ...

Committer: ssafronova
LJINT-362: Comments for side projects - LJINT-363: server part - OpenId parameters
U   trunk/cgi-bin/LJ/Widget/LoginMulti.pm
U   trunk/templates/Identity/Login.tmpl
Modified: trunk/cgi-bin/LJ/Widget/LoginMulti.pm
===================================================================
--- trunk/cgi-bin/LJ/Widget/LoginMulti.pm	2010-11-29 04:44:04 UTC (rev 17808)
+++ trunk/cgi-bin/LJ/Widget/LoginMulti.pm	2010-11-29 04:54:45 UTC (rev 17809)
@@ -69,6 +69,7 @@
     $template->param(
         'types' => \@types,
         'current_type' => $current_type,
+        'returnto' => $thispage,
     );
     
     ## well cooked widget is here
@@ -129,12 +130,21 @@
     } else {
         my $idclass = LJ::Identity->find_class($idtype);
         if ($idclass && $idclass->enabled) {
+            ## Where to go?
+            my $returnto = LJ::Request->post_param("returnto") || $thispage;
+            $returnto = "https://www.livejournal.com/login.bml"
+                unless $returnto =~ m!^https?://\Q$LJ::DOMAIN_WEB\E/!;
+
             $idclass->attempt_login($errors,
+                'returl' => $returnto,
                 'returl_fail' => "$thispage?type=$idtype",
                 'forwhat' => 'login',
             );
 
             return 1 if LJ::Request->redirected;
+
+            LJ::Request->redirect($returnto);
+
         } else {
             push @$errors, 'unknown identity type';
         }

Modified: trunk/templates/Identity/Login.tmpl
===================================================================
--- trunk/templates/Identity/Login.tmpl	2010-11-29 04:44:04 UTC (rev 17808)
+++ trunk/templates/Identity/Login.tmpl	2010-11-29 04:54:45 UTC (rev 17809)
@@ -18,6 +18,7 @@
             <form action="<tmpl_var action>" method="post">
                 <TMPL_INCLUDE expr="sprintf('templates/Identity/Login-%s.tmpl', type)">
                 <input type="hidden" name="type" value="<TMPL_VAR type>" />
+                <input type="hidden" name="returnto" value="<TMPL_VAR returnto>" />
             </form>
         </li>
     </TMPL_LOOP>

Tags: livejournal, pm, ssafronova, tmpl
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