[livejournal] r19620: LJSUP-9334: New auth system for external...
Committer: amyshkin
LJSUP-9334: New auth system for external domains (livejournal.sg)U trunk/cgi-bin/Apache/LiveJournal.pm U trunk/cgi-bin/LJ/User.pm
Modified: trunk/cgi-bin/Apache/LiveJournal.pm
===================================================================
--- trunk/cgi-bin/Apache/LiveJournal.pm 2011-08-08 02:32:38 UTC (rev 19619)
+++ trunk/cgi-bin/Apache/LiveJournal.pm 2011-08-08 02:40:44 UTC (rev 19620)
@@ -198,15 +198,18 @@
if(my $controller = LJ::Request->notes('controller')) {
my $url = $controller->check_access(LJ::Request->notes('branding_id'), LJ::get_remote_ip);
if(LJ::Request->notes('method') eq '__setdomsess') {
+warn "Demiurg: Apache handler: " . __LINE__;
return redir(LJ::Session->setdomsess_handler())
} else {
+warn "Demiurg: Apache handler: " . __LINE__;
my $session = LJ::Session->session_from_cookies(
tried_fast => 0,
redirect_ref => \$LJ::CACHE_REMOTE_BOUNCE_URL,
ignore_ip => 1
);
-
+warn "Demiurg: Apache handler: " . __LINE__;
if( !$session && $LJ::CACHE_REMOTE_BOUNCE_URL ) {
+warn "Demiurg: Apache handler: " . __LINE__;
return redir($LJ::CACHE_REMOTE_BOUNCE_URL);
}
}
Modified: trunk/cgi-bin/LJ/User.pm
===================================================================
--- trunk/cgi-bin/LJ/User.pm 2011-08-08 02:32:38 UTC (rev 19619)
+++ trunk/cgi-bin/LJ/User.pm 2011-08-08 02:40:44 UTC (rev 19620)
@@ -10005,16 +10005,18 @@
# </LJFUNC>
sub get_remote {
my $opts = ref $_[0] eq "HASH" ? shift : {};
+warn "Demiurg: get_remote: " . __LINE__;
return $LJ::CACHE_REMOTE if $LJ::CACHED_REMOTE && ! $opts->{'ignore_ip'};
-
+warn "Demiurg: get_remote: " . __LINE__;
my $no_remote = sub {
+warn "Demiurg: get_remote: " . __LINE__ . ": " . shift;
LJ::User->set_remote(undef);
return undef;
};
-
+warn "Demiurg: get_remote: " . __LINE__;
# can't have a remote user outside of web context
return $no_remote->() unless LJ::Request->is_inited;
-
+warn "Demiurg: get_remote: " . __LINE__;
my $criterr = $opts->{criterr} || do { my $d; \$d; };
$$criterr = 0;
@@ -10036,11 +10038,12 @@
# inform the caller that this user is faking their fast-server cookie
# attribute.
if ($tried_fast && ! LJ::get_cap($u, "fastserver")) {
+warn "Demiurg: get_remote: " . __LINE__;
$$criterr = 1;
}
return $no_remote->() unless $sessobj;
-
+warn "Demiurg: get_remote: " . __LINE__;
# renew soon-to-expire sessions
$sessobj->try_renew;
@@ -10051,6 +10054,7 @@
# - if necessary, this code will actually run in Apache's cleanup handler
# so latency won't affect the user
if (@LJ::MEMCACHE_SERVERS && ! $LJ::DISABLED{active_user_tracking}) {
+warn "Demiurg: get_remote: " . __LINE__;
push @LJ::CLEANUP_HANDLERS, sub { $u->note_activity('A') };
}
