From 8f59f846be9964debb748097539b87d0b3f7f7bb Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Sun, 26 Jul 2015 19:47:36 +0200 Subject: [PATCH] Check for too comon room name in update_room_conf --- vroom.pl | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/vroom.pl b/vroom.pl index b89be9b..9d9f1e9 100755 --- a/vroom.pl +++ b/vroom.pl @@ -1894,6 +1894,17 @@ any '/api' => sub { } # Update room configuration elsif ($req->{action} eq 'update_room_conf'){ + # Cannot set an owner pass for some rooms + if ($req->{param}->{owner_password} && + grep { $_ eq $room->{name} } (split /[,;]/, $config->{'rooms.common_names'})){ + return $self->render( + json => { + msg => $self->l('ERROR_COMMON_ROOM_NAME'), + err => 'ERROR_COMMON_ROOM_NAME' + }, + status => 406 + ); + } $room->{locked} = ($req->{param}->{locked}) ? '1' : '0'; $room->{ask_for_name} = ($req->{param}->{ask_for_name}) ? '1' : '0'; $room->{max_members} = $req->{param}->{max_members};