diff --git a/lib/Vroom/I18N/en.pm b/lib/Vroom/I18N/en.pm index 99107d4..55e35bd 100644 --- a/lib/Vroom/I18N/en.pm +++ b/lib/Vroom/I18N/en.pm @@ -84,6 +84,7 @@ our %Lexicon = ( "PASSWORD_REQUIRED" => "Password required", "A_PASSWORD_IS_NEEDED_TO_JOIN" => "You must provide a password to join this room", "TRY_AGAIN" => "Try again", + "AUTH_IF_OWNER" => "Authenticate if you are the room owner", "LOGOUT" => "Leave the room", "SET_YOUR_NAME_TO_CHAT" => "You need to set your name to be able to chat", "SEND_MESSAGE" => "Send the message", diff --git a/lib/Vroom/I18N/fr.pm b/lib/Vroom/I18N/fr.pm index 255f85f..e2a43f8 100644 --- a/lib/Vroom/I18N/fr.pm +++ b/lib/Vroom/I18N/fr.pm @@ -90,6 +90,7 @@ our %Lexicon = ( "PASSWORD_REQUIRED" => "Mot de passe requis", "A_PASSWORD_IS_NEEDED_TO_JOIN" => "Vous devez saisir un mot de passe pour rejoindre ce salon", "TRY_AGAIN" => "Essayer à nouveau", + "AUTH_IF_OWNER" => "Authentifiez-vous si vous êtes le propriétaire du salon", "LOGOUT" => "Quitter le salon", "SET_YOUR_NAME_TO_CHAT" => "Vous devez saisir votre nom avant de pouvoir tchater", "SEND_MESSAGE" => "Envoyer le message", diff --git a/public/vroom.pl b/public/vroom.pl index 23343a8..dff1ff1 100755 --- a/public/vroom.pl +++ b/public/vroom.pl @@ -426,7 +426,7 @@ get '/(*room)' => sub { ); } my @participants = $self->get_participants($room); - if ($data->{'locked'}){ + 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', msg => sprintf($self->l("ERROR_ROOM_s_LOCKED"), $room), diff --git a/templates/default/error.html.ep b/templates/default/error.html.ep index 846e73b..cda6788 100644 --- a/templates/default/error.html.ep +++ b/templates/default/error.html.ep @@ -11,6 +11,8 @@ <%=l 'JOIN_THIS_ROOM' %> <% } elsif ($err eq 'WRONG_PASSWORD'){ %> <%=l 'TRY_AGAIN' %> + <% } elsif ($err eq 'ERROR_ROOM_s_LOCKED'){ %> + <%=l 'AUTH_IF_OWNER' %> <% } %>