Don't allow previous participant to join if locked

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

@ -425,16 +425,13 @@ 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('/');
$url .= ($url =~ m/\/$/) ? '' : '/'; $url .= ($url =~ m/\/$/) ? '' : '/';

Loading…
Cancel
Save