frank: www_addFriendSave now has the same checks as www_addFriend
This commit is contained in:
parent
5cdcf892bf
commit
a792038f95
1 changed files with 7 additions and 2 deletions
|
|
@ -84,7 +84,7 @@ sub www_addFriend {
|
|||
),
|
||||
WebGUI::Form::hidden($session,
|
||||
{
|
||||
name => 'friendId',
|
||||
name => 'userId',
|
||||
value => $friendId,
|
||||
}
|
||||
),
|
||||
|
|
@ -123,10 +123,15 @@ sub www_addFriendSave {
|
|||
my $session = shift;
|
||||
return $session->privilege->insufficient() unless ($session->user->isRegistered);
|
||||
|
||||
my $friendId = $session->form->get('friendId');
|
||||
my $friendId = $session->form->get('userId');
|
||||
my $protoFriend = WebGUI::User->new($session, $friendId);
|
||||
my $i18n = WebGUI::International->new($session, 'Friends');
|
||||
|
||||
my $friends = WebGUI::Friends->new($session);
|
||||
if($friends->isFriend($friendId) || $friends->isInvited($friendId)) {
|
||||
return www_addFriend($session);
|
||||
}
|
||||
|
||||
# Check for non-existant user id.
|
||||
if ((!$protoFriend->username) || (!$protoFriend->profileField('ableToBeFriend'))) {
|
||||
my $output = sprintf qq!<h1>%s</h1>\n<p>%s</p><a href="%s">%s</a>!,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue