From 15c3980792aabca6e3f0eff29dd25e0dfb99f3ec Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Wed, 18 Mar 2015 17:41:46 +0100 Subject: [PATCH] Don't send notified emails to non owner --- public/js/vroom.js | 1 + vroom.pl | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/public/js/vroom.js b/public/js/vroom.js index e160f43..0eef2d8 100644 --- a/public/js/vroom.js +++ b/public/js/vroom.js @@ -784,6 +784,7 @@ function initVroom(room) { success: function(data){ if (id === peers.local.id){ if (data.role != peers.local.role){ + getRoomInfo(); webrtc.sendToAll('role_change', {}); } peers.local.role = data.role; diff --git a/vroom.pl b/vroom.pl index 50df808..c4a8e1a 100755 --- a/vroom.pl +++ b/vroom.pl @@ -1837,8 +1837,9 @@ any '/api' => sub { # Return just room config elsif ($req->{action} eq 'get_room_conf'){ my $resp = $self->get_room_conf($room); - my $role = $self->get_key_role($token,$room); - if (!$role || $role !~ m/admin|owner$/){ + my $role = $self->get_key_role($token,$room->{name}); + if (!$role || $role !~ m/^admin|owner$/){ + $self->app->log->debug("API Key $token is not admin, nor owner of room " . $room->{name} . ", blanking out sensible data"); $resp->{notif} = {}; } return $self->render(