Commit 7b6dd7b3 authored by Rémy Coutable's avatar Rémy Coutable

Resolve conflicts

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent baf94bf1
This diff is collapsed.
......@@ -284,14 +284,10 @@ GEM
diff-lcs (~> 1.1)
mime-types (>= 1.16, < 3)
posix-spawn (~> 0.3)
<<<<<<< HEAD
gitlab-license (1.0.0)
gitlab-markup (1.5.0)
=======
gitlab-markup (1.5.1)
gitlab-turbolinks-classic (2.5.6)
coffee-rails
>>>>>>> ce/master
gitlab_omniauth-ldap (1.2.1)
net-ldap (~> 0.9)
omniauth (~> 1.0)
......@@ -923,13 +919,9 @@ DEPENDENCIES
github-linguist (~> 4.7.0)
gitlab-elasticsearch-git (~> 1.0.1)
gitlab-flowdock-git-hook (~> 1.0.1)
<<<<<<< HEAD
gitlab-license (~> 1.0)
gitlab-markup (~> 1.5.0)
=======
gitlab-markup (~> 1.5.1)
gitlab-turbolinks-classic (~> 2.5, >= 2.5.6)
>>>>>>> ce/master
gitlab_omniauth-ldap (~> 1.2.1)
gollum-lib (~> 4.2)
gollum-rugged_adapter (~> 0.4.2)
......@@ -1012,11 +1004,7 @@ DEPENDENCIES
rqrcode-rails3 (~> 0.1.7)
rspec-rails (~> 3.5.0)
rspec-retry (~> 0.4.5)
<<<<<<< HEAD
rubocop (~> 0.43.0)
=======
rubocop (~> 0.46.0)
>>>>>>> ce/master
rubocop-rspec (~> 1.9.1)
ruby-fogbugz (~> 0.2.1)
ruby-prof (~> 0.16.2)
......
......@@ -69,7 +69,24 @@ module Gitlab
@ldap_user ||= Gitlab::LDAP::Person.find_by_dn(user.ldap_identity.extern_uid, adapter)
end
<<<<<<< HEAD
def block_user(user, reason)
user.ldap_block
Gitlab::AppLogger.info(
"LDAP account \"#{user.ldap_identity.extern_uid}\" #{reason}, " \
"blocking Gitlab user \"#{user.name}\" (#{user.email})"
)
end
def unblock_user(user, reason)
user.activate
Gitlab::AppLogger.info(
"LDAP account \"#{user.ldap_identity.extern_uid}\" #{reason}, " \
"unblocking Gitlab user \"#{user.name}\" (#{user.email})"
)
end
def update_user
update_email
update_ssh_keys if sync_ssh_keys?
......@@ -151,24 +168,6 @@ module Gitlab
def logger
Rails.logger
=======
def block_user(user, reason)
user.ldap_block
Gitlab::AppLogger.info(
"LDAP account \"#{user.ldap_identity.extern_uid}\" #{reason}, " \
"blocking Gitlab user \"#{user.name}\" (#{user.email})"
)
end
def unblock_user(user, reason)
user.activate
Gitlab::AppLogger.info(
"LDAP account \"#{user.ldap_identity.extern_uid}\" #{reason}, " \
"unblocking Gitlab user \"#{user.name}\" (#{user.email})"
)
>>>>>>> ce/master
end
end
end
......
......@@ -14,13 +14,9 @@ describe Gitlab::LDAP::Access, lib: true do
it { is_expected.to be_falsey }
<<<<<<< HEAD
it 'blocks user in GitLab' do
=======
it 'should block user in GitLab' do
expect(access).to receive(:block_user).with(user, 'does not exist anymore')
>>>>>>> ce/master
access.allowed?
end
end
......@@ -116,7 +112,48 @@ describe Gitlab::LDAP::Access, lib: true do
end
end
<<<<<<< HEAD
describe '#block_user' do
before do
user.activate
allow(Gitlab::AppLogger).to receive(:info)
access.block_user user, 'reason'
end
it 'blocks the user' do
expect(user).to be_blocked
expect(user).to be_ldap_blocked
end
it 'logs the reason' do
expect(Gitlab::AppLogger).to have_received(:info).with(
"LDAP account \"123456\" reason, " \
"blocking Gitlab user \"#{user.name}\" (#{user.email})"
)
end
end
describe '#unblock_user' do
before do
user.ldap_block
allow(Gitlab::AppLogger).to receive(:info)
access.unblock_user user, 'reason'
end
it 'activates the user' do
expect(user).not_to be_blocked
expect(user).not_to be_ldap_blocked
end
it 'logs the reason' do
Gitlab::AppLogger.info(
"LDAP account \"123456\" reason, " \
"unblocking Gitlab user \"#{user.name}\" (#{user.email})"
)
end
end
describe '#update_user' do
subject { access.update_user }
let(:entry) do
......@@ -266,47 +303,6 @@ describe Gitlab::LDAP::Access, lib: true do
it "updates the email if the user email is different" do
entry['mail'] = ["new_email@example.com"]
expect{ access.update_email }.to change(user, :email)
=======
describe '#block_user' do
before do
user.activate
allow(Gitlab::AppLogger).to receive(:info)
access.block_user user, 'reason'
end
it 'blocks the user' do
expect(user).to be_blocked
expect(user).to be_ldap_blocked
end
it 'logs the reason' do
expect(Gitlab::AppLogger).to have_received(:info).with(
"LDAP account \"123456\" reason, " \
"blocking Gitlab user \"#{user.name}\" (#{user.email})"
)
end
end
describe '#unblock_user' do
before do
user.ldap_block
allow(Gitlab::AppLogger).to receive(:info)
access.unblock_user user, 'reason'
end
it 'activates the user' do
expect(user).not_to be_blocked
expect(user).not_to be_ldap_blocked
end
it 'logs the reason' do
Gitlab::AppLogger.info(
"LDAP account \"123456\" reason, " \
"unblocking Gitlab user \"#{user.name}\" (#{user.email})"
)
>>>>>>> ce/master
end
end
end
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