|
|
@ -1547,8 +1547,10 @@ any '/api' => sub { |
|
|
|
return $self->render( |
|
|
|
return $self->render( |
|
|
|
json => { |
|
|
|
json => { |
|
|
|
msg => $self->l('ERROR_OCCURRED'), |
|
|
|
msg => $self->l('ERROR_OCCURRED'), |
|
|
|
|
|
|
|
err => 'ERROR_OCCURRED', |
|
|
|
status => 'error' |
|
|
|
status => 'error' |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
status => 503 |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
# Add or remove an email address to the list of email notifications |
|
|
|
# Add or remove an email address to the list of email notifications |
|
|
@ -1559,8 +1561,10 @@ any '/api' => sub { |
|
|
|
return $self->render( |
|
|
|
return $self->render( |
|
|
|
json => { |
|
|
|
json => { |
|
|
|
msg => $self->l('ERROR_MAIL_INVALID'), |
|
|
|
msg => $self->l('ERROR_MAIL_INVALID'), |
|
|
|
|
|
|
|
err => 'ERROR_MAIL_INVALID', |
|
|
|
status => 'error' |
|
|
|
status => 'error' |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
status => 400 |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
elsif ($set eq 'on' && $self->add_notification($room->{name},$email)){ |
|
|
|
elsif ($set eq 'on' && $self->add_notification($room->{name},$email)){ |
|
|
@ -1582,8 +1586,10 @@ any '/api' => sub { |
|
|
|
return $self->render( |
|
|
|
return $self->render( |
|
|
|
json => { |
|
|
|
json => { |
|
|
|
msg => $self->l('ERROR_OCCURRED'), |
|
|
|
msg => $self->l('ERROR_OCCURRED'), |
|
|
|
|
|
|
|
err => 'ERROR_OCCURRED', |
|
|
|
status => 'error' |
|
|
|
status => 'error' |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
status => 503 |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
elsif ($req->{action} eq 'authenticate'){ |
|
|
|
elsif ($req->{action} eq 'authenticate'){ |
|
|
@ -1608,16 +1614,20 @@ any '/api' => sub { |
|
|
|
return $self->render( |
|
|
|
return $self->render( |
|
|
|
json => { |
|
|
|
json => { |
|
|
|
status => 'error', |
|
|
|
status => 'error', |
|
|
|
msg => $self->l('WRONG_PASSWORD') |
|
|
|
msg => $self->l('WRONG_PASSWORD'), |
|
|
|
} |
|
|
|
err => 'WRONG_PASSWORD' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
status => 401 |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
# There's no owner password, so you cannot auth |
|
|
|
# There's no owner password, so you cannot auth |
|
|
|
return $self->render( |
|
|
|
return $self->render( |
|
|
|
json => { |
|
|
|
json => { |
|
|
|
msg => $self->l('NOT_ALLOWED'), |
|
|
|
msg => $self->l('NOT_ALLOWED'), |
|
|
|
|
|
|
|
err => 'NOT_ALLOWED', |
|
|
|
status => 'error' |
|
|
|
status => 'error' |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
status => 403 |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
# Return just room config |
|
|
|
# Return just room config |
|
|
|