Committer: henrylyneLJSV-422: Prevent suspended users from adding friends.
U trunk/cgi-bin/LJ/User.pm
U trunk/cgi-bin/ljprotocol.pl
Modified: trunk/cgi-bin/LJ/User.pm
===================================================================
--- trunk/cgi-bin/LJ/User.pm 2008-10-10 18:03:41 UTC (rev 14387)
+++ trunk/cgi-bin/LJ/User.pm 2008-10-10 19:05:36 UTC (rev 14388)
@@ -4278,6 +4278,11 @@
sub can_add_friends {
my ($u, $err, $opts) = @_;
+ if ($u->is_suspended) {
+ $$err = "Suspended journals cannot add friends.";
+ return 0;
+ }
+
# have they reached their friend limit?
my $fr_count = $opts->{'numfriends'} || $u->friend_uids;
my $maxfriends = $u->get_cap('maxfriends');
Modified: trunk/cgi-bin/ljprotocol.pl
===================================================================
--- trunk/cgi-bin/ljprotocol.pl 2008-10-10 18:03:41 UTC (rev 14387)
+++ trunk/cgi-bin/ljprotocol.pl 2008-10-10 19:05:36 UTC (rev 14388)
@@ -2224,6 +2224,10 @@
$u->{'journaltype'} eq 'I' ||
($u->{'journaltype'} eq "Y" && $u->password));
+ # Don't let suspended users add friend
+ return $fail->(305, "Suspended journals cannot add friends.")
+ if ($u->is_suspended);
+
my $sclient = LJ::theschwartz();
# perform the adds