add guest landing page when guest access disabled

This commit is contained in:
Josh
2017-07-13 12:11:16 -04:00
parent ec16f51926
commit ab5c56c27d
6 changed files with 76 additions and 19 deletions

View File

@ -18,12 +18,13 @@ class LandingController < ApplicationController
include BbbApi
def index
redirect_to user_login_path if Rails.configuration.disable_guest_access
# If guest access is disabled, redirect the user to the guest landing and force login.
redirect_to guest_path if Rails.configuration.disable_guest_access
end
def resource
if Rails.configuration.disable_guest_access && params[:resource] == 'meetings'
redirect_to user_login_path
redirect_to guest_path
else
if params[:id].size > meeting_name_limit
redirect_to root_url, flash: {danger: t('meeting_name_long')}
@ -38,6 +39,11 @@ class LandingController < ApplicationController
end
end
end
def guest
# If someone tries to aceess the guest landing when guest access is enabled, just send them to root.
redirect_to root_url unless Rails.configuration.disable_guest_access
end
def send_meetings_data
render json: {active: bbb.get_meetings, waiting: WaitingList.waiting}