forked from External/greenlight
add ability to disable guest access
This commit is contained in:
@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user