1
|
|
|
# frozen_string_literal: true |
2
|
|
|
|
3
|
|
|
# BigBlueButton open source conferencing system - http://www.bigbluebutton.org/. |
4
|
|
|
# |
5
|
|
|
# Copyright (c) 2018 BigBlueButton Inc. and by respective authors (see below). |
6
|
|
|
# |
7
|
|
|
# This program is free software; you can redistribute it and/or modify it under the |
8
|
|
|
# terms of the GNU Lesser General Public License as published by the Free Software |
9
|
|
|
# Foundation; either version 3.0 of the License, or (at your option) any later |
10
|
|
|
# version. |
11
|
|
|
# |
12
|
|
|
# BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY |
13
|
|
|
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A |
14
|
|
|
# PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. |
15
|
|
|
# |
16
|
|
|
# You should have received a copy of the GNU Lesser General Public License along |
17
|
|
|
# with BigBlueButton; if not, see <http://www.gnu.org/licenses/>. |
18
|
|
|
|
19
|
|
|
module AdminsHelper |
20
|
|
|
include Pagy::Frontend |
21
|
|
|
|
22
|
|
|
# Returns the action method of the current page |
23
|
|
|
def active_page |
24
|
|
|
route = Rails.application.routes.recognize_path(request.env['PATH_INFO']) |
25
|
|
|
|
26
|
|
|
route[:action] |
27
|
|
|
end |
28
|
|
|
|
29
|
|
|
# Gets the email of the room owner to which the recording belongs to |
30
|
|
|
def recording_owner_email(room_id) |
31
|
|
|
Room.find_by(bbb_id: room_id).owner.email |
32
|
|
|
end |
33
|
|
|
|
34
|
|
|
def display_invite |
35
|
|
|
current_page?(admins_path) && invite_registration |
36
|
|
|
end |
37
|
|
|
|
38
|
|
|
def registration_method |
39
|
|
|
Setting.find_or_create_by!(provider: user_settings_provider).get_value("Registration Method") |
40
|
|
|
end |
41
|
|
|
|
42
|
|
|
def invite_registration |
43
|
|
|
registration_method == Rails.configuration.registration_methods[:invite] |
44
|
|
|
end |
45
|
|
|
|
46
|
|
|
def approval_registration |
47
|
|
|
registration_method == Rails.configuration.registration_methods[:approval] |
48
|
|
|
end |
49
|
|
|
|
50
|
|
View Code Duplication |
def room_authentication_string |
|
|
|
|
51
|
|
|
if Setting.find_or_create_by!(provider: user_settings_provider).get_value("Room Authentication") == "true" |
52
|
|
|
I18n.t("administrator.site_settings.authentication.enabled") |
53
|
|
|
else |
54
|
|
|
I18n.t("administrator.site_settings.authentication.disabled") |
55
|
|
|
end |
56
|
|
|
end |
57
|
|
|
|
58
|
|
View Code Duplication |
def recording_default_visibility_string |
|
|
|
|
59
|
|
|
if Setting.find_or_create_by!(provider: user_settings_provider) |
60
|
|
|
.get_value("Default Recording Visibility") == "public" |
61
|
|
|
I18n.t("administrator.site_settings.recording_visibility.public") |
62
|
|
|
else |
63
|
|
|
I18n.t("administrator.site_settings.recording_visibility.private") |
64
|
|
|
end |
65
|
|
|
end |
66
|
|
|
|
67
|
|
|
def registration_method_string |
68
|
|
|
case registration_method |
69
|
|
|
when Rails.configuration.registration_methods[:open] |
70
|
|
|
I18n.t("administrator.site_settings.registration.methods.open") |
71
|
|
|
when Rails.configuration.registration_methods[:invite] |
72
|
|
|
I18n.t("administrator.site_settings.registration.methods.invite") |
73
|
|
|
when Rails.configuration.registration_methods[:approval] |
74
|
|
|
I18n.t("administrator.site_settings.registration.methods.approval") |
75
|
|
|
end |
76
|
|
|
end |
77
|
|
|
|
78
|
|
|
def room_limit_number |
79
|
|
|
Setting.find_or_create_by!(provider: user_settings_provider).get_value("Room Limit").to_i |
80
|
|
|
end |
81
|
|
|
end |
82
|
|
|
|