diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index f1e1bebe5c..31b5f15ff5 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -239,4 +239,10 @@ class ApplicationController < ActionController::Base redirect_to profile_path, notice: 'Please complete your profile with email address' and return end end + + def require_ldap_enabled + unless Gitlab.config.ldap.enabled + render_404 and return + end + end end diff --git a/app/controllers/groups/ldap_group_links_controller.rb b/app/controllers/groups/ldap_group_links_controller.rb index bc4f8cc04d..74c12c3828 100644 --- a/app/controllers/groups/ldap_group_links_controller.rb +++ b/app/controllers/groups/ldap_group_links_controller.rb @@ -1,5 +1,6 @@ class Groups::LdapGroupLinksController < ApplicationController before_action :group + before_action :require_ldap_enabled before_action :authorize_admin_group! layout 'group' diff --git a/app/views/groups/_settings_nav.html.haml b/app/views/groups/_settings_nav.html.haml index f73823e085..e43d65d06d 100644 --- a/app/views/groups/_settings_nav.html.haml +++ b/app/views/groups/_settings_nav.html.haml @@ -7,10 +7,11 @@ = link_to projects_group_path(@group) do %i.fa.fa-folder Projects - = nav_link(controller: :ldap_group_links) do - = link_to group_ldap_group_links_path(@group) do - %i.icon-exchange - LDAP Groups + - if ldap_enabled? + = nav_link(controller: :ldap_group_links) do + = link_to group_ldap_group_links_path(@group) do + %i.fa.fa-exchange + LDAP Groups = nav_link(controller: :audit_events) do = link_to group_audit_events_path(@group) do %i.fa.fa-file-text-o