Fix circular ref on Chrome when submitting room conf form

master
Daniel Berteaud 10 years ago
parent dfda2f03f4
commit e089583745
  1. 5
      public/js/vroom.js
  2. 12
      vroom.pl

@ -286,7 +286,8 @@ $('#configureRoomForm').submit(function(e){
$('#joinPass').val() : false,
ownerPass = ($('#ownerPassSet').bootstrapSwitch('state')) ?
$('#ownerPass').val() : false,
persistent = $('#persistentSet').bootstrapSwitch('state'),
persist = ($('#persistentSet').length > 0) ?
$('#persistentSet').bootstrapSwitch('state') : '',
emails = [];
$('input[name="emails[]"]').each(function(){
emails.push($(this).val());
@ -301,7 +302,7 @@ $('#configureRoomForm').submit(function(e){
ask_for_name: askForName,
join_password: joinPass,
owner_password: ownerPass,
persistent: persistent,
persistent: persist,
emails: emails
}
})

@ -1300,14 +1300,6 @@ any '/api' => sub {
}
# Ok, now, we don't have to bother with authorization anymore
if ($req->{action} eq 'invite_email'){
#if (!$req->{param}->{rcpts}){
# return $self->render(
# json => {
# status => 'error',
# msg => $self->l('ERROR_MAIL_INVALID')
# }
# );
#}
my $rcpts = $req->{param}->{rcpts};
foreach my $addr (@$rcpts){
if (!$self->valid_email($addr) && $addr ne ''){
@ -1407,8 +1399,8 @@ any '/api' => sub {
$room->{locked} = ($req->{param}->{locked}) ? '1' : '0';
$room->{ask_for_name} = ($req->{param}->{ask_for_name}) ? '1' : '0';
# Room persistence can only be set by admins
if ($self->key_can_do_this(token => $token, action => 'set_persistent')){
$room->{persistent} = ($req->{param}->{persistent}) ? '1' : '0';
if ($self->key_can_do_this(token => $token, action => 'set_persistent') && $req->{param}->{persistent} ne ''){
$room->{persistent} = ($req->{param}->{persistent} eq Mojo::JSON->true) ? '1' : '0';
}
foreach my $pass (qw/join_password owner_password/){
if ($req->{param}->{$pass} eq Mojo::JSON->false){

Loading…
Cancel
Save