Committer: wisest-owl
LJSUP-11868. Redirect user to a new photohosting if migration started.U trunk/lib/Apache/FotoBilder.pm
Modified: trunk/lib/Apache/FotoBilder.pm =================================================================== --- trunk/lib/Apache/FotoBilder.pm 2011-12-29 06:51:17 UTC (rev 1459) +++ trunk/lib/Apache/FotoBilder.pm 2012-04-19 09:03:52 UTC (rev 1460) @@ -37,6 +37,9 @@ our %RQ; +## +use LJ::Pics::Migration; + # init handler (PostReadRequest) sub handler { @@ -233,6 +236,13 @@ # maps uri to dir 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";