Commit c4afa10c authored by Duff, Robert W's avatar Duff, Robert W

Commit email and LDAP email don't match with hooks

When using LDAP groups, emails are downcased. The commit email also needs to be downcased during comparisons, otherwise the pre-receive hook will cause a failure if the user hasn't chosen to downcase his own Git user.email entry.
parent 934713b6
...@@ -213,12 +213,12 @@ module Gitlab ...@@ -213,12 +213,12 @@ module Gitlab
# Check whether author is a GitLab member # Check whether author is a GitLab member
if git_hook.member_check if git_hook.member_check
unless User.existing_member?(commit.author_email) unless User.existing_member?(commit.author_email.downcase)
return build_status_object(false, "Author is not a member of team") return build_status_object(false, "Author is not a member of team")
end end
if commit.author_email != commit.committer_email if commit.author_email.downcase != commit.committer_email.downcase
unless User.existing_member?(commit.committer_email) unless User.existing_member?(commit.committer_email.downcase)
return build_status_object(false, "Commiter is not a member of team") return build_status_object(false, "Commiter is not a member of team")
end 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