changelog_bot (changelog_bot) wrote in changelog,
changelog_bot
changelog_bot
changelog

[livejournal] r14778: LJSUP-3069: Find you Friends page - remo...

Committer: ssafronova
LJSUP-3069: Find you Friends page - removed deleted, suspended and expunged users from search result

U   trunk/htdocs/tools/endpoints/multisearch.bml
Modified: trunk/htdocs/tools/endpoints/multisearch.bml
===================================================================
--- trunk/htdocs/tools/endpoints/multisearch.bml	2009-01-19 10:31:42 UTC (rev 14777)
+++ trunk/htdocs/tools/endpoints/multisearch.bml	2009-01-19 11:37:58 UTC (rev 14778)
@@ -31,6 +31,8 @@
 
         if ($user) {
             if (my $u = LJ::load_user($user)) {
+                return JSON::objToJson({error => "There is no such user.",})
+                    if $u->is_deleted or $u->is_suspended or $u->is_expunged;
                 if ($what eq "pics") {
                     $url = "$LJ::SITEROOT/allpics.bml?user=$user";
                 } elsif ($output eq "foaf") {
@@ -79,6 +81,7 @@
             $uid = $uid->[0]; # dereference
             if (my $u = LJ::load_userid($uid)) {
                 next unless $u->is_validated;
+                next if $u->is_deleted or $u->is_suspended or $u->is_expunged;
                 next unless $u->opt_findbyemail =~ /Y/; # The user has allowed to search for it by email
                 if ($output eq "foaf") {
                     $ret{result} .= '<a href="' . LJ::journal_base($u) . '/data/foaf">' . $u->{user}. '</a>';
@@ -103,7 +106,8 @@
         my @uids = LJ::Directory::Constraint::ContactInfo->new(screenname => $q)->matching_uids;
 
         my $us = LJ::load_userids(@uids);
-        my @us = grep { $_->opt_findbyemail =~ /Y/ and $_->opt_showcontact =~ /Y|R/ } values %$us;
+        my @us = grep { not ($_->is_deleted or $_->is_suspended or $_->is_expunged) 
+                        and $_->opt_findbyemail =~ /Y/ and $_->opt_showcontact =~ /Y|R/ } values %$us;
 
         if (@us == 1) {
             my $u = shift @us;

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