From 240a0d2aa036843cd935bb25da919a527d7c578b Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Mon, 12 May 2014 23:03:48 +0200 Subject: [PATCH] Set default role to participant --- public/vroom.pl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/public/vroom.pl b/public/vroom.pl index be14adc..3e89741 100755 --- a/public/vroom.pl +++ b/public/vroom.pl @@ -409,6 +409,8 @@ get '/(*room)' => sub { $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->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'))){