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

[fotobilder] r1461: LJSUP-11894 (set up redirects from fotob...

Committer: ailyin
LJSUP-11894 (set up redirects from fotobilder to the new photo hosting)
U   trunk/lib/Apache/FotoBilder.pm
Modified: trunk/lib/Apache/FotoBilder.pm
===================================================================
--- trunk/lib/Apache/FotoBilder.pm	2012-04-19 09:03:52 UTC (rev 1460)
+++ trunk/lib/Apache/FotoBilder.pm	2012-04-19 12:56:40 UTC (rev 1461)
@@ -38,7 +38,7 @@
 our %RQ;
 
 ##
-use LJ::Pics::Migration;
+use LJ::Pics::Controller::FotobilderRedirect;
 
 # init handler (PostReadRequest)
 sub handler
@@ -139,6 +139,17 @@
     my $siteroot = FB::siteroot();
 
     FB::start_request();
+
+    my $lookup_result =
+        LJ::Pics::Controller::FotobilderRedirect->lookup_redirect;
+    my ( $status, $details ) = @$lookup_result;
+
+    if ( $status eq 'redir' ) {
+        return redir($details);
+    } elsif ( $status eq 'error' ) {
+        return $details;
+    }
+
     S2::set_domain('Fotobilder');
 
     ## We may serve some images from CDN.
@@ -237,12 +248,6 @@
         return LJ::Request::NOT_FOUND if $uri =~ /\.\./; # forbids ANY .. in uri
         if ($uri and -d "$ENV{FBHOME}/htdocs/" . $uri){
 
-            my $u = FB::get_remote ();
-            my $lj_u = LJ::load_user ($u->user);
-            if (LJ::Pics::Migration->user_enabled_new_photohosting ($lj_u)) {
-                return redir("http://".$u->user.".".$LJ::DOMAIN."/pics/catalog");
-            }
-
             $uri .= "/" unless $uri =~ /\/$/; # make sure it ends with /
             my $new_uri  = $uri . "index.bml";
             my $bml_file = "$ENV{FBHOME}/htdocs/" . $uri . "index.bml";

Tags: ailyin, andy, fotobilder, 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