Don't allow previous participant to join if locked

master
Daniel Berteaud 11 years ago
parent 76ae8e18ea
commit a15e6d7199
  1. 13
      public/vroom.pl

@ -425,15 +425,12 @@ get '/(*room)' => sub {
room => $room room => $room
); );
} }
my @participants = $self->get_participants($room);
if ($data->{'locked'} && (!$self->session($room) || $self->session($room)->{role} ne 'owner')){ if ($data->{'locked'} && (!$self->session($room) || $self->session($room)->{role} ne 'owner')){
unless (($self->session('name') eq $data->{'owner'}) || (grep { $_ eq $self->session('name') } @participants )){ return $self->render('error',
return $self->render('error', msg => sprintf($self->l("ERROR_ROOM_s_LOCKED"), $room),
msg => sprintf($self->l("ERROR_ROOM_s_LOCKED"), $room), err => 'ERROR_ROOM_s_LOCKED',
err => 'ERROR_ROOM_s_LOCKED', room => $room
room => $room );
);
}
} }
if ($data->{join_password} && (!$self->session($room) || $self->session($room)->{role} !~ m/^participant|owner$/)){ if ($data->{join_password} && (!$self->session($room) || $self->session($room)->{role} !~ m/^participant|owner$/)){
my $url = $self->url_for('/'); my $url = $self->url_for('/');

Loading…
Cancel
Save