add ability to disable guest access

This commit is contained in:
Josh
2017-07-12 16:34:16 -04:00
parent 0cbb587fc0
commit 3a882f85c6
4 changed files with 36 additions and 14 deletions

View File

@ -18,19 +18,24 @@ class LandingController < ApplicationController
include BbbApi
def index
redirect_to user_login_path if Rails.configuration.disable_guest_access
end
def resource
if params[:id].size > meeting_name_limit
redirect_to root_url, flash: {danger: t('meeting_name_long')}
elsif ['&', '$', ','].any? { |c| params[:id].include?(c) } # temporary fix for misbehaving characters
redirect_to root_url, flash: {danger: t('disallowed_characters_msg')}
elsif params[:resource] == 'meetings' && !params[:room_id]
render_meeting
elsif params[:resource] == 'rooms'
render_room
if Rails.configuration.disable_guest_access && params[:resource] == 'meetings'
redirect_to user_login_path
else
redirect_to root_url, flash: {danger: t('error')}
if params[:id].size > meeting_name_limit
redirect_to root_url, flash: {danger: t('meeting_name_long')}
elsif ['&', '$', ','].any? { |c| params[:id].include?(c) } # temporary fix for misbehaving characters
redirect_to root_url, flash: {danger: t('disallowed_characters_msg')}
elsif params[:resource] == 'meetings' && !params[:room_id]
render_meeting
elsif params[:resource] == 'rooms'
render_room
else
redirect_to root_url, flash: {danger: t('error')}
end
end
end