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
Boxiang Sun
gitlab-ce
Commits
d2eb5bbd
Commit
d2eb5bbd
authored
Jun 28, 2017
by
Bob Van Landuyt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix setting `last_credential_check` on LDAP-login
parent
08ad0af4
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
lib/gitlab/ldap/access.rb
lib/gitlab/ldap/access.rb
+1
-1
spec/lib/gitlab/ldap/access_spec.rb
spec/lib/gitlab/ldap/access_spec.rb
+10
-0
No files found.
lib/gitlab/ldap/access.rb
View file @
d2eb5bbd
...
@@ -16,7 +16,7 @@ module Gitlab
...
@@ -16,7 +16,7 @@ module Gitlab
def
self
.
allowed?
(
user
)
def
self
.
allowed?
(
user
)
self
.
open
(
user
)
do
|
access
|
self
.
open
(
user
)
do
|
access
|
if
access
.
allowed?
if
access
.
allowed?
Users
::
UpdateService
.
new
(
user
,
last_credential_check_a:
Time
.
now
).
execute
Users
::
UpdateService
.
new
(
user
,
last_credential_check_a
t
:
Time
.
now
).
execute
true
true
else
else
...
...
spec/lib/gitlab/ldap/access_spec.rb
View file @
d2eb5bbd
...
@@ -4,6 +4,16 @@ describe Gitlab::LDAP::Access, lib: true do
...
@@ -4,6 +4,16 @@ describe Gitlab::LDAP::Access, lib: true do
let
(
:access
)
{
Gitlab
::
LDAP
::
Access
.
new
user
}
let
(
:access
)
{
Gitlab
::
LDAP
::
Access
.
new
user
}
let
(
:user
)
{
create
(
:omniauth_user
)
}
let
(
:user
)
{
create
(
:omniauth_user
)
}
describe
'.allowed?'
do
it
'updates the users `last_credential_check_at'
do
expect
(
access
).
to
receive
(
:allowed?
)
{
true
}
expect
(
described_class
).
to
receive
(
:open
).
and_yield
(
access
)
expect
{
described_class
.
allowed?
(
user
)
}
.
to
change
{
user
.
last_credential_check_at
}
end
end
describe
'#allowed?'
do
describe
'#allowed?'
do
subject
{
access
.
allowed?
}
subject
{
access
.
allowed?
}
...
...
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