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
Pull Request — master (#496)
by Jesus
03:28
created

ThemingHelper.user_color()   A

Complexity

Conditions 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
c 1
b 0
f 0
dl 0
loc 4
rs 10
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 ThemingHelper
20
  # Returns the logo based on user's provider
21
  def logo_image
22
    Setting.find_or_create_by(provider: user_settings_provider)
23
           .get_value("Branding Image") || Rails.configuration.branding_image_default
24
  end
25
26
  # Returns the primary color based on user's provider
27
  def user_color
28
    Setting.find_or_create_by(provider: user_settings_provider)
29
           .get_value("Primary Color") || Rails.configuration.primary_color_default
30
  end
31
32
  # Returns the user's provider in the settings context
33
  def user_settings_provider
34
    if Rails.configuration.loadbalanced_configuration && !current_user&.has_role?(:super_admin)
35
      current_user.provider
36
    elsif Rails.configuration.loadbalanced_configuration
37
      @user_domain
38
    else
39
      "greenlight"
40
    end
41
  end
42
end
43