|
|
@ -428,7 +428,7 @@ post '/action' => sub { |
|
|
|
my $self = shift; |
|
|
|
my $self = shift; |
|
|
|
my $action = $self->param('action'); |
|
|
|
my $action = $self->param('action'); |
|
|
|
my $room = $self->param('room') || ""; |
|
|
|
my $room = $self->param('room') || ""; |
|
|
|
if (!$self->session('name') || !$self->has_joined($self->session('name'), $room)){ |
|
|
|
if (!$self->session('name') || !$self->has_joined($self->session('name'), $room) || !$self->session($room) || !$self->session($room)->{role}){ |
|
|
|
return $self->render( |
|
|
|
return $self->render( |
|
|
|
json => { |
|
|
|
json => { |
|
|
|
msg => $self->l('ERROR_NOT_LOGGED_IN'), |
|
|
|
msg => $self->l('ERROR_NOT_LOGGED_IN'), |
|
|
@ -519,6 +519,14 @@ post '/action' => sub { |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
elsif ($action eq 'getRole'){ |
|
|
|
|
|
|
|
return $self->render( |
|
|
|
|
|
|
|
json => { |
|
|
|
|
|
|
|
msg => $self->session($room)->{role}, |
|
|
|
|
|
|
|
status => 'success' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
# Not found (404) |
|
|
|
# Not found (404) |
|
|
|