check email feature
Created by: 2rba
When user is trying to do the "PUSH" operation, the Gitlab server perform the check of user's e-mail address within the existing Gitlab user database. If user's e-mail does not exist, then Gitlab does not allow to "PUSH" and display the corresponding message "User is not allowed to PUSH due to invalid e-mail address, please, use your registered e-mail address". To make error message displayed corresponding pull request to the repository gitlab-shell has been created
Created by: TeatroIO
I've prepared a stage. Click to open.
By Administrator on 2014-11-04T10:33:02 (imported from GitLab project)
205 205 params.require(:project).permit( 206 206 :name, :path, :description, :issues_tracker, :tag_list, 207 207 :issues_enabled, :merge_requests_enabled, :snippets_enabled, :issues_tracker_id, :default_branch, 208 :wiki_enabled, :visibility_level, :import_url, :last_activity_at, :namespace_id 208 :wiki_enabled, :visibility_level, :import_url, :last_activity_at, :namespace_id, :check_email 67 if oldrev && newrev 68 emails = IO.popen(%W(git --git-dir=#{project.repository.path_to_repo} log --format=%ae #{oldrev}...#{newrev})).read.split(/\s/).uniq 69 if emails.present? 70 found_emails = User.where(email: emails).map{|u| u.email} 71 missing = emails - found_emails 72 @errors << "User is not allowed to PUSH due to invalid e-mail address (#{missing.join(' ')}), please, use your registered e-mail address" if missing.present? 73 return missing 74 end 75 end 76 [] 77 end 78 62 79 def change_allowed?(user, project, change) 63 80 oldrev, newrev, ref = change.split(' ') 64 81 82 return false if project.check_email && invalid_emails(project,oldrev,newrev).present? 59 63 true 60 64 end 61 65 66 def invalid_emails(project, oldrev, newrev) 67 if oldrev && newrev 68 emails = IO.popen(%W(git --git-dir=#{project.repository.path_to_repo} log --format=%ae #{oldrev}...#{newrev})).read.split(/\s/).uniq 69 if emails.present? 70 found_emails = User.where(email: emails).map{|u| u.email} 59 63 true 60 64 end 61 65 66 def invalid_emails(project, oldrev, newrev) 67 if oldrev && newrev 68 emails = IO.popen(%W(git --git-dir=#{project.repository.path_to_repo} log --format=%ae #{oldrev}...#{newrev})).read.split(/\s/).uniq 59 63 true 60 64 end 61 65 66 def invalid_emails(project, oldrev, newrev) 67 if oldrev && newrev 68 emails = IO.popen(%W(git --git-dir=#{project.repository.path_to_repo} log --format=%ae #{oldrev}...#{newrev})).read.split(/\s/).uniq 69 if emails.present? 70 found_emails = User.where(email: emails).map{|u| u.email} 71 missing = emails - found_emails 72 @errors << "User is not allowed to PUSH due to invalid e-mail address (#{missing.join(' ')}), please, use your registered e-mail address" if missing.present? Created by: jvanbaarsen
Is there a request on the feature request forum that is similar to this? If so, can you make a comment with a link to it? Please be aware that new functionality that is not marked accepting merge/pull requests on the forum might not make it into GitLab. You might be asked to make changes and even after implementing them your feature might still be declined. If you want to reduce the chance of this happening please have a discussion in the forum first.
By Administrator on 2014-12-13T20:22:32 (imported from GitLab project)
Created by: jvanbaarsen
This merge request has been closed because a request for more information has not been reacted to for more than 2 weeks. If you respond and conform to the merge request guidelines in our contributing guidelines we will reopen this merge request.
By Administrator on 2015-02-01T13:37:37 (imported from GitLab project)