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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
f962745c
Commit
f962745c
authored
May 12, 2016
by
Yorick Peterse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use tr/casecmp to keep Rubocop happy
parent
81965c7f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
lib/gitlab/git_access.rb
lib/gitlab/git_access.rb
+1
-1
lib/gitlab/ldap/group_sync.rb
lib/gitlab/ldap/group_sync.rb
+3
-3
lib/gitlab/ldap/person.rb
lib/gitlab/ldap/person.rb
+1
-1
No files found.
lib/gitlab/git_access.rb
View file @
f962745c
...
@@ -258,7 +258,7 @@ module Gitlab
...
@@ -258,7 +258,7 @@ module Gitlab
return
build_status_object
(
false
,
"Author '
#{
commit
.
author_email
}
' is not a member of team"
)
return
build_status_object
(
false
,
"Author '
#{
commit
.
author_email
}
' is not a member of team"
)
end
end
if
commit
.
author_email
.
downcase
!=
commit
.
committer_email
.
downcase
if
commit
.
author_email
.
casecmp
(
commit
.
committer_email
)
==
-
1
unless
User
.
existing_member?
(
commit
.
committer_email
.
downcase
)
unless
User
.
existing_member?
(
commit
.
committer_email
.
downcase
)
return
build_status_object
(
false
,
"Committer '
#{
commit
.
committer_email
}
' is not a member of team"
)
return
build_status_object
(
false
,
"Committer '
#{
commit
.
committer_email
}
' is not a member of team"
)
end
end
...
...
lib/gitlab/ldap/group_sync.rb
View file @
f962745c
...
@@ -103,7 +103,7 @@ module Gitlab
...
@@ -103,7 +103,7 @@ module Gitlab
verified_admin_users
<<
user
verified_admin_users
<<
user
else
else
logger
.
debug
do
logger
.
debug
do
<<-
MSG
.
strip_heredoc
.
gsub
(
/\n/
,
' '
)
<<-
MSG
.
strip_heredoc
.
tr
(
"
\n
"
,
' '
)
#{
self
.
class
.
name
}
: User with DN `
#{
member_dn
}
` should have admin
#{
self
.
class
.
name
}
: User with DN `
#{
member_dn
}
` should have admin
access but there is no user in GitLab with that identity.
access but there is no user in GitLab with that identity.
Membership will be updated once the user signs in for the first time.
Membership will be updated once the user signs in for the first time.
...
@@ -277,7 +277,7 @@ module Gitlab
...
@@ -277,7 +277,7 @@ module Gitlab
add_or_update_user_membership
(
user
,
group
,
access_level
)
add_or_update_user_membership
(
user
,
group
,
access_level
)
else
else
logger
.
debug
do
logger
.
debug
do
<<-
MSG
.
strip_heredoc
.
gsub
(
/\n/
,
' '
)
<<-
MSG
.
strip_heredoc
.
tr
(
"
\n
"
,
' '
)
#{
self
.
class
.
name
}
: User with DN `
#{
member_dn
}
` should have access
#{
self
.
class
.
name
}
: User with DN `
#{
member_dn
}
` should have access
to '
#{
group
.
name
}
' group but there is no user in GitLab with that
to '
#{
group
.
name
}
' group but there is no user in GitLab with that
identity. Membership will be updated once the user signs in for
identity. Membership will be updated once the user signs in for
...
@@ -301,7 +301,7 @@ module Gitlab
...
@@ -301,7 +301,7 @@ module Gitlab
def
warn_cannot_remove_last_owner
(
user
,
group
)
def
warn_cannot_remove_last_owner
(
user
,
group
)
logger
.
warn
do
logger
.
warn
do
<<-
MSG
.
strip_heredoc
.
gsub
(
/\n/
,
' '
)
<<-
MSG
.
strip_heredoc
.
tr
(
"
\n
"
,
' '
)
#{
self
.
class
.
name
}
: LDAP group sync cannot remove
#{
user
.
name
}
#{
self
.
class
.
name
}
: LDAP group sync cannot remove
#{
user
.
name
}
(
#{
user
.
id
}
) from group
#{
group
.
name
}
(
#{
group
.
id
}
) as this is
(
#{
user
.
id
}
) from group
#{
group
.
name
}
(
#{
group
.
id
}
) as this is
the group's last owner
the group's last owner
...
...
lib/gitlab/ldap/person.rb
View file @
f962745c
...
@@ -70,7 +70,7 @@ module Gitlab
...
@@ -70,7 +70,7 @@ module Gitlab
Net
::
LDAP
::
DN
.
new
(
dn
).
each_pair
{
|
name
,
value
|
dn_components
<<
{
name:
name
,
value:
value
}
}
Net
::
LDAP
::
DN
.
new
(
dn
).
each_pair
{
|
name
,
value
|
dn_components
<<
{
name:
name
,
value:
value
}
}
dn_components
.
dn_components
.
reverse
.
reverse
.
take_while
{
|
rdn
|
rdn
[
:name
].
upcase
==
'DC'
}
.
# Domain Component
take_while
{
|
rdn
|
rdn
[
:name
].
casecmp
(
'DC'
)
==
0
}
.
# Domain Component
map
{
|
rdn
|
rdn
[
:value
]
}.
map
{
|
rdn
|
rdn
[
:value
]
}.
reverse
.
reverse
.
join
(
'.'
)
join
(
'.'
)
...
...
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