Commit e7698225 authored by Valery Sizov's avatar Valery Sizov

Merge branch '7-4-stable' into to_ee_stable_from_ce_stable

Conflicts:
	config/initializers/1_settings.rb
	config/initializers/7_omniauth.rb
	features/admin/groups.feature
	features/steps/admin/groups.rb
parents ba84d01c a54d5dc7
......@@ -19,6 +19,7 @@ class Groups::GroupMembersController < ApplicationController
def destroy
@users_group = @group.group_members.find(params[:id])
if can?(current_user, :destroy, @users_group) # May fail if last owner.
@users_group.destroy
respond_to do |format|
......
......@@ -101,13 +101,13 @@
%ul.well-list.group-users-list
- @members.each do |member|
- user = member.user
%li{class: dom_class(user)}
%li{class: dom_class(member), id: dom_id(user)}
.list-item-name
%strong
= link_to user.name, admin_user_path(user)
%span.pull-right.light
= member.human_access
= link_to group_group_members_path(@group, member), data: { confirm: remove_user_from_group_message(@group, user) }, method: :delete, remote: true, class: "btn-tiny btn btn-remove", title: 'Remove user from group' do
= link_to group_group_member_path(@group, member), data: { confirm: remove_user_from_group_message(@group, user) }, method: :delete, remote: true, class: "btn-tiny btn btn-remove", title: 'Remove user from group' do
%i.fa.fa-minus.fa-inverse
.panel-footer
= paginate @members, param_name: 'members_page', theme: 'gitlab'
......@@ -61,16 +61,24 @@ Settings.ldap['sync_time'] = 3600 if Settings.ldap['sync_time'].nil?
if Settings.ldap['enabled'] || Rails.env.test?
if Settings.ldap['host'].present?
server = Settings.ldap.except('sync_time')
<<<<<<< HEAD
server = Settingslogic.new(server)
server['label'] = 'LDAP'
=======
>>>>>>> 7-4-stable
server['provider_name'] = 'ldap'
Settings.ldap['servers'] = {
'ldap' => server
}
end
<<<<<<< HEAD
Settings.ldap['servers'].map do |key, server|
server = Settingslogic.new(server)
=======
Settings.ldap['servers'].each do |key, server|
server['label'] ||= 'LDAP'
>>>>>>> 7-4-stable
server['allow_username_or_email_login'] = false if server['allow_username_or_email_login'].nil?
server['active_directory'] = true if server['active_directory'].nil?
server['provider_name'] ||= "ldap#{key}".downcase
......
if Gitlab::LDAP::Config.enabled?
module OmniAuth::Strategies
<<<<<<< HEAD
Gitlab::LDAP::Config.servers.each do |server|
# do not redeclare LDAP
next if server['provider_name'] == 'ldap'
const_set(server['provider_class'], Class.new(LDAP))
end
=======
server = Gitlab.config.ldap.servers.values.first
klass = server['provider_class']
const_set(klass, Class.new(LDAP)) unless klass == 'LDAP'
>>>>>>> 7-4-stable
end
OmniauthCallbacksController.class_eval do
......
......@@ -25,3 +25,10 @@ Feature: Admin Groups
Given group has shared projects
When I visit group page
Then I should see project shared with group
@javascript
Scenario: Remove user from group
Given we have user "John Doe" in group
When I visit admin group page
And I remove user "John Doe" from group
Then I should not see "John Doe" in team list
......@@ -37,8 +37,7 @@ class Spinach::Features::AdminGroups < Spinach::FeatureSteps
end
When 'I select user "John Doe" from user list as "Reporter"' do
user = User.find_by(name: "John Doe")
select2(user.id, from: "#user_ids", multiple: true)
select2(user_john.id, from: "#user_ids", multiple: true)
within "#new_team_member" do
select "Reporter", from: "access_level"
end
......@@ -73,6 +72,22 @@ class Spinach::Features::AdminGroups < Spinach::FeatureSteps
page.should have_content "Projects shared with"
end
step 'we have user "John Doe" in group' do
current_group.add_user(user_john, Gitlab::Access::REPORTER)
end
step 'I remove user "John Doe" from group' do
within "#user_#{user_john.id}" do
click_link 'Remove user from group'
end
end
step 'I should not see "John Doe" in team list' do
within ".group-users-list" do
page.should_not have_content "John Doe"
end
end
protected
def current_group
......@@ -82,4 +97,8 @@ class Spinach::Features::AdminGroups < Spinach::FeatureSteps
def shared_project
@shared_project ||= create(:empty_project)
end
def user_john
@user_john ||= User.find_by(name: "John Doe")
end
end
......@@ -30,7 +30,7 @@ module Backup
if File.exists?(path_to_repo(wiki))
print " * #{wiki.path_with_namespace} ... "
if wiki.empty?
if wiki.repository.empty?
puts " [SKIPPED]".cyan
else
output, status = Gitlab::Popen.popen(%W(git --git-dir=#{path_to_repo(wiki)} bundle create #{path_to_bundle(wiki)} --all))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment