diff --git a/app/assets/javascripts/meeting.coffee b/app/assets/javascripts/meeting.coffee index 4e678031..c79ea908 100644 --- a/app/assets/javascripts/meeting.coffee +++ b/app/assets/javascripts/meeting.coffee @@ -26,8 +26,7 @@ class @Meeting if _meetingInstance return _meetingInstance meetingId = $(".page-wrapper").data('id') - if (type = location.pathname.split('/')[1]) != 'rooms' - type = 'meetings' + type = $("body").data('resource') name = $('.meeting-user-name').val() adminId = $(".page-wrapper").data('admin-id') _meetingInstance = new Meeting(meetingId, type, name, adminId) @@ -42,12 +41,14 @@ class @Meeting fullId = encodeURIComponent(adminId) + '/' + encodeURIComponent(meetingId) else fullId = encodeURIComponent(meetingId) - return @buildFullDomainURL() + '/' + type + '/' + fullId + return @buildRootURL() + '/' + type + '/' + fullId - @buildFullDomainURL: -> + @buildRootURL: -> url = location.protocol + '//' + location.hostname if location.port url += ':' + location.port + if GreenLight.relative_root + url += GreenLight.relative_root return url # Sends the end meeting request diff --git a/app/assets/javascripts/recordings.coffee b/app/assets/javascripts/recordings.coffee index d984c848..24c8814c 100644 --- a/app/assets/javascripts/recordings.coffee +++ b/app/assets/javascripts/recordings.coffee @@ -238,7 +238,7 @@ class @Recordings getRecordingsURL: -> if $(".page-wrapper.rooms").data('main-room') - base_url = '/rooms/'+Meeting.getInstance().getAdminId() + base_url = Meeting.buildRootURL()+'/'+$('body').data('resource')+'/'+Meeting.getInstance().getAdminId() else base_url = $('.meeting-url').val() base_url+'/recordings' diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index a3384de6..6c43a367 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -29,4 +29,9 @@ class ApplicationController < ActionController::Base @current_user ||= User.find_by(id: session[:user_id]) end helper_method :current_user + + def relative_root + Rails.configuration.relative_url_root || "" + end + helper_method :relative_root end diff --git a/app/controllers/bbb_controller.rb b/app/controllers/bbb_controller.rb index bff60339..7f8b3858 100644 --- a/app/controllers/bbb_controller.rb +++ b/app/controllers/bbb_controller.rb @@ -66,7 +66,7 @@ class BbbController < ApplicationController } end - base_url = "#{request.base_url}/#{params[:resource]}/#{meeting_path}" + base_url = "#{request.base_url}#{relative_root}/#{params[:resource]}/#{meeting_path}" options[:meeting_logout_url] = base_url options[:hook_url] = "#{base_url}/callback" diff --git a/app/controllers/landing_controller.rb b/app/controllers/landing_controller.rb index d6e63224..b8da6142 100644 --- a/app/controllers/landing_controller.rb +++ b/app/controllers/landing_controller.rb @@ -72,7 +72,9 @@ class LandingController < ApplicationController return end - @meeting_id = params[:id] + if @user.encrypted_id != params[:id] + @meeting_id = params[:id] + end @meeting_running = bbb_get_meeting_info("#{@user.encrypted_id}-#{@meeting_id}")[:returncode] @main_room = @meeting_id.blank? || @meeting_id == @user.encrypted_id diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index bacfc69a..2e15f26e 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -43,6 +43,10 @@ module ApplicationHelper end end + def omniauth_login_url(provider) + "#{relative_root}/auth/#{provider}" + end + # Whether the current page is the page of a room/meeting or not def on_room_or_meeting_page? params[:id].present? diff --git a/app/models/user.rb b/app/models/user.rb index 01a16ce4..f9a27a8d 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -44,7 +44,7 @@ class User < ApplicationRecord end def room_url - "/rooms/#{encrypted_id}" + "#{Rails.configuration.relative_url_root}/rooms/#{encrypted_id}" end def set_encrypted_id diff --git a/app/views/landing/_rooms_center_panel.html.erb b/app/views/landing/_rooms_center_panel.html.erb index 5cb7de7b..39b6618a 100644 --- a/app/views/landing/_rooms_center_panel.html.erb +++ b/app/views/landing/_rooms_center_panel.html.erb @@ -38,7 +38,7 @@ <% else %>