From 4f79e4b1564a431fb7590eb18e1db979fc4c8026 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Thu, 22 May 2014 10:23:26 +0200 Subject: [PATCH] Make invite menu owner reserved Simple participants should have access to this --- public/vroom.pl | 5 ++- templates/default/join.html.ep | 70 +++++++++++++++++++++--------------------- 2 files changed, 39 insertions(+), 36 deletions(-) diff --git a/public/vroom.pl b/public/vroom.pl index 0d25439..9886a4b 100755 --- a/public/vroom.pl +++ b/public/vroom.pl @@ -656,7 +656,10 @@ post '/action' => sub { my $message = $self->param('message'); my $status = 'error'; my $msg = $self->l('ERROR_OCCURED'); - if ($rcpt !~ m/\S+@\S+\.\S+$/){ + if (!$self->session($room) || $self->session($room)->{role} ne 'owner'){ + $msg = 'NOT_ALLOWED'; + } + elsif ($rcpt !~ m/\S+@\S+\.\S+$/){ $msg = $self->l('ERROR_MAIL_INVALID'); } elsif ($self->email( diff --git a/templates/default/join.html.ep b/templates/default/join.html.ep index 1c4462f..85776e9 100644 --- a/templates/default/join.html.ep +++ b/templates/default/join.html.ep @@ -12,8 +12,42 @@