From 9364ff66d852562e95c02e17d932b0a3fa5fb1a9 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Mon, 12 May 2014 23:21:06 +0200 Subject: [PATCH] Fix password prompt when you're the owner Also fix a typo --- public/vroom.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/vroom.pl b/public/vroom.pl index e250e0c..e6a02e3 100755 --- a/public/vroom.pl +++ b/public/vroom.pl @@ -404,13 +404,13 @@ get '/(*room)' => sub { ); } } - if ($data->{join_password} && (!$self->session($room) || $self->session($room)->{role} ne 'participant')){ + if ($data->{join_password} && (!$self->session($room) || $self->session($room)->{role} !~ m/^participant|owner$/)){ my $url = $self->url_for('/'); $url .= ($url =~ m/\/$/) ? '' : '/'; return $self->redirect_to($url . 'password/' . $room); } # Set this peer as a simple participant if he has no role yet - $self->session($room => {role => 'participant'}) if (!$self->session($room) || !self->session($room)->{role}); + $self->session($room => {role => 'participant'}) if (!$self->session($room) || !$self->session($room)->{role}); $self->cookie(vroomsession => encode_base64($self->session('name') . ':' . $data->{name} . ':' . $data->{token}, ''), {expires => time + 60}); # Add this user to the participants table unless($self->add_participant($room,$self->session('name'))){