diff --git a/app/assets/javascripts/admins.js b/app/assets/javascripts/admins.js
index d59c3e79..0dff33ee 100644
--- a/app/assets/javascripts/admins.js
+++ b/app/assets/javascripts/admins.js
@@ -106,11 +106,6 @@ function changeBrandingImage(path) {
$.post(path, {url: url})
}
-// Change whether or not user have to be signed in to join a room
-function changeRoomAuthentication(checked, path) {
- $.post(path, {authenticationRequired: checked})
-}
-
// Filters by role
function filterRole(role) {
search = new URL(location.href).searchParams.get('search')
diff --git a/app/controllers/admins_controller.rb b/app/controllers/admins_controller.rb
index fcbe4af2..d323db7d 100644
--- a/app/controllers/admins_controller.rb
+++ b/app/controllers/admins_controller.rb
@@ -131,9 +131,9 @@ class AdminsController < ApplicationController
redirect_to admins_path
end
- # POST /admins/meetingAuthentication
+ # POST /admins/room_authentication
def room_authentication
- @settings.update_value("Room Authentication", params[:authenticationRequired])
+ @settings.update_value("Room Authentication", params[:value])
redirect_to admins_path
end
diff --git a/app/controllers/concerns/themer.rb b/app/controllers/concerns/themer.rb
index 45e5a615..97eb6b80 100644
--- a/app/controllers/concerns/themer.rb
+++ b/app/controllers/concerns/themer.rb
@@ -17,31 +17,31 @@
# with BigBlueButton; if not, see .
module Themer
-extend ActiveSupport::Concern
+ extend ActiveSupport::Concern
-# Lightens a color by 40%
-def color_lighten(color)
- # Uses the built in Sass Engine to lighten the color
+ # Lightens a color by 40%
+ def color_lighten(color)
+ # Uses the built in Sass Engine to lighten the color
- dummy_scss = "h1 { color: $lighten; }"
- compiled = Sass::Engine.new("$lighten:lighten(#{color}, 40%);" + dummy_scss, syntax: :scss).render
+ dummy_scss = "h1 { color: $lighten; }"
+ compiled = Sass::Engine.new("$lighten:lighten(#{color}, 40%);" + dummy_scss, syntax: :scss).render
- string_locater = 'color: '
- color_start = compiled.index(string_locater) + string_locater.length
+ string_locater = 'color: '
+ color_start = compiled.index(string_locater) + string_locater.length
- compiled[color_start..color_start + 6]
-end
-
-# Darkens a color by 10%
-def color_darken(color)
- # Uses the built in Sass Engine to darken the color
-
- dummy_scss = "h1 { color: $darken; }"
- compiled = Sass::Engine.new("$darken:darken(#{color}, 10%);" + dummy_scss, syntax: :scss).render
-
- string_locater = 'color: '
- color_start = compiled.index(string_locater) + string_locater.length
-
- compiled[color_start..color_start + 6]
-end
+ compiled[color_start..color_start + 6]
+ end
+
+ # Darkens a color by 10%
+ def color_darken(color)
+ # Uses the built in Sass Engine to darken the color
+
+ dummy_scss = "h1 { color: $darken; }"
+ compiled = Sass::Engine.new("$darken:darken(#{color}, 10%);" + dummy_scss, syntax: :scss).render
+
+ string_locater = 'color: '
+ color_start = compiled.index(string_locater) + string_locater.length
+
+ compiled[color_start..color_start + 6]
+ end
end
diff --git a/app/controllers/rooms_controller.rb b/app/controllers/rooms_controller.rb
index cbec3aec..b96166da 100644
--- a/app/controllers/rooms_controller.rb
+++ b/app/controllers/rooms_controller.rb
@@ -98,8 +98,8 @@ class RoomsController < ApplicationController
# POST /:room_uid
def join
- # If this setting is turned on only authenticated users are allowed to join rooms
- room_authentication_required
+ return redirect_to root_path,
+ flash: { alert: I18n.t("administrator.site_settings.authentication.user-info") } if auth_required
opts = default_meeting_options
unless @room.owned_by?(current_user)
@@ -275,11 +275,8 @@ class RoomsController < ApplicationController
redirect_to admins_path if current_user && current_user&.has_role?(:super_admin)
end
- def room_authentication_required
- if Setting.find_or_create_by!(provider: user_settings_provider).get_value("Room Authentication") == "true" &&
- current_user.nil?
- flash[:alert] = I18n.t("administrator.site_settings.authentication.user-info")
- redirect_to signin_path
- end
+ def auth_required
+ Setting.find_or_create_by!(provider: user_settings_provider).get_value("Room Authentication") == "true" &&
+ current_user.nil?
end
end
diff --git a/app/helpers/admins_helper.rb b/app/helpers/admins_helper.rb
index e4065285..ab430e71 100644
--- a/app/helpers/admins_helper.rb
+++ b/app/helpers/admins_helper.rb
@@ -35,8 +35,12 @@ module AdminsHelper
registration_method == Rails.configuration.registration_methods[:approval]
end
- def room_authentication_required
- Setting.find_or_create_by!(provider: user_settings_provider).get_value("Room Authentication") == "true"
+ def room_authentication_string
+ if Setting.find_or_create_by!(provider: user_settings_provider).get_value("Room Authentication") == "true"
+ I18n.t("administrator.site_settings.authentication.enabled")
+ else
+ I18n.t("administrator.site_settings.authentication.disabled")
+ end
end
def registration_method_string
diff --git a/app/helpers/rooms_helper.rb b/app/helpers/rooms_helper.rb
index a1991872..e355a8e5 100644
--- a/app/helpers/rooms_helper.rb
+++ b/app/helpers/rooms_helper.rb
@@ -22,4 +22,9 @@ module RoomsHelper
def google_calendar_path
"http://calendar.google.com/calendar/r/eventedit?text=#{@room.name}&location=#{request.base_url + request.fullpath}"
end
+
+ def room_authentication_required
+ Setting.find_or_create_by!(provider: user_settings_provider).get_value("Room Authentication") == "true" &&
+ current_user.nil?
+ end
end
diff --git a/app/views/rooms/join.html.erb b/app/views/rooms/join.html.erb
index dd8cea98..5e718e15 100644
--- a/app/views/rooms/join.html.erb
+++ b/app/views/rooms/join.html.erb
@@ -14,7 +14,7 @@
%>
<%= render 'shared/room_event' do %>
- <% if room_authentication_required && current_user.nil? %>
+ <% if room_authentication_required %>
<%= t("administrator.site_settings.authentication.user-info") %>
<% else %>
<%= form_for room_path(@room), method: :post do |f| %>
diff --git a/app/views/shared/admin_settings/_site_settings.html.erb b/app/views/shared/admin_settings/_site_settings.html.erb
index 59f5d6b7..62d124f1 100644
--- a/app/views/shared/admin_settings/_site_settings.html.erb
+++ b/app/views/shared/admin_settings/_site_settings.html.erb
@@ -16,7 +16,7 @@