mark: A photo of Mark kneeling on top of the Taal Volcano in the Philippines. It was a long hike. (Default)
Mark Smith ([staff profile] mark) wrote in [site community profile] changelog2009-07-26 06:27 pm

[dw-free] remove all references to scrapbook/fotobilder

[commit: http://hg.dwscoalition.org/dw-free/rev/81b487a3f369]

http://bugs.dwscoalition.org/show_bug.cgi?id=1463

Remove the bulk of the FotoBilder code.

Patch by [personal profile] kareila.

Files modified:
  • bin/cvsreport.pl
  • bin/upgrading/proplists.dat
  • bin/worker/update-fb-friends
  • cgi-bin/Apache/LiveJournal.pm
  • cgi-bin/Apache/LiveJournal/Interface/AtomAPI.pm
  • cgi-bin/Apache/LiveJournal/Interface/FotoBilder.pm
  • cgi-bin/LJ/ConfCheck/General.pm
  • cgi-bin/LJ/Console/Command/Unsuspend.pm
  • cgi-bin/LJ/M/ProfilePage.pm
  • cgi-bin/LJ/Session.pm
  • cgi-bin/LJ/Splash.pm
  • cgi-bin/LJ/User.pm
  • cgi-bin/fbupload.pl
  • cgi-bin/ljlib.pl
  • htdocs/editpics.bml
  • htdocs/editpics.bml.text
  • htdocs/login.bml
  • htdocs/manage/emailpost.bml
  • htdocs/userinfo.bml.text
--------------------------------------------------------------------------------
diff -r d1cdcb5897f7 -r 81b487a3f369 bin/cvsreport.pl
--- a/bin/cvsreport.pl	Sun Jul 26 17:47:31 2009 +0000
+++ b/bin/cvsreport.pl	Sun Jul 26 18:27:27 2009 +0000
@@ -7,10 +7,6 @@ use strict;
 
 die "\$LJHOME not set.\n"
     unless -d $ENV{'LJHOME'};
-
-if (defined $ENV{'FBHOME'} && $ENV{'PWD'} =~ /^$ENV{'FBHOME'}/i) {
-    die "You are running this LJ script while working in FBHOME" unless $ENV{FBHOME} eq $ENV{LJHOME};
-}
 
 # be paranoid in production, force --these
 my @paranoia;
diff -r d1cdcb5897f7 -r 81b487a3f369 bin/upgrading/proplists.dat
--- a/bin/upgrading/proplists.dat	Sun Jul 26 17:47:31 2009 +0000
+++ b/bin/upgrading/proplists.dat	Sun Jul 26 18:27:27 2009 +0000
@@ -301,14 +301,6 @@ userproplist.external_foaf_url:
   indexed: 0
   multihomed: 0
   prettyname: FOAF address
-
-userproplist.fb_num_pubpics:
-  cldversion: 4
-  datatype: num
-  des: Number of Public Fotobilder Pictures
-  indexed: 0
-  multihomed: 0
-  prettyname: Num FB Pics
 
 userproplist.friendspagetitle:
   cldversion: 4
diff -r d1cdcb5897f7 -r 81b487a3f369 bin/worker/update-fb-friends
--- a/bin/worker/update-fb-friends	Sun Jul 26 17:47:31 2009 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,102 +0,0 @@
-#!/usr/bin/perl
-use strict;
-use lib "$ENV{LJHOME}/cgi-bin";
-require 'ljlib.pl';
-use LJ::Worker::TheSchwartz;
-
-LJ::Worker::TheSchwartz->set_memory_limit(1024 * 1024 * 100); # 100MB memory limit.
-
-schwartz_decl('LJ::Worker::UpdateFotobilderFriends');
-schwartz_work();
-
-############################################################################
-
-package LJ::Worker::UpdateFotobilderFriends;
-use base 'TheSchwartz::Worker';
-use RPC::XML;
-use RPC::XML::Client;
-
-sub keep_exit_status_for { 0 }
-sub grab_for { 60 }
-sub max_retries { 500 }   # pretty much forever (500 days almost)
-sub retry_delay {
-    my ($class, $fails) = @_;
-    return 86400 if $fails > 20;
-    return 3600 if $fails > 7;
-    return [15, 15, 30, 60, 120, 300, 900, 900]->[$fails];
-}
-
-sub work {
-    my ($class, $job) = @_;
-    my $uid = $job->arg;
-
-    my $u = LJ::load_userid($uid)
-        or die "no userid";
-
-    # fotobilder won't autovivify communities so it won't accept
-    # friends update pushes.
-    if ( $u->is_community ) {
-        $job->completed;
-        return;
-    }
-
-    my %req = ( user => RPC::XML::string->new($u->{user}) );
-
-    # find all equivalent jobs BEFORE we do the potentially slow /
-    # blocky XML-RPC request.  this way if new invalidations come in
-    # while we're working, we don't invalidate those.  which is also
-    # why we don't use TheSchwartz's 'unique' feature and do it by
-    # hand like this.... afterwards we'll mark these found jobs as
-    # completed.
-    my $client = $job->handle->client;
-    my @others = $client->list_jobs({
-        funcname => $class,
-        coalesce => "uid:$uid",
-        limit => 100000,  # some journals update their friends a ton, scripted.  find all dups.
-    });
-
-    # best interface ever...  (temp duplicated here so we can push this without LJ::User push)
-    $RPC::XML::ENCODING = "utf-8";
-
-    # fill in groups info
-    LJ::fill_groups_xmlrpc($u, \%req);
-
-    my $client = RPC::XML::Client
-        ->new("$LJ::FB_SITEROOT/interface/xmlrpc");
-
-    my $req = RPC::XML::request->new('FB.XMLRPC.groups_push',
-                                     RPC::XML::smart_encode(\%req));
-
-    if ($ENV{'SHOW_REQUESTS'}) {
-        my $str = $req->as_string;
-        $str =~ s/(<\w+)/\n$1/g;
-        print $str, "\n";
-    }
-
-    my $res = $client->send_request($req);
-
-    # weirdest calling conventions evar.
-    die "No response from client" unless $res;
-    die "Error response (local): $res" unless ref $res;
-    if (UNIVERSAL::isa($res, "RPC::XML::fault")) {
-        my $code = ${$res->{faultCode}};
-        my $str  = ${$res->{faultString}};
-        if ($code eq "Client" && $str eq "Invalid user: $u->{user}") {
-            # treat this as success.  they've never used fotobilder, so they
-            # don't have an account there.  when it's vivified later, that
-            # process will pull in their then-current friends info
-        } else {
-            die "Error response from other party: code=$code string=$str\n";
-        }
-    }
-
-    # after all that, should have worked, so close this job and all others
-    # that existed prior
-    my $main_handle = $job->handle->as_string;
-    $job->completed;
-    foreach my $j (@others) {
-        next if $j->handle->as_string eq $main_handle;
-        $j->completed;
-    }
-}
-
diff -r d1cdcb5897f7 -r 81b487a3f369 cgi-bin/Apache/LiveJournal.pm
--- a/cgi-bin/Apache/LiveJournal.pm	Sun Jul 26 17:47:31 2009 +0000
+++ b/cgi-bin/Apache/LiveJournal.pm	Sun Jul 26 18:27:27 2009 +0000
@@ -42,9 +42,6 @@ BEGIN {
 
     require "ljlib.pl";
     require "ljprotocol.pl";
-    if (%LJ::FOTOBILDER_IP) {
-        use Apache::LiveJournal::Interface::FotoBilder;
-    }
 }
 
 my %RQ;       # per-request data
@@ -674,10 +671,6 @@ sub trans
             } elsif ($mode eq 'rss') {
                 # code 301: moved permanently, update your links.
                 return redir($r, LJ::journal_base($user) . "/data/rss$args_wq", 301);
-            } elsif ($mode eq 'pics' && $LJ::REDIRECT_ALLOWED{$LJ::FB_DOMAIN}) {
-                # redirect to a user's gallery
-                my $url = "$LJ::FB_SITEROOT/$user";
-                return redir($r, $url);
             } elsif ($mode eq 'tag') {
 
                 # tailing slash on here to prevent a second redirect after this one
@@ -920,11 +913,6 @@ sub trans
     if ($uri =~ m!^/(?:interface/(\w+))|cgi-bin/log\.cgi!) {
         my $int = $1 || "flat";
         $r->handler("perl-script");
-        if ($int eq "fotobilder") {
-            return 403 unless $LJ::FOTOBILDER_IP{$r->connection->remote_ip};
-            $r->push_handlers(PerlResponseHandler => \&Apache::LiveJournal::Interface::FotoBilder::handler);
-            return OK;
-        }
         if ($int =~ /^flat|xmlrpc|blogger|elsewhere_info|atom(?:api)?$/) {
             $RQ{'interface'} = $int;
             $RQ{'is_ssl'} = $is_ssl;
diff -r d1cdcb5897f7 -r 81b487a3f369 cgi-bin/Apache/LiveJournal/Interface/AtomAPI.pm
--- a/cgi-bin/Apache/LiveJournal/Interface/AtomAPI.pm	Sun Jul 26 17:47:31 2009 +0000
+++ b/cgi-bin/Apache/LiveJournal/Interface/AtomAPI.pm	Sun Jul 26 18:27:27 2009 +0000
@@ -12,7 +12,6 @@ use Class::Autouse qw(
                       );
 
 require 'parsefeed.pl';
-require 'fbupload.pl';
 
 # for Class::Autouse (so callers can 'ping' this method to lazy-load this class)
 sub load { 1 }
@@ -103,58 +102,7 @@ sub handle_upload
     return respond($r, 400, "Unsupported MIME type: $mime") unless $mime_area;
 
     if ($mime_area eq 'image') {
-
-        return respond($r, 400, "Unable to upload media. Your account doesn't have the required access.")
-            unless LJ::get_cap($u, 'fb_can_upload') && $LJ::FB_SITEROOT;
-
-        my $err;
-        LJ::load_user_props(
-            $u,
-            qw/ emailpost_gallery emailpost_imgsecurity /
-        );
-
-        my $summary = LJ::trim( $entry->summary() );
-
-        my $fb = LJ::FBUpload::do_upload(
-            $u, \$err,
-            {
-                path    => $entry->title(),
-                rawdata => \$entry->content()->body(),
-                imgsec  => $u->{emailpost_imgsecurity},
-                caption => $summary,
-                galname => $u->{emailpost_gallery} || 'Mobile',
-            }
-        );
-
-        return respond($r, 500, "There was an error uploading the media: $err")
-            if $err || ! $fb;
-
-        if (ref $fb && $fb->{Error}->{code}) {
-            my $errstr = $fb->{Error}->{content};
-            return respond($r, 500, "There was an error uploading the media: $errstr");
-        }
-
-        my $atom_reply = XML::Atom::Entry->new();
-        $atom_reply->title( $fb->{Title} );
-
-        if ($standalone) {
-            $atom_reply->summary('Media post');
-            my $id = "atom:$u->{user}:$fb->{PicID}";
-            $fb->{Summary} = $summary;
-
-            $u->set_cache("lifeblog_fb:$fb->{PicID}", $fb);
-
-            $atom_reply->id( "urn:fb:$LJ::FB_DOMAIN:$id" );
-        }
-
-        my $link = XML::Atom::Link->new();
-        $link->type('text/html');
-        $link->rel('alternate');
-        $link->href( $fb->{URL} );
-        $atom_reply->add_link($link);
-
-        $r->header_out("Location", $fb->{URL});
-        return respond($r, 201, \$atom_reply->as_xml(), 'atom');
+        return respond( $r, 400, "Unable to upload media." );
     }
 }
 
@@ -238,37 +186,6 @@ sub handle_post {
         }
     }
 
-    # Retrieve fotobilder media links from clients that embed via
-    # standalone tags or service.upload transfers.  Add to post entry
-    # body.
-    my $body  = $entry->content()->body();
-    my @links = $entry->link();
-    my (@images, $link_count);
-    foreach my $link (@links) {
-        # $link is now a valid XML::Atom::Link object
-        my $rel  = $link->get('rel');
-        my $type = $link->get('type');
-        my $id   = $link->get('href');
-
-        next unless $rel eq 'related' && check_mime($type) &&
-            $id =~ /^urn:fb:\Q$LJ::FB_DOMAIN\E:atom:\w+:(\d+)$/;
-
-        my $fb_picid = $1;
-
-        my $fb = $u->cache("lifeblog_fb:$fb_picid");
-        next unless $fb;
-
-        push @images, {
-            url     => $fb->{URL},
-            width   => $fb->{Width},
-            height  => $fb->{Height},
-            caption => $fb->{Summary},
-            title   => $fb->{Title}
-        };
-    }
-
-    $body .= LJ::FBUpload::make_html( $u, \@images );
-
     my $preformatted = $entry->get
         ("http://sixapart.com/atom/post#", "convertLineBreaks") eq 'false' ? 1 : 0;
 
@@ -279,7 +196,7 @@ sub handle_post {
         'username'    => $u->{'user'},
         'lineendings' => 'unix',
         'subject'     => $entry->title(),
-        'event'       => $body,
+        'event'       => $entry->content()->body(),
         'props'       => { opt_preformatted => $preformatted, taglist => \@tags },
         'tz'          => 'guess',
         %$security_opts,
@@ -608,8 +525,6 @@ sub handle {
             $add_link->($subservice);
         }
 
-        $add_link->('upload') if LJ::get_cap($u, 'fb_can_upload') && $LJ::FB_SITEROOT;
-
         my $link = XML::Atom::Link->new();
         $link->title($title);
         $link->type('text/html');
diff -r d1cdcb5897f7 -r 81b487a3f369 cgi-bin/Apache/LiveJournal/Interface/FotoBilder.pm
--- a/cgi-bin/Apache/LiveJournal/Interface/FotoBilder.pm	Sun Jul 26 17:47:31 2009 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,221 +0,0 @@
-#!/usr/bin/perl
-#
-
-package Apache::LiveJournal::Interface::FotoBilder;
-
-use strict;
-use Apache2::Const qw/ :common REDIRECT HTTP_NOT_MODIFIED
-                       HTTP_MOVED_PERMANENTLY HTTP_BAD_REQUEST /;
-
-sub run_method
-{
-    my $cmd = shift;
-
-    # Available functions for this interface.
-    my $interface = {
-        'checksession'       => \&checksession,
-        'get_user_info'      => \&get_user_info,
-        'makechals'          => \&makechals,
-        'set_quota'          => \&set_quota,
-        'user_exists'        => \&user_exists,
-        'get_auth_challenge' => \&get_auth_challenge,
-        'get_groups'         => \&get_groups,
-    };
-    return undef unless $interface->{$cmd};
-
-    return $interface->{$cmd}->(@_);
-}
-
-sub handler
-{
-    my $r = shift;
-    my $uri = $r->uri;
-    return 404 unless $uri =~ m#^/interface/fotobilder(?:/(\w+))?$#;
-    my $cmd = $1;
-
-    return HTTP_BAD_REQUEST unless $r->method eq "POST";
-
-    $r->content_type("text/plain");
-    $r->send_http_header();
-
-    my %POST = $r->content;
-    my $res = run_method($cmd, \%POST)
-        or return HTTP_BAD_REQUEST;
-
-    $res->{"fotobilder-interface-version"} = 1;
-
-    $r->print(join("", map { "$_: $res->{$_}\n" } keys %$res));
-
-    return OK;
-}
-
-# Is there a current LJ session?
-# If so, return info.
-sub get_user_info
-{
-    my $POST = shift;
-    BML::reset_cookies();
-    $LJ::_XFER_REMOTE_IP = $POST->{'remote_ip'};
-
-    # try to get a $u from the passed uid or user, falling back to the ljsession cookie
-    my $u;
-    if ($POST->{uid}) {
-        $u = LJ::load_userid($POST->{uid});
-    } elsif ($POST->{user}) {
-        $u = LJ::load_user($POST->{user});
-    } else {
-        my $sess = LJ::Session->session_from_fb_cookie;
-        $u = $sess->owner if $sess;
-    }
-    return {} unless $u && $u->{'journaltype'} =~ /[PI]/;
-
-    my $defaultpic = $u->userpic;
-
-    my %ret = (
-               user            => $u->{user},
-               userid          => $u->{userid},
-               statusvis       => $u->{statusvis},
-               can_upload      => can_upload($u),
-               gallery_enabled => can_upload($u),
-               diskquota       => LJ::get_cap($u, 'disk_quota') * (1 << 20), # mb -> bytes
-               fb_account      => LJ::get_cap($u, 'fb_account'),
-               fb_usage        => LJ::Blob::get_disk_usage($u, 'fotobilder'),
-               all_styles      => LJ::get_cap($u, 'fb_allstyles'),
-               is_identity     => $u->{journaltype} eq 'I' ? 1 : 0,
-               userpic_url     => $defaultpic ? $defaultpic->url : undef,
-               lj_can_style    => $u->get_cap('styles') ? 1 : 0,
-               userpic_count   => $u->get_userpic_count,
-               userpic_quota   => $u->userpic_quota,
-               esn             => $u->can_use_esn ? 1 : 0,
-               new_messages    => $u->new_message_count,
-               directory       => $u->get_cap('directory') ? 1 : 0,
-               makepoll        => $u->get_cap('makepoll') ? 1 : 0,
-               sms             => $u->can_use_sms ? 1 : 0,
-               );
-
-    # when the set_quota rpc call is executed (below), a placholder row is inserted
-    # into userblob.  it's just used for livejournal display of what we last heard
-    # fotobilder disk usage was, but we need to subtract that out before we report
-    # to fotobilder how much disk the user is using on livejournal's end
-    $ret{diskused} = LJ::Blob::get_disk_usage($u) - $ret{fb_usage};
-
-    return \%ret unless $POST->{fullsync};
-
-    LJ::fill_groups_xmlrpc($u, \%ret);
-    return \%ret;
-}
-
-# Forcefully push user info out to FB.
-# We use this for cases where we don't want to wait for
-# sync cache timeouts, such as user suspensions.
-sub push_user_info
-{
-    my $uid = LJ::want_userid( shift() );
-    return unless $uid;
-
-    my $ret = get_user_info({ uid => $uid });
-
-    eval "use XMLRPC::Lite;";
-    return if $@;
-
-    return XMLRPC::Lite
-        -> proxy("$LJ::FB_SITEROOT/interface/xmlrpc")
-        -> call('FB.XMLRPC.update_userinfo', $ret)
-        -> result;
-}
-
-# get_user_info above used to be called 'checksession', maintain
-# an alias for compatibility
-sub checksession { get_user_info(@_); }
-
-sub get_groups {
-    my $POST = shift;
-    my $u = LJ::load_user($POST->{user});
-    return {} unless $u;
-
-    my %ret = ();
-    LJ::fill_groups_xmlrpc($u, \%ret);
-    return \%ret;
-}
-
-# Pregenerate a list of challenge/responses.
-sub makechals
-{
-    my $POST = shift;
-    my $count = int($POST->{'count'}) || 1;
-    if ($count > 50) { $count = 50; }
-    my $u = LJ::load_user($POST->{'user'});
-    return {} unless $u;
-
-    my %ret = ( count => $count );
-
-    for (my $i=1; $i<=$count; $i++) {
-        my $chal = LJ::rand_chars(40);
-        my $resp = Digest::MD5::md5_hex($chal . Digest::MD5::md5_hex($u->password));
-        $ret{"chal_$i"} = $chal;
-        $ret{"resp_$i"} = $resp;
-    }
-
-    return \%ret;
-}
-
-# Does the user exist?
-sub user_exists
-{
-    my $POST = shift;
-    my $u = LJ::load_user($POST->{'user'});
-    return {} unless $u;
-
-    return {
-        exists => 1,
-        can_upload => can_upload($u),
-    };
-}
-
-# Mirror FB quota information over to LiveJournal.
-# 'user' - username
-# 'used' - FB disk usage in bytes
-sub set_quota
-{
-    my $POST = shift;
-    my $u = LJ::load_userid($POST->{'uid'});
-    return {} unless $u && defined $POST->{'used'};
-
-    return {} unless $u->writer;
-
-    my $used = $POST->{'used'} * (1 << 10);  # Kb -> bytes
-    my $result = $u->do('REPLACE INTO userblob SET ' .
-                        'domain=?, length=?, journalid=?, blobid=0',
-                        undef, LJ::get_blob_domainid('fotobilder'),
-                        $used, $u->{'userid'});
-
-    LJ::set_userprop($u, "fb_num_pubpics", $POST->{'pub_pics'});
-
-    return {
-        status => ($result ? 1 : 0),
-    };
-}
-
-sub get_auth_challenge
-{
-    my $POST = shift;
-
-    return {
-        chal => LJ::challenge_generate($POST->{goodfor}+0),
-    };
-}
-
-#########################################################################
-# non-interface helper functions
-#
-
-# Does the user have upload access?
-sub can_upload
-{
-    my $u = shift;
-
-    return LJ::get_cap($u, 'fb_account')
-        && LJ::get_cap($u, 'fb_can_upload') ? 1 : 0;
-}
-
-1;
diff -r d1cdcb5897f7 -r 81b487a3f369 cgi-bin/LJ/ConfCheck/General.pm
--- a/cgi-bin/LJ/ConfCheck/General.pm	Sun Jul 26 17:47:31 2009 +0000
+++ b/cgi-bin/LJ/ConfCheck/General.pm	Sun Jul 26 18:27:27 2009 +0000
@@ -207,17 +207,6 @@ add_conf('$EXAMPLE_USER_ACCOUNT',
          required => 0,
          type => "string",
          des => "The username of the example user account, for use in Support and documentation.  Must be an actual account on the site.",
-         );
-
-add_conf('$FB_DOMAIN',
-         type => 'hostname',
-         des => "Domain name for cooperating Fotobilder (media hosting/cataloging) installation",
-         );
-
-add_conf('$FB_SITEROOT',
-         type => 'url',
-         no_trailing_slash => 1,
-         des => "URL prefix to cooperating Fotobilder installation, without trailing slash.  For instance, http://pics.foo.com",
          );
 
 add_conf('$HOME',
@@ -687,9 +676,6 @@ add_conf('%USERPROP_INIT',
 add_conf('%USERPROP_INIT',
          type => '',
          des => "");
-add_conf('$FB_SITENAME',
-         type => '',
-         des => "");
 add_conf('$SYND_CAPS',
          type => '',
          des => "");
@@ -801,9 +787,6 @@ add_conf('%DBINFO',
 add_conf('%DBINFO',
          type => '',
          des => "");
-add_conf('%FOTOBILDER_IP',
-         type => '',
-         des => "");
 add_conf('@QBUFFERD_ISOLATE',
          type => '',
          des => "");
@@ -852,7 +835,6 @@ my %bools = (
              "DONT_LOG_IMAGES" => "Don't log requests for images.",
              "DO_GZIP" => "Compress text content sent to browsers.  Cuts bandwidth by over 50%.",
              "EVERYONE_VALID" => "Users don't need to validate their email addresses.",
-             "FB_QUOTA_NOTIFY" => "Do RPC requests to Fotobilder to inform it of disk quota changes.",
              "IS_DEV_SERVER" => "This is a development installation only, and not used for production.  A lot of debug info and intentional security holes for convenience are introduced when this is enabled.",
              "LOG_GTOP" => "Log per-request CPU and memory usage, using gtop libraries.",
              "NO_PASSWORD_CHECK" => "Don't do strong password checks.  Users can use any old dumb password they'd like.",
diff -r d1cdcb5897f7 -r 81b487a3f369 cgi-bin/LJ/Console/Command/Unsuspend.pm
--- a/cgi-bin/LJ/Console/Command/Unsuspend.pm	Sun Jul 26 17:47:31 2009 +0000
+++ b/cgi-bin/LJ/Console/Command/Unsuspend.pm	Sun Jul 26 18:27:27 2009 +0000
@@ -99,8 +99,6 @@ sub execute {
         $u->{statusvis} = 'V';
 
         LJ::statushistory_add($u, $remote, "unsuspend", $reason);
-        eval { $u->fb_push };
-        warn "Error running fb_push: $@\n" if $@ && $LJ::IS_DEV_SERVER;
 
         $self->print("User '$username' unsuspended.");
     }
diff -r d1cdcb5897f7 -r 81b487a3f369 cgi-bin/LJ/M/ProfilePage.pm
--- a/cgi-bin/LJ/M/ProfilePage.pm	Sun Jul 26 17:47:31 2009 +0000
+++ b/cgi-bin/LJ/M/ProfilePage.pm	Sun Jul 26 18:27:27 2009 +0000
@@ -36,7 +36,7 @@ sub _init {
                        journaltitle journalsubtitle public_key
                        url urlname opt_hidefriendofs dont_load_members
                        opt_blockrobots adult_content
-                       opt_showmutualfriends fb_num_pubpics opt_showschools);
+                       opt_showmutualfriends opt_showschools);
         if ($u->is_community) {
             push @props, qw(moderated comm_theme);
         } elsif ($u->is_syndicated) {
diff -r d1cdcb5897f7 -r 81b487a3f369 cgi-bin/LJ/Session.pm
--- a/cgi-bin/LJ/Session.pm	Sun Jul 26 17:47:31 2009 +0000
+++ b/cgi-bin/LJ/Session.pm	Sun Jul 26 18:27:27 2009 +0000
@@ -240,14 +240,6 @@ sub domsess_cookie_string {
     return $value;
 }
 
-# this is just a wrapper around domsess
-sub fb_cookie_string {
-
-    # FIXME: can we just use domsess's function like this?
-    #        might be more differences so we need to write a new one?
-    return domsess_cookie_string(@_);
-}
-
 # sets new ljmastersession cookie given the session object
 sub update_master_cookie {
     my ($sess) = @_;
@@ -298,16 +290,6 @@ sub update_master_cookie {
                    domain          => $LJ::DOMAIN,
                    path            => '/',
                    delete          => 1);
-    }
-
-    # set fb global cookie
-    if ($LJ::FB_SITEROOT) {
-        my $fb_cookie = fb_cookie();
-        set_cookie($fb_cookie    => $sess->fb_cookie_string($fb_cookie),
-                   domain        => $LJ::DOMAIN,
-                   path          => '/',
-                   http_only     => 1,
-                   @expires,);
     }
 
     return;
@@ -484,13 +466,6 @@ sub url_owner {
     return LJ::canonical_username($user);
 }
 
-sub fb_cookie {
-    my ($class) = @_;
-
-    # where $subdomain is actually a username:
-    return "ljsession";
-}
-
 # CLASS METHOD
 #  -- frontend to session_from_domain_cookie and session_from_master_cookie below
 sub session_from_cookies {
@@ -552,17 +527,6 @@ sub session_from_domain_cookie {
     }
 
     return $no_session->("no valid cookie");
-}
-
-sub session_from_fb_cookie {
-    my $class = shift;
-
-    my $domcook  = LJ::Session->fb_cookie;
-    my $fbcookie = $BML::COOKIE{$domcook};
-    return undef unless $fbcookie;
-
-    my $sess = valid_fb_cookie($domcook, $fbcookie);
-    return $sess;
 }
 
 
@@ -724,15 +688,6 @@ sub clear_master_cookie {
                domain          => $LJ::DOMAIN,
                path            => '/',
                delete          => 1);
-
-    # set fb global cookie
-    if ($LJ::FB_SITEROOT) {
-        my $fb_cookie = fb_cookie();
-        set_cookie($fb_cookie    => "",
-                   domain        => $LJ::DOMAIN,
-                   path          => '/',
-                   delete        => 1);
-    }
 }
 
 
@@ -820,13 +775,6 @@ sub domsess_signature {
     my $data = join("-", $sess->{auth}, $domcook, $u->{userid}, $sess->{sessid}, $time);
     my $sig  = hmac_sha1_hex($data, $secret);
     return $sig;
-}
-
-# same logic as domsess_signature, so just a wrapper
-sub fb_signature {
-    my ($time, $sess, $fbcook) = @_;
-
-    return domsess_signature($time, $sess, $fbcook);
 }
 
 # function or instance method.
@@ -958,15 +906,6 @@ sub valid_domain_cookie {
     return $sess;
 }
 
-sub valid_fb_cookie {
-    my ($domcook, $val) = @_;
-    my $opts = {
-        ignore_age     => 1,
-        ignore_li_cook => 1,
-    };
-    return valid_domain_cookie($domcook, $val, undef, $opts);
-}
-
 sub valid_destination {
     my $dest = shift;
     return $dest =~ qr!^http://[\w\-\.]+\.\Q$LJ::USER_DOMAIN\E/.*!;
diff -r d1cdcb5897f7 -r 81b487a3f369 cgi-bin/LJ/Splash.pm
--- a/cgi-bin/LJ/Splash.pm	Sun Jul 26 17:47:31 2009 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,284 +0,0 @@
-package LJ::Splash;
-
-use strict;
-use warnings;
-
-use base 'Splash::Server';
-
-use Digest::SHA1;
-use DateTime;
-
-use Splash;
-use Splash::User;
-use Splash::Blog;
-use Splash::Album;
-use Splash::Entry;
-use Splash::Comment;
-
-sub new {
-    my $class = shift;
-    my $self = bless {}, (ref $class || $class);
-    return $self;
-}
-
-sub user {
-    my $self = shift;
-
-    my $u = $self->{u};
-
-    my $userid = $u->{userid};
-    my $jtype = $u->{journaltype};
-    my $type = ($jtype eq 'P') ? 'paid' : 'free';
-    
-    return Splash::User->new( {
-        id  => $userid,
-        type => $type,
-        quota   => 100,
-        subscriptions   => [ $self->subscriptions ],
-        remotes => [ $self->remotes ],
-    } );
-}
-
-sub changes {
-    my $self = shift;
-    my ($blog, $max, $timestamp, $viewpassword) = @_;
-
-    my $ts = DateTime->now;
-    my @blogs = $self->blogs();
-    my @albums = $self->albums();
-    my @entries = $self->entries();
-    my @comments = $self->comments();
-    return "${ts}Z", \@blogs, \@albums, \@entries, \@comments;
-}
-
-sub subscriptions {
-    my $self = shift;
-    my $u = $self->{u};
-    return $u->{user};
-}
-
-sub remotes {
-    my $self = shift;
-    my $u = $self->{u};
-    return ();
-}
-
-sub blogs {
-    my $self = shift;
-    my $blogs = $self->{blogs} = {};
-    my @return;
-    foreach my $sub ($self->subscriptions) {
-        my $subusr = LJ::load_user( $sub );
-        $blogs->{$sub} = $subusr;
-        push @return, Splash::Blog->new( {
-            name        => $subusr->{user},
-            lastmod     => '2005-03-21T17:08:15Z',
-            title       => "Long title $subusr->{user}",
-            subtitle    => "Subtitle $subusr->{user}",
-            type        => 'normal',
-            visibility  => 'normal',
-            writable    => 'yes',
-            commentable => 'yes',
-            ownerid     => $subusr->{userid},
-        } );
-    }
-    return @return;
-}
-
-sub albums {
-    my $self = shift;
-    my $blogs = $self->{blogs};
-    my $albums = $self->{albums} = {};
-    my @return;
-    while (my ($blogname, $blog) = each %$blogs) {
-        $albums->{$blogname} = $blog;
-        push @return, Splash::Album->new( {
-            id      => $blog->{userid},
-            lastmod => '2005-03-21T17:08:15Z',
-            name    => $blog->{user},
-            uri     => $blog->journal_base,
-        } );
-    }
-    return @return;
-}
-
-sub entries {
-    my $self = shift;
-    # This is horribly inefficient, but I'd rather just get it over with.
-    my @options = ( $self->{maxentries} ? ( count => $self->{maxentries} ) : () );
-    my $entries = $self->{entries} = [];
-    my $albums = $self->{albums};
-    my @return;
-    while( my ($albumname, $album) = each %$albums) {
-        foreach my $entry ($album->recent_entries( @options )) {
-            push @$entries, $entry;
-            push @return, Splash::Entry->new( {
-                deleted     => 0,
-                id          => $entry->ditemid,
-                albumid     => $entry->journalid,
-                userid      => $entry->posterid,
-                lastmod     => '2005-03-21T17:08:15Z',
-                title       => $entry->subject_text,
-                caption     => 'Caption',
-                byline      => 'Byline',
-                original    => $album->userpic->url,
-                medium      => $album->userpic->url,
-                thumbnail   => $album->userpic->url,
-                postdate    => '2005-03-21T17:08:15Z',
-                photodate   => '2005-03-21T17:08:15Z',
-            } );
-        }
-    }
-    return @return;
-}
-
-sub comments {
-    my $self = shift;
-
-    my $entries = $self->{entries};
-    my @return;
-
-    foreach my $entry (@$entries) {
-        foreach my $comment (LJ::Talk::load_comments( LJ::load_user( $entry->journalid ), $self->{u}, 'L', $entry->jitemid, { flat => 1 } )) {
-            push @return, Splash::Comment->new( {
-                deleted     => 0,
-                id          => $comment->{talkid},
-                lastmod     => $comment->{datepost},
-                entryid     => $entry->ditemid,
-                userid      => $comment->{posterid},
-                byline      => $comment->{posterid},
-                timestamp   => $comment->{datepost},
-                text        => $comment->{body},
-            } );
-        }
-    }
-    return @return;
-}
-
-sub checkauth {
-    my $self = shift;
-    my ($user, $ctime, $nonce, $digest) = @_;
-
-    die "No username passed in\n" unless $user;
-    die "No creation timestamp passed in\n" unless $ctime;
-    die "No nonce passed in\n" unless $nonce;
-    die "No digest passed in\n" unless $digest;
-
-    my $cdigest = Digest::SHA1::sha1( $nonce . $ctime . $self->getpassword( $user ) );
-    die "Login failure" unless $digest eq $cdigest;
-
-    LJ::User->set_remote( $self->{u} );
-    return;
-}
-
-sub getpassword {
-    my $self = shift;
-    my $user = shift;
-
-    my ($ljusername) = $user =~ m/^(\S+)\@livejournal\.com$/i;
-    die "Not an LJ user" unless $ljusername;
-    die "Improper LJ username" unless LJ::canonical_username( $ljusername );
-
-    my $dbr = LJ::get_db_reader()
-        or die "LJ database system failure";
-
-    my $u = $self->{u} = LJ::load_user( $ljusername );
-
-    die "Nonexistant user" unless( $u );
-
-    die "Login IP banned" if (LJ::login_ip_banned( $u ));
-
-    return $u->password;
-}
-
-sub delete_category {
-    my $self = shift;
-    return;
-}
-
-sub add_photo {
-    my $self = shift;
-    my ($blogid, $categoryid, $title, $caption, $postdate, $picturedate, $jpegdata) = @_;
-
-    my $u = $self->{u};
-    my $errstr;
-    
-    my $fb_result = LJ::FBUpload::do_upload(
-        $u, \$errstr,
-        {
-            path    => '/foo/img.jpg',
-            rawdata => \$jpegdata,
-            imgsec  => '',
-            galname => '',
-            caption => $caption,
-            title   => $title,
-        },
-    );
-
-    my $fb_html = LJ::FBUpload::make_html( $u,
-        [{
-            url => $fb_result->{URL},
-            width   => $fb_result->{Width},
-            height  => $fb_result->{Height},
-            title   => $title,
-            caption => $caption,
-        }],
-        {}
-    ); # hashref should be sec options and whatnot.
-
-    my $req = {
-        'username'  => $u->{user},
-        'ver'       => $LJ::PROTOCOL_VER,
-        'subject'   => $title,
-        'event'     => $fb_html,
-        'tz'        => 'guess',
-    };
-
-    my $flags = {
-        nopassword => 1,
-    };
-
-    my $err;
-    my $res = LJ::Protocol::do_request( 'postevent', $req, \$err, $flags );
-
-    my $entry = LJ::Entry->new( $u,
-        jitemid => $res->{itemid},
-        anum    => $res->{anum},
-    );
-    
-    return Splash::Entry->new( {
-        deleted     => 0,
-        id          => $entry->ditemid,
-        albumid     => 234,
-        userid      => $u->{userid},
-        lastmod     => '2005-03-21T17:08:15Z',
-        title       => $title,
-        caption     => $caption,
-        byline      => $u->{user},
-        original    => 'nowhere',
-        medium      => 'nowhere',
-        thumbnail   => 'nowhere',
-        postdate    => '2005-03-21T17:08:15Z',
-        photodate   => '2005-03-21T17:08:15Z',
-    } );
-}
-
-sub delete_photo {
-    my $self = shift;
-            return;
-}
-
-sub delete_comment {
-    my $self = shift;
-    return;
-}
-
-# This subroutine should be used to check and see if the timestamp on the auth request is out of line or not.
-sub checkauthtime {
-    my $self = shift;
-    my $ctime = shift;
-    # die "Please check the time on your handheld device" unless $ctimeisgood;
-    return;
-}
-
-1;
diff -r d1cdcb5897f7 -r 81b487a3f369 cgi-bin/LJ/User.pm
--- a/cgi-bin/LJ/User.pm	Sun Jul 26 17:47:31 2009 +0000
+++ b/cgi-bin/LJ/User.pm	Sun Jul 26 18:27:27 2009 +0000
@@ -495,9 +495,6 @@ sub set_suspended {
 
     LJ::statushistory_add($u, $who, "suspend", $reason);
 
-    eval { $u->fb_push };
-    warn "Error running fb_push: $@\n" if $@ && $LJ::IS_DEV_SERVER;
-
     LJ::run_hooks("account_cancel", $u);
 
     if (my $err = LJ::run_hook("cdn_purge_userpics", $u)) {
@@ -556,9 +553,6 @@ sub set_unsuspended {
     }
 
     LJ::statushistory_add($u, $who, "unsuspend", $reason);
-
-    eval { $u->fb_push };
-    warn "Error running fb_push: $@\n" if $@ && $LJ::IS_DEV_SERVER;
 
     return $res; # success
 }
@@ -5278,13 +5272,6 @@ sub friend_and_watch {
 
 sub remove_friend {
     confess 'LJ::User->remove_friend has been deprecated.';
-}
-
-
-sub fb_push {
-    my $u = shift;
-    return unless $u && $u->get_cap("fb_account");
-    return Apache::LiveJournal::Interface::FotoBilder::push_user_info( $u->id );
 }
 
 
diff -r d1cdcb5897f7 -r 81b487a3f369 cgi-bin/fbupload.pl
--- a/cgi-bin/fbupload.pl	Sun Jul 26 17:47:31 2009 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,233 +0,0 @@
-#!/usr/bin/perl
-
-package LJ::FBUpload;
-use strict;
-
-use lib "$LJ::HOME/cgi-bin";
-use LJ::Config;
-LJ::Config->load;
-
-require "ljlib.pl";
-
-use MIME::Words ();
-use XML::Simple;
-use IO::Handle;
-use LWP::UserAgent;
-use URI::Escape;
-use Digest::MD5 ();
-use File::Basename ();
-
-*hash = \&Digest::MD5::md5_hex;
-
-# This has bitten us one too many times.
-# Don't let startup continue unless LWP is ok.
-die "* Installed version of LWP is too old! *" if LWP->VERSION < 5.803;
-
-sub make_auth
-{
-    my ($chal, $password) = @_;
-    return unless $chal && $password;
-    return "crp:$chal:" . hash($chal . hash($password));
-}
-
-sub get_challenge
-{
-    my ($u, $ua, $err) = @_;
-    return unless $u && $ua;
-
-    my $req = HTTP::Request->new(GET => "$LJ::FB_SITEROOT/interface/simple");
-    $req->push_header("X-FB-Mode" => "GetChallenge");
-    $req->push_header("X-FB-User" => $u->{'user'});
-
-    my $res = $$ua->request($req);
-    if ($res->is_success()) {
-
-        my $xmlres = XML::Simple::XMLin($res->content);
-        my $methres = $xmlres->{GetChallengeResponse};
-        return $methres->{Challenge};
-
-    } else {
-        $$err = $res->content();
-        return;
-    }
-}
-
-# <LJFUNC>
-# name: LJ::FBUpload::do_upload
-# des: Uploads an image to FotoBilder from LiveJournal.
-# args: path, rawdata?, imgsec, caption?, galname
-# des-path: => path to image on disk, or title to use if 'rawdata' isn't on disk.
-# des-rawdata: => optional image data scalar ref.
-# des-imgsec: => bitmask for image security. Defaults to private on
-#             unknown strings. Lack of an imgsec opt means public.
-# des-caption: => optional image description.
-# des-galname: => gallery to upload image to.
-# info:
-# returns: FB protocol data structure, regardless of FB success or failure. 
-#         It's the callers responsibility to check the structure 
-#         for FB return values.
-#         On HTTP failure, returns numeric HTTP error code, and
-#         sets $rv reference with errorstring. Or undef on unrecoverable failure.
-# </LJFUNC>
-sub do_upload
-{
-    my ($u, $rv, $opts) = @_;
-    unless ($u && $opts->{'path'}) {
-        $$rv = "Invalid parameters to do_upload()";
-        return;
-    }
-
-    my $ua = LWP::UserAgent->new;
-    $ua->agent("LiveJournal_FBUpload/0.2");
-
-    my $err;
-    my $chal = get_challenge($u, \$ua, \$err);
-    unless ($chal) {
-        $$rv = "Error getting challenge from FB server: $err";
-        return;
-    }
-
-    my $rawdata = $opts->{'rawdata'};
-    unless ($rawdata) {
-        # no rawdata was passed, so slurp it in ourselves
-        unless (open (F, $opts->{'path'})) {
-            $$rv = "Couldn't read image file: $!\n";
-            return;
-        }
-        binmode(F);
-        my $data;
-        { local $/ = undef; $data = <F>; }
-        $rawdata = \$data;
-        close F;
-    }
-
-    # convert strings to security masks/
-    # default to private on unknown strings.
-    # lack of an imgsec opt means public.
-    $opts->{imgsec} ||= 255;
-    unless ($opts->{imgsec} =~ /^\d+$/) {
-        my %groupmap = (
-            private  => 0,   regusers => 253,
-            friends  => 254, public => 255
-        );
-        $opts->{imgsec} = 'private' unless $groupmap{ $opts->{imgsec} };
-        $opts->{imgsec} = $groupmap{ $opts->{imgsec} };
-    }
-
-    my $basename = File::Basename::basename($opts->{'path'});
-    my $length = length $$rawdata;
-
-    my $req = HTTP::Request->new(PUT => "$LJ::FB_SITEROOT/interface/simple");
-    my %headers = (
-        'X-FB-Mode'                    => 'UploadPic',
-        'X-FB-UploadPic.ImageLength'   => $length,
-        'Content-Length'               => $length,
-        'X-FB-UploadPic.Meta.Filename' => $basename,
-        'X-FB-UploadPic.MD5'           => hash($$rawdata),
-        'X-FB-User'                    => $u->{'user'},
-        'X-FB-Auth'                    => make_auth( $chal, $u->password ),
-        ':X-FB-UploadPic.Gallery._size'=> 1,
-        'X-FB-UploadPic.PicSec'        => $opts->{'imgsec'},
-        'X-FB-UploadPic.Gallery.0.GalName' => $opts->{'galname'} || 'LJ_emailpost',
-        'X-FB-UploadPic.Gallery.0.GalSec'  => 255
-    );
-
-    $headers{'X-FB-UploadPic.Meta.Title'} = $opts->{title}
-      if $opts->{title};
-
-    $headers{'X-FB-UploadPic.Meta.Description'} = $opts->{caption}
-      if $opts->{caption};
-
-    $req->push_header($_, $headers{$_}) foreach keys %headers;
-
-    $req->content($$rawdata);
-    my $res = $ua->request($req);
-
-    my $res_code = $1 if $res->status_line =~ /^(\d+)/;
-    unless ($res->is_success) {
-        $$rv = "HTTP error uploading pict: " . $res->content();
-        return $res_code;
-    }
-
-    my $xmlres;
-    eval { $xmlres = XML::Simple::XMLin($res->content); };
-    if ($@) {
-        $$rv = "Error parsing XML: $@";
-        return;
-    }
-    my $methres = $xmlres->{UploadPicResponse};
-    $methres->{Title} = $basename;
-
-    return $methres;
-}
-
-# args:
-#       $u,
-#       arrayref of { title, url, width, height, caption }
-#       optional opts overrides hashref.
-#               (if not supplied, userprops are used.)
-# returns: html string suitable for entry post body
-# TODO: Hook this like the Fotobilder "post to journal"
-#       caption posting page.  More pretty. (layout keywords?)
-sub make_html
-{
-    my ($u, $images, $opts) = @_;
-    my ($icount, $html);
-
-    $icount = scalar @$images;
-    return "" unless $icount;
-
-    # Merge overrides with userprops that might
-    # have been passed in.
-    $opts = {} unless $opts && ref $opts;
-    my @props = qw/ emailpost_imgsize emailpost_imglayout emailpost_imgcut /;
-
-    LJ::load_user_props( $u, @props );
-    foreach (@props) {
-        my $prop = $_;
-        $prop =~ s/emailpost_//;
-        $opts->{$prop} = lc($opts->{$prop}) || $u->{$_};
-    }
-
-    $html .= "\n";
-
-    # set journal image display size
-    my @valid_sizes = qw/ 100x100 320x240 640x480 /;
-    $opts->{imgsize} = '320x240' unless grep { $opts->{imgsize} eq $_; } @valid_sizes;
-    my ($width, $height) = split 'x', $opts->{imgsize};
-    my $size = '/s' . $opts->{imgsize};
-
-    # force lj-cut on images larger than 320 in either direction
-    $opts->{imgcut} = 'count'
-      if ( $width > 320 || $height > 320 ) && ! $opts->{imgcut};
-
-    # insert image links into post body
-    my $horiz = $opts->{imglayout} =~ /^horiz/i;
-    $html .=
-      "<cut text='$icount "
-      . ( ( $icount == 1 ) ? 'image' : 'images' ) . "'>"
-          if $opts->{imgcut} eq 'count';
-    $html .= "<table border='0'><tr>" if $horiz;
-
-    foreach my $i (@$images) {
-        my $title = LJ::ehtml($i->{'title'});
-
-        # don't set a size on images smaller than the requested width/height
-        # (we never scale larger, just smaller)
-        undef $size if $i->{width} <= $width || $i->{height} <= $height;
-
-        $html .= "<td>" if $horiz;
-        $html .= "<cut text=\"$title\">" if $opts->{imgcut} eq 'titles';
-        $html .= "<a href=\"$i->{url}/\">";
-        $html .= "<img src=\"$i->{url}$size\" alt=\"$title\" border=\"0\"></a><br />";
-        $html .= "$i->{caption}<br />" if $i->{caption};
-        $html .= $horiz ? '</td>' : '<br />';
-        $html .= "</cut> " if $opts->{imgcut} eq 'titles';
-    }
-    $html .= "</tr></table>" if $horiz;
-    $html .= "</cut>\n" if $opts->{imgcut} eq 'count';
-
-    return $html;
-}
-
-1;
diff -r d1cdcb5897f7 -r 81b487a3f369 cgi-bin/ljlib.pl
--- a/cgi-bin/ljlib.pl	Sun Jul 26 17:47:31 2009 +0000
+++ b/cgi-bin/ljlib.pl	Sun Jul 26 18:27:27 2009 +0000
@@ -161,9 +161,6 @@ LJ::MemCache::init();
                  "res" => {
                      "des" => "S2-specific resources (stylesheet)",
                  },
-                 "pics" => {
-                     "des" => "FotoBilder pics (root gallery)",
-                 },
                  "info" => {
                      # just a redirect to userinfo.bml for now.
                      # in S2, will be a real view.
@@ -226,7 +223,6 @@ sub get_blob_domainid
         "phonepost" => 2,
         "captcha_audio" => 3,
         "captcha_image" => 4,
-        "fotobilder" => 5,
     }->{$name};
     # FIXME: add hook support, so sites can't define their own
     # general code gets priority on numbers, say, 1-200, so verify
diff -r d1cdcb5897f7 -r 81b487a3f369 htdocs/editpics.bml
--- a/htdocs/editpics.bml	Sun Jul 26 17:47:31 2009 +0000
+++ b/htdocs/editpics.bml	Sun Jul 26 18:27:27 2009 +0000
@@ -50,15 +50,6 @@ use strict;
 
     my $returl = LJ::CleanHTML::canonical_url($POST{'ret'});
     my $picurl = LJ::CleanHTML::canonical_url($POST{'urlpic'});
-    my $fotobilder = index($returl, $LJ::FB_SITEROOT) == 0 &&
-        $picurl =~ m!^$LJ::FB_SITEROOT/~?$remote->{'user'}/pic/!;
-
-    if ($fotobilder &&
-        (LJ::check_referer($returl) || LJ::check_referer('/editpics.bml'))) {
-
-        return $err->('Invalid referring site or redirection not allowed')
-            unless $returl =~ /$LJ::FB_DOMAIN/ && LJ::get_cap($u, 'fb_account');
-    }
 
     if (LJ::get_cap($u, "readonly")) {
         $title = "Read-only mode";
@@ -304,7 +295,7 @@ use strict;
         }
 
         # now fall through to edit page and show the updated userpic info
-        # redirect back to ourselves/fotobilder
+        # redirect back to ourselves
         $returl = LJ::CleanHTML::canonical_url($POST{'ret'});
         if ($returl) {
             my $redir_host = $1 if $returl =~ m!^http://([\.:\w-]+)!i;
@@ -312,16 +303,10 @@ use strict;
         }
     }
 
-    if ($fotobilder && $POST{'md5sum'}) {
-        $fotobilder = 0 if LJ::Userpic->new_from_md5($u, $POST{'md5sum'});
-    }
-
-    if (!$fotobilder) {
-        # authas switcher form
-        $body .= "<form method='get' id='userpic_authas' action='editpics$suffix.bml'>\n";
-        $body .= LJ::make_authas_select($remote, { 'authas' => $GET{'authas'} }) . "\n";
-        $body .= "</form>\n\n";
-    }
+    # authas switcher form
+    $body .= "<form method='get' id='userpic_authas' action='editpics$suffix.bml'>\n";
+    $body .= LJ::make_authas_select($remote, { 'authas' => $GET{'authas'} }) . "\n";
+    $body .= "</form>\n\n";
 
     # if we're disabling media, say so
     $body .= "<?warningbar $ML{'error.mediauploadsdisabled'} warningbar?>"
@@ -345,38 +330,29 @@ use strict;
                     <form enctype="multipart/form-data" action="editpics$suffix.bml$getextra" method='post' id='uploadPic'>
                     <input type="hidden" id="go_to" name="go_to" value="editpics$suffix.bml$getextra" />
             };
-            if ($fotobilder) {
-                $body .= "<?h1 $ML{'.uploadheader.fb'} h1?>\n";
-                $body .= "<?p " . BML::ml('.uploaddesc.fb', {'aopts' => "href='$LJ::FB_SITEROOT'", 'sitename' => $LJ::FB_SITENAME}) . " p?>\n\n";
-            } else {
-                $body .= "<?h1 $ML{'.uploadheader'} h1?>\n";
-                $body .= "<p class='detail'><a href='javascript:void(0)' onclick='toggleElement(\"upload_desc\")' id='upload_desc_link'>$ML{'.about.icons'}</a></p>";
-                $body .= "<div id='upload_desc'>";
-                $body .= "<?p $ML{'.uploaddesc'} p?>\n";
-                $body .= "</div><!-- end #uploaddesc -->";
-            }
-            if ($fotobilder) {
-                $body .= "<img src='$picurl' />";
-                my $url = LJ::CleanHTML::canonical_url($POST{'url'});
-                $body .= LJ::html_hidden('src', 'url', 'urlpic', $picurl, 'url', $url, 'ret' => $returl);
-            } else {
-                $body .= "<div id='upload_wrapper' class='pkg'>\n";
-                $body .= "<p class='pkg'>\n";
-                $body .= LJ::html_check({ 'type' => 'radio', 'name' => 'src', 'id' => 'radio_file',
-                                          'class' => 'radio', 'value' => 'file', 'selected' => '1', 
-                                          'accesskey' => $ML{'.fromfile.key'} }) . "\n";
-                $body .= "<label for='radio_file'>$ML{'.fromfile'}</label><br />\n";
-                $body .= "<input type='file' class='file' name='userpic_0' size='18' style='margin: 0em 0em 0.5em 2em;' />\n";
-                $body .= "</p>\n";
-                $body .= "<p class='pkg'>\n";
-                $body .= LJ::html_check({ 'type' => 'radio', 'name' => 'src', 'value' => 'url',
-                                          'id' => 'radio_url', 'class' => 'radio', 'accesskey' => $ML{'.fromurl.key'} }) . "\n";
-                $body .= "<label for='radio_url'>$ML{'.fromurl'}</label><br />\n";
-                $body .= LJ::html_text({ 'name' => 'urlpic_0', class => 'text', style => 'margin: 0em 0em 0.5em 2em;' }) . "\n";
-                $body .= "</p>\n";
-                $body .= "<p class='detail'>$ML{'.label.formats.desc'}</p>\n";
-                $body .= "</div>\n";
-            }
+
+            $body .= "<?h1 $ML{'.uploadheader'} h1?>\n";
+            $body .= "<p class='detail'><a href='javascript:void(0)' onclick='toggleElement(\"upload_desc\")' id='upload_desc_link'>$ML{'.about.icons'}</a></p>";
+            $body .= "<div id='upload_desc'>";
+            $body .= "<?p $ML{'.uploaddesc'} p?>\n";
+            $body .= "</div><!-- end #uploaddesc -->";
+
+            $body .= "<div id='upload_wrapper' class='pkg'>\n";
+            $body .= "<p class='pkg'>\n";
+            $body .= LJ::html_check({ 'type' => 'radio', 'name' => 'src', 'id' => 'radio_file',
+                                      'class' => 'radio', 'value' => 'file', 'selected' => '1', 
+                                      'accesskey' => $ML{'.fromfile.key'} }) . "\n";
+            $body .= "<label for='radio_file'>$ML{'.fromfile'}</label><br />\n";
+            $body .= "<input type='file' class='file' name='userpic_0' size='18' style='margin: 0em 0em 0.5em 2em;' />\n";
+            $body .= "</p>\n";
+            $body .= "<p class='pkg'>\n";
+            $body .= LJ::html_check({ 'type' => 'radio', 'name' => 'src', 'value' => 'url',
+                                      'id' => 'radio_url', 'class' => 'radio', 'accesskey' => $ML{'.fromurl.key'} }) . "\n";
+            $body .= "<label for='radio_url'>$ML{'.fromurl'}</label><br />\n";
+            $body .= LJ::html_text({ 'name' => 'urlpic_0', class => 'text', style => 'margin: 0em 0em 0.5em 2em;' }) . "\n";
+            $body .= "</p>\n";
+            $body .= "<p class='detail'>$ML{'.label.formats.desc'}</p>\n";
+            $body .= "</div>\n";
 
             $body .= "<hr class='hr' />";
 
@@ -392,7 +368,7 @@ use strict;
             if (LJ::Userpic->user_supports_comments($u)) {
                 $body .= "<p class='pkg'>\n";
                 $body .= "<label class='left' for='comments_0'>$ML{'.label.comment'}</label>\n";
-                my $comments = $POST{'comments'} if $fotobilder;
+                my $comments = $POST{'comments'};
                 $body .= "<span class='input-wrapper'>";
                 $body .= LJ::html_text({ 'name' => 'comments_0', 'class' => 'text', id => 'comments_0', 'maxlength' => LJ::CMAX_UPIC_COMMENT, 'value', $comments }) . "\n";
                 $body .= LJ::help_icon_html('upic_comments') . "\n";
@@ -403,7 +379,7 @@ use strict;
 
             $body .= "<p class='pkg'>\n";
             $body .= "<label class='left' for='descriptions_0'>$ML{'.label.description'}</label>\n";
-            my $descriptions = $POST{'descriptions'} if $fotobilder;
+            my $descriptions = $POST{'descriptions'};
             $body .= "<span class='input-wrapper'>";
             $body .= LJ::html_text( { name => 'descriptions_0', class => 'text', id => 'descriptions_0', 'maxlength' => LJ::CMAX_UPIC_DESCRIPTION, value => $descriptions } ) . "\n";
             $body .= LJ::help_icon_html('upic_descriptions') . "\n";
@@ -479,7 +455,7 @@ use strict;
     $emit_upload_box->();
 
     # print out each pic and editing fields
-    if (scalar @userpics && !$fotobilder) {
+    if ( scalar @userpics ) {
         $body .= "<div id='current_userpics'>";
         $body .= "<form method='post' action='editpics$suffix.bml$getextra'>";
         $body .= LJ::form_auth();
@@ -582,7 +558,7 @@ use strict;
         $body .= "editpicsInit();\n";
         $body .= "</script>\n";
 
-    } elsif (!$fotobilder) {
+    } else {
         $body .= qq {
                 <?h1 $ML{'.nopics'} h1?>
                 <?p $ML{'.noneupload2'} p?>
diff -r d1cdcb5897f7 -r 81b487a3f369 htdocs/editpics.bml.text
--- a/htdocs/editpics.bml.text	Sun Jul 26 17:47:31 2009 +0000
+++ b/htdocs/editpics.bml.text	Sun Jul 26 18:27:27 2009 +0000
@@ -121,13 +121,9 @@
 
 .uploaddesc=Use the form below to upload a new picture.
 
-.uploaddesc.fb=Upload a thumbnail of an image hosted on your <a [[aopts]]>[[sitename]]</a> account as a new user picture.
-
 .uploaddesc.userpicfactory=Upload a JPG image of any size and we'll send you to the Userpic Factory where you can easily crop and resize it.
 
 .uploadheader=Upload a New Picture
-
-.uploadheader.fb=Upload a New Picture From ScrapBook
 
 .uploadsuccessful=Image has been successfully uploaded
 
diff -r d1cdcb5897f7 -r 81b487a3f369 htdocs/login.bml
--- a/htdocs/login.bml	Sun Jul 26 17:47:31 2009 +0000
+++ b/htdocs/login.bml	Sun Jul 26 18:27:27 2009 +0000
@@ -62,16 +62,6 @@
         # Redirect to offsite uri if allowed, and not an internal LJ redirect. ('ret' == 1)
         if ($POST{ret} && $POST{ret} != 1) {
             my $redir_host = $1 if $POST{ret} =~ m#^http://([\.:\w-]+)#i;
-        
-            # if the redirect is going to FotoBilder, and they don't have the fb_account cap,
-            # then we don't redirect them, but keep them here and display an error message
-            my $u = LJ::load_user($user);
-            if ($redir_host =~ /$LJ::FB_DOMAIN/ && ! LJ::get_cap($u, 'fb_account')) {
-                return 1 if $want_fail_redirect->("fotobilder_denied");
-
-                $body = LJ::bad_input("Your account type does not allow logins to remote FotoBilder sites");
-                return 1;
-            }
         
             if ($LJ::REDIRECT_ALLOWED{$redir_host} || $redir_host eq $LJ::DOMAIN_WEB) {
                 LJ::run_hook('login_redirect_extra', $redir_host);
diff -r d1cdcb5897f7 -r 81b487a3f369 htdocs/manage/emailpost.bml
--- a/htdocs/manage/emailpost.bml	Sun Jul 26 17:47:31 2009 +0000
+++ b/htdocs/manage/emailpost.bml	Sun Jul 26 18:27:27 2009 +0000
@@ -226,95 +226,6 @@ body<=
             },
         );
 
-        if ( $LJ::FB_SITEROOT && %LJ::FOTOBILDER_IP && LJ::is_enabled('fb_email_docs') ) {
-            $subject = "$ML{'.help.subject_images'}<br /><br />";
-            $body    = $ML{'.help.body_images'};
-            splice @topics, -1, 0,
-            {
-                name  => 'images',
-                title => $ML{'.help.images.header'},
-                url   => '?mode=help&type=images', 
-                subject => 
-                body =>
-                text  => qq{
-                    <?h1 $ML{'.help.images.header'} h1?><br />
-
-                    <?p } . BML::ml('.help.images.text', {'aopts1' => "href='$LJ::FB_SITEROOT'", 'scrapbook' => 'ScrapBook', 'dimensions' => "320x240", 'aopts2' => "href='$LJ::SITEROOT/support/faqbrowse.bml?faqid=75'", 'aopts3' => "href='$LJ::SITEROOT/manage/emailpost.bml?mode=help&amp;type=headers'"}) . qq{ p?><br />
-
-                    <fieldset><legend>$ML{'.help.images.gallery.header'}</legend>
-                    <?p } . BML::ml('.help.images.gallery.text', {'header' => "<b>lj-gallery</b>", 'name' => "LJ_emailpost"}) . qq{ p?>
-                    <?emailex
-                    $to_pin
-                    $from
-                    $subject
-                    <b>lj-gallery:</b> $ML{'.help.images.gallery.example'}<br />
-                    <br />
-                    $body
-                    emailex?></fieldset>
-
-                    <fieldset><legend>$ML{'.help.images.security.header'}</legend>
-                    <?p } . BML::ml('.help.images.security.text1', {'header' => "<b>lj-imgsecurity</b>"}) . qq{ p?>
-                    <?p } . BML::ml('.help.images.security.text2', {'option1' => "private", 'option2' => "regusers", 'option3' => "friends"}) . qq{ p?>
-                    <?emailex
-                    $to_pin
-                    $from
-                    $subject
-                    <b>lj-imgsecurity:</b> private<br />
-                    <br />
-                    $body
-                    emailex?></fieldset>
-
-                    <fieldset><legend>$ML{'.help.images.size.header'}</legend>
-                    <?p } . BML::ml('.help.images.size.text1', {'maxsize' => "640x480", 'defaultsize' => "320x240" , 'header' => "<b>lj-imgsize</b>", 'ljcutsize' => "320x240", 'aopts' => "href='$LJ::SITEROOT/support/faqbrowse.bml?faqid=75'"}) . qq{ p?>
-                    <?p } . BML::ml('.help.images.size.text2', {'size1' => "100x100", 'size2' => "320x240", 'size3' => "640x480"}) . qq{ p?>
-                    <?emailex
-                    $to_pin
-                    $from
-                    $subject
-                    <b>lj-imgsize:</b> 640x480<br />
-                    <br />
-                    $body
-                    emailex?></fieldset>
-
-                    <fieldset><legend>$ML{'.help.images.layout.header'}</legend>
-                    <?p } . BML::ml('.help.images.layout.text1', {'header' => "<b>lj-imglayout</b>"}) . qq{ <br /><br />
-                    $ML{'.help.images.layout.text2'}<br />
-                    <img src='$LJ::IMGPREFIX/imageplaceholder3.png' width='35' height='35'><br />
-                    <img src='$LJ::IMGPREFIX/imageplaceholder3.png' width='35' height='35'><br />
-                    <img src='$LJ::IMGPREFIX/imageplaceholder3.png' width='35' height='35'><br />
-                    <br />
-
-                    } . BML::ml('.help.images.layout.text3', {'horizontal' => "horizontal"}) . qq{ p?>
-                    <span style='white-space: nowrap;'>
-                    <img src='$LJ::IMGPREFIX/imageplaceholder3.png' width='35' height='35'> 
-                    <img src='$LJ::IMGPREFIX/imageplaceholder3.png' width='35' height='35'> 
-                    <img src='$LJ::IMGPREFIX/imageplaceholder3.png' width='35' height='35'>
-                    </span>
-                    <br /><br />
-                    <?emailex
-                    $to_pin
-                    $from
-                    $subject
-                    <b>lj-imglayout:</b> horizontal<br />
-                    <br />
-                    $body
-                    emailex?></fieldset>
-
-                    <fieldset><legend>$ML{'.help.images.ljcut.header'}</legend>
-                    <?p } . BML::ml('.help.images.ljcut.text', {'ljcutsize' => "320x240", 'aopts' => "href='$LJ::SITEROOT/support/faqbrowse.bml?faqid=75'", 'header' => "<b>lj-imgcut</b>", 'count' => "count", 'titles' => "titles"}) . qq{ p?>
-                    <?emailex
-                    $to_pin
-                    $from
-                    $subject
-                    <b>lj-imgcut:</b> titles<br />
-                    <br />
-                    $body
-                    emailex?></fieldset>
-
-                }
-            };
-        }
-
         # index by name, record order
         my %topics_by_name;
         my $ct = 0;
@@ -515,43 +426,6 @@ body<=
                             'off' => $ML{'.settings.entry.comments.select.off'});
     $ret .= "</td></tr>";
 
-    if ($LJ::FB_SITEROOT && %LJ::FOTOBILDER_IP && LJ::get_cap($u, 'fb_account')) {
-        $ret .= "<tr><td colspan='2'>&nbsp;</td></tr>";
-        $ret .= "<tr><td colspan='2'><?h2 $ML{'.settings.image.header'} h2?></td></tr>";
-
-        $ret .= "<tr><td>$ML{'.settings.image.galname'}</td><td>";
-        $ret .= LJ::html_text({ name=> 'emailpost_gallery',
-                    value => $u->{'emailpost_gallery'} || 'LJ_emailpost' });
-        $ret .= "</td></tr>";
-        $ret .= "<tr><td>$ML{'.settings.image.security'}</td><td>";
-        $ret .= LJ::html_select({ name=> 'emailpost_imgsecurity', selected => $u->{'emailpost_imgsecurity'} },
-                            'default' => $ML{'.settings.image.security.select.default'},
-                            'public' => $ML{'.settings.image.security.select.public'},
-                            'regusers' => $ML{'.settings.image.security.select.regusers'},
-                            'friends' => $ML{'.settings.image.security.select.friends'},
-                            'private' => $ML{'.settings.image.security.select.private'});
-        $ret .= "</td></tr>";
-        $ret .= "<tr><td>$ML{'.settings.image.size'}</td><td>";
-        $ret .= LJ::html_select({ name=> 'emailpost_imgsize', selected => $u->{'emailpost_imgsize'} },
-                            'default' => $ML{'.settings.image.size.select.default'},
-                            '100x100' => $ML{'.settings.image.size.select.100x100'},
-                            '320x240' => $ML{'.settings.image.size.select.320x240'},
-                            '640x480' => $ML{'.settings.image.size.select.640x480'});
-        $ret .= "</td></tr>";
-        $ret .= "<tr><td>$ML{'.settings.image.layout'}</td><td>";
-        $ret .= LJ::html_select({ name=> 'emailpost_imglayout', selected => $u->{'emailpost_imglayout'} },
-                            'default' => $ML{'.settings.image.layout.select.default'},
-                            'horizontal' => $ML{'.settings.image.layout.select.horizontal'},
-                            'vertical' => $ML{'.settings.image.layout.select.vertical'});
-        $ret .= "</td></tr>";
-        $ret .= "<tr><td>$ML{'.settings.image.cut'}</td><td>";
-        $ret .= LJ::html_select({ name=> 'emailpost_imgcut', selected => $u->{'emailpost_imgcut'} },
-                            'default' => $ML{'.settings.image.cut.select.default'},
-                            'count' => $ML{'.settings.image.cut.select.count'},
-                            'titles' => $ML{'.settings.image.cut.select.titles'});
-        $ret .= "</td></tr>";
-    }
-
     $ret .= "</table>";
     $ret .= '</div><br />';
 
diff -r d1cdcb5897f7 -r 81b487a3f369 htdocs/userinfo.bml.text
--- a/htdocs/userinfo.bml.text	Sun Jul 26 17:47:31 2009 +0000
+++ b/htdocs/userinfo.bml.text	Sun Jul 26 18:27:27 2009 +0000
@@ -90,10 +90,6 @@
 
 .details.flag.self=Set this journal as mature/adult.
 
-.details.fotobilder=[[num]] files in <a [[aopts]]>FotoBilder</a>
-
-.details.fotobilder2=[[num]] <a [[aopts]]>FotoBilder Files</a>
-
 .details.id=LJ User No.: [[id]]
 
 .details.joined=Joined: [[createdate]]
@@ -137,10 +133,6 @@
 .error.deleted.purgenotification=If you're interested in renaming your account to this username, <a [[aopts]]>set up your notifications</a> to be notified when the account is purged.
 
 .error.malfname=Malformed username.
-
-.fbpictures.lessthan=less than [[count]] public
-
-.fbpictures.over=over [[count]] public
 
 .feeds.header=Feeds
 
@@ -207,8 +199,6 @@
 .label.dateupdated=Date updated:
 
 .label.email=Email:
-
-.label.fbpictures=Pictures:
 
 .label.frcommunity=Communities
 
--------------------------------------------------------------------------------