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

ApplicationHelper.markdown()   A

Complexity

Conditions 1

Size

Total Lines 12

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 12
rs 9.8
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
require 'bbb_api'
20
21
module ApplicationHelper
22
  # Determines which providers can show a login button in the login modal.
23
  def iconset_providers
24
    providers = configured_providers & [:google, :twitter, :office365, :ldap]
25
26
    providers.delete(:twitter) if session[:old_twitter_user_id]
27
28
    providers
29
  end
30
31
  # Generates the login URL for a specific provider.
32
  def omniauth_login_url(provider)
33
    if provider == :ldap
34
      ldap_signin_path
35
    else
36
      "#{Rails.configuration.relative_url_root}/auth/#{provider}"
37
    end
38
  end
39
40
  # Determines if a form field needs the is-invalid class.
41
  def form_is_invalid?(obj, key)
42
    'is-invalid' unless obj.errors.messages[key].empty?
43
  end
44
45
  # Return all the translations available in the client side through javascript
46
  def current_translations
47
    @translations ||= I18n.backend.send(:translations)
48
    @translations[I18n.locale].with_indifferent_access[:javascript] || {}
49
  end
50
51
  # Returns the page that the logo redirects to when clicked on
52
  def home_page
53
    return root_path unless current_user
54
    return admins_path if current_user.has_role? :super_admin
55
    current_user.main_room
56
  end
57
58
  # Returns the action method of the current page
59
  def active_page
60
    route = Rails.application.routes.recognize_path(request.env['PATH_INFO'])
61
62
    route[:action]
63
  end
64
65
  def role_colour(role)
66
    role.colour || Rails.configuration.primary_color_default
67
  end
68
69
  def translated_role_name(role)
70
    if role.name == "denied"
71
      I18n.t("roles.banned")
72
    elsif role.name == "pending"
73
      I18n.t("roles.pending")
74
    elsif role.name == "admin"
75
      I18n.t("roles.admin")
76
    elsif role.name == "user"
77
      I18n.t("roles.user")
78
    else
79
      role.name
80
    end
81
  end
82
83
  def can_reset_password
84
    # Check if admin is editting user and user is a greenlight account
85
    Rails.configuration.enable_email_verification &&
86
      Rails.application.routes.recognize_path(request.env['PATH_INFO'])[:action] == "edit_user" &&
87
      @user.greenlight_account?
88
  end
89
90
  def google_analytics_url
91
    "https://www.googletagmanager.com/gtag/js?id=#{ENV['GOOGLE_ANALYTICS_TRACKING_ID']}"
92
  end
93
end
94