Типа я (zilogic) wrote in changelog,
Типа я
zilogic
changelog

[livejournal] r19522: LJSUP-9334: New auth system for external...

Committer: amyshkin
LJSUP-9334: New auth system for external domains (livejournal.sg)
A   trunk/htdocs/misc/clear_domain_session.bml
A   trunk/htdocs/misc/get_auth_js.bml
Added: trunk/htdocs/misc/clear_domain_session.bml
===================================================================
--- trunk/htdocs/misc/clear_domain_session.bml	                        (rev 0)
+++ trunk/htdocs/misc/clear_domain_session.bml	2011-07-25 09:53:30 UTC (rev 19522)
@@ -0,0 +1,17 @@
+<?_code
+{
+    use strict;
+    use vars qw(%GET);
+    my $return = $GET{'return'};
+
+    if ( $return =~ m|^https?://(.+?)/|i ) {
+        my $domain = $1;
+warn "-> $domain";
+        LJ::Request->delete_cookie('ljdomsess.__external', domain => $domain );#, 'path' => '/', 'domain' => $domain);
+    }
+
+    return BML::redirect( $return );
+}
+_code?>
+
+

Added: trunk/htdocs/misc/get_auth_js.bml
===================================================================
--- trunk/htdocs/misc/get_auth_js.bml	                        (rev 0)
+++ trunk/htdocs/misc/get_auth_js.bml	2011-07-25 09:53:30 UTC (rev 19522)
@@ -0,0 +1,24 @@
+<?_code
+{
+    use strict;
+    our %GET;
+    my $remote = LJ::get_remote;
+
+    my $ret = '';
+
+    if( $remote ) {
+        $ret .= qq|
+        lj_master_user = $remote->{_session}->{userid};
+        |;
+    }
+    else {
+        $ret .= q|
+        lj_master_user = 0;
+        |;
+    }
+
+    return $ret;
+}
+_code?>
+
+

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