GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — v2.4-alpha ( 96ace3...b4736b )
by Ahmad
11:22 queued 05:48
created

AdminsHelper.registration_method()   A

Complexity

Conditions 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
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
  # Gets the email of the room owner to which the recording belongs to
23
  def recording_owner_email(room_id)
24
    Room.find_by(bbb_id: room_id).owner.email
25
  end
26
27 View Code Duplication
  def invite_registration
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
28
    @settings.get_value("Registration Method") == Rails.configuration.registration_methods[:invite]
29
  end
30
31
  def room_authentication_string
32
    if @settings.get_value("Room Authentication") == "true"
33
      I18n.t("administrator.site_settings.authentication.enabled")
34
    else
35
      I18n.t("administrator.site_settings.authentication.disabled")
36
    end
37
  end
38
39
  def recording_default_visibility_string
40
    if @settings.get_value("Default Recording Visibility") == "public"
41
      I18n.t("recording.visibility.public")
42
    else
43
      I18n.t("recording.visibility.unlisted")
44
    end
45
  end
46
47
  def registration_method_string
48
    case @settings.get_value("Registration Method")
49
    when Rails.configuration.registration_methods[:open]
50
        I18n.t("administrator.site_settings.registration.methods.open")
51
    when Rails.configuration.registration_methods[:invite]
52
        I18n.t("administrator.site_settings.registration.methods.invite")
53
    when Rails.configuration.registration_methods[:approval]
54
        I18n.t("administrator.site_settings.registration.methods.approval")
55
      end
56
  end
57
58
  def room_limit_number
59
    @settings.get_value("Room Limit").to_i
60
  end
61
62
  def edit_disabled
63
    @edit_disabled ||= @selected_role.priority <= current_user.highest_priority_role.priority
64
  end
65
end
66