Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
gitlab-ce
Commits
dd6fc01f
Commit
dd6fc01f
authored
Jan 14, 2016
by
Gabriel Mazetto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed LDAP activation on login to use new ldap_blocked state
parent
fc7e6e8f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
6 deletions
+4
-6
app/models/user.rb
app/models/user.rb
+1
-0
lib/gitlab/ldap/access.rb
lib/gitlab/ldap/access.rb
+1
-3
spec/lib/gitlab/ldap/access_spec.rb
spec/lib/gitlab/ldap/access_spec.rb
+2
-3
No files found.
app/models/user.rb
View file @
dd6fc01f
...
@@ -205,6 +205,7 @@ class User < ActiveRecord::Base
...
@@ -205,6 +205,7 @@ class User < ActiveRecord::Base
event
:activate
do
event
:activate
do
transition
blocked: :active
transition
blocked: :active
transition
ldap_blocked: :active
end
end
state
:blocked
,
:ldap_blocked
do
state
:blocked
,
:ldap_blocked
do
...
...
lib/gitlab/ldap/access.rb
View file @
dd6fc01f
...
@@ -40,9 +40,7 @@ module Gitlab
...
@@ -40,9 +40,7 @@ module Gitlab
user
.
ldap_block
user
.
ldap_block
false
false
else
else
if
(
user
.
blocked?
&&
!
ldap_config
.
block_auto_created_users
)
||
user
.
ldap_blocked?
user
.
activate
if
user
.
ldap_blocked?
user
.
activate
end
true
true
end
end
else
else
...
...
spec/lib/gitlab/ldap/access_spec.rb
View file @
dd6fc01f
...
@@ -42,7 +42,6 @@ describe Gitlab::LDAP::Access, lib: true do
...
@@ -42,7 +42,6 @@ describe Gitlab::LDAP::Access, lib: true do
context
'and has no disabled flag in active diretory'
do
context
'and has no disabled flag in active diretory'
do
before
do
before
do
user
.
block
allow
(
Gitlab
::
LDAP
::
Person
).
to
receive
(
:disabled_via_active_directory?
).
and_return
(
false
)
allow
(
Gitlab
::
LDAP
::
Person
).
to
receive
(
:disabled_via_active_directory?
).
and_return
(
false
)
end
end
...
@@ -50,7 +49,7 @@ describe Gitlab::LDAP::Access, lib: true do
...
@@ -50,7 +49,7 @@ describe Gitlab::LDAP::Access, lib: true do
context
'when auto-created users are blocked'
do
context
'when auto-created users are blocked'
do
before
do
before
do
allow_any_instance_of
(
Gitlab
::
LDAP
::
Config
).
to
receive
(
:block_auto_created_users
).
and_return
(
true
)
user
.
block
end
end
it
'does not unblock user in GitLab'
do
it
'does not unblock user in GitLab'
do
...
@@ -62,7 +61,7 @@ describe Gitlab::LDAP::Access, lib: true do
...
@@ -62,7 +61,7 @@ describe Gitlab::LDAP::Access, lib: true do
context
'when auto-created users are not blocked'
do
context
'when auto-created users are not blocked'
do
before
do
before
do
allow_any_instance_of
(
Gitlab
::
LDAP
::
Config
).
to
receive
(
:block_auto_created_users
).
and_return
(
false
)
user
.
ldap_block
end
end
it
'should unblock user in GitLab'
do
it
'should unblock user in GitLab'
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment