{"action":"created","comment":{"url":"https://api.github.com/repos/RocketChat/Rocket.Chat/pulls/comments/206986739","pull_request_review_id":142507887,"id":206986739,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNjk4NjczOQ==","diff_hunk":"@@ -191,6 +191,28 @@ export default class LDAP {\n \n \t\tconst usernameFilter = this.options.User_Search_Field.split(',').map(item => `(${ item }=${ username })`);\n \n+\t\tlet user;\n+\t\tconst query = {\n+\t\t\t'username': username,\n+\t\t\tldap: true,\n+\t\t\ttype: 'user'\n+\t\t};\n+\t\tuser = RocketChat.models.Users.findOne(query);\n+\t\tif (typeof user !== 'undefined' &&\n+\t\t\ttypeof user['services'] !== 'undefined' &&\n+\t\t\ttypeof user['services']['ldap'] !== 'undefined' &&\n+\t\t\ttypeof user['services']['ldap']['id'] !== 'undefined' &&\n+\t\t\ttypeof user['services']['ldap']['idAttribute'] !== 'undefined') {\n+\t\t\tlet idFilter = new this.ldapjs.filters.EqualityFilter({\n+\t\t\t\tattribute: user['services']['ldap']['idAttribute'],\n+\t\t\t\tvalue: new Buffer(user['services']['ldap']['id'],'hex')\n+\t\t\t});\n+\t\t\tif (filter.length === 1) {\n+\t\t\t\tidFilter = new this.ldapjs.AndFilter({ filters: [ idFilter, this.ldapjs.parseFilter(filter[0]) ] } );","path":"packages/rocketchat-ldap/server/ldap.js","position":21,"original_position":21,"commit_id":"7e988d79b28262109c812a56dc4a8295883ec989","original_commit_id":"7e988d79b28262109c812a56dc4a8295883ec989","user":{"login":"codacy-bot","id":19940114,"node_id":"MDQ6VXNlcjE5OTQwMTE0","avatar_url":"https://avatars1.githubusercontent.com/u/19940114?v=4","gravatar_id":"","url":"https://api.github.com/users/codacy-bot","html_url":"https://github.com/codacy-bot","followers_url":"https://api.github.com/users/codacy-bot/followers","following_url":"https://api.github.com/users/codacy-bot/following{/other_user}","gists_url":"https://api.github.com/users/codacy-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/codacy-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codacy-bot/subscriptions","organizations_url":"https://api.github.com/users/codacy-bot/orgs","repos_url":"https://api.github.com/users/codacy-bot/repos","events_url":"https://api.github.com/users/codacy-bot/events{/privacy}","received_events_url":"https://api.github.com/users/codacy-bot/received_events","type":"User","site_admin":false},"body":"![Codacy](https://app.codacy.com/assets/images/favicon.png) Issue found: [There should be no spaces inside this paren. (space-in-parens)](https://app.codacy.com/app/RocketChat/Rocket-Chat/pullRequest?prid=1983676)","created_at":"2018-08-01T18:33:19Z","updated_at":"2018-08-01T18:33:19Z","html_url":"https://github.com/RocketChat/Rocket.Chat/pull/11641#discussion_r206986739","pull_request_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/pulls/11641","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/RocketChat/Rocket.Chat/pulls/comments/206986739"},"html":{"href":"https://github.com/RocketChat/Rocket.Chat/pull/11641#discussion_r206986739"},"pull_request":{"href":"https://api.github.com/repos/RocketChat/Rocket.Chat/pulls/11641"}}},"pull_request":{"url":"https://api.github.com/repos/RocketChat/Rocket.Chat/pulls/11641","id":205509066,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA1NTA5MDY2","html_url":"https://github.com/RocketChat/Rocket.Chat/pull/11641","diff_url":"https://github.com/RocketChat/Rocket.Chat/pull/11641.diff","patch_url":"https://github.com/RocketChat/Rocket.Chat/pull/11641.patch","issue_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/issues/11641","number":11641,"state":"open","locked":false,"title":"Validate LDAP logins based on ldap id attribute","user":{"login":"adipose","id":3324395,"node_id":"MDQ6VXNlcjMzMjQzOTU=","avatar_url":"https://avatars0.githubusercontent.com/u/3324395?v=4","gravatar_id":"","url":"https://api.github.com/users/adipose","html_url":"https://github.com/adipose","followers_url":"https://api.github.com/users/adipose/followers","following_url":"https://api.github.com/users/adipose/following{/other_user}","gists_url":"https://api.github.com/users/adipose/gists{/gist_id}","starred_url":"https://api.github.com/users/adipose/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adipose/subscriptions","organizations_url":"https://api.github.com/users/adipose/orgs","repos_url":"https://api.github.com/users/adipose/repos","events_url":"https://api.github.com/users/adipose/events{/privacy}","received_events_url":"https://api.github.com/users/adipose/received_events","type":"User","site_admin":false},"body":"The first time a user synced from LDAP signs into RocketChat, they cannot sign in using their username. Instead, they have to use sAMAccountName (or whatever has been specified in the \"user search/search field\" section of LDAP). After the first successful sign in, the username begins working. On LDAP configurations where sAMAccountName is the same as the username, this would not be obvious, but otherwise, it is confusing.\r\n\r\n\r\n<!-- INSTRUCTION: Your Pull Request name should start with one of the following tags -->\r\n<!-- [NEW] For new features -->\r\n<!-- [FIX] For bug fixes -->\r\n<!-- [BREAK] For pull requests including breaking changes -->\r\n\r\n<!-- INSTRUCTION: Inform the issue number that this PR closes, or remove the line below -->\r\nCloses #10302\r\n\r\n<!-- INSTRUCTION: Link to a https://github.com/RocketChat/docs PR with added/updated documentation or an update to the missing/outdated documentation list, see https://rocket.chat/docs/contributing/documentation/  -->\r\n\r\n<!-- INSTRUCTION: Tell us more about your PR with screen shots if you can -->\r\n","created_at":"2018-08-01T18:13:26Z","updated_at":"2018-08-01T18:33:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"239a826622b03d1f6cd4b0b18c1228ee3a586ff0","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/pulls/11641/commits","review_comments_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/pulls/11641/comments","review_comment_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/pulls/comments{/number}","comments_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/issues/11641/comments","statuses_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/statuses/7e988d79b28262109c812a56dc4a8295883ec989","head":{"label":"adipose:patch-1","ref":"patch-1","sha":"7e988d79b28262109c812a56dc4a8295883ec989","user":{"login":"adipose","id":3324395,"node_id":"MDQ6VXNlcjMzMjQzOTU=","avatar_url":"https://avatars0.githubusercontent.com/u/3324395?v=4","gravatar_id":"","url":"https://api.github.com/users/adipose","html_url":"https://github.com/adipose","followers_url":"https://api.github.com/users/adipose/followers","following_url":"https://api.github.com/users/adipose/following{/other_user}","gists_url":"https://api.github.com/users/adipose/gists{/gist_id}","starred_url":"https://api.github.com/users/adipose/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adipose/subscriptions","organizations_url":"https://api.github.com/users/adipose/orgs","repos_url":"https://api.github.com/users/adipose/repos","events_url":"https://api.github.com/users/adipose/events{/privacy}","received_events_url":"https://api.github.com/users/adipose/received_events","type":"User","site_admin":false},"repo":{"id":142080784,"node_id":"MDEwOlJlcG9zaXRvcnkxNDIwODA3ODQ=","name":"Rocket.Chat","full_name":"adipose/Rocket.Chat","owner":{"login":"adipose","id":3324395,"node_id":"MDQ6VXNlcjMzMjQzOTU=","avatar_url":"https://avatars0.githubusercontent.com/u/3324395?v=4","gravatar_id":"","url":"https://api.github.com/users/adipose","html_url":"https://github.com/adipose","followers_url":"https://api.github.com/users/adipose/followers","following_url":"https://api.github.com/users/adipose/following{/other_user}","gists_url":"https://api.github.com/users/adipose/gists{/gist_id}","starred_url":"https://api.github.com/users/adipose/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adipose/subscriptions","organizations_url":"https://api.github.com/users/adipose/orgs","repos_url":"https://api.github.com/users/adipose/repos","events_url":"https://api.github.com/users/adipose/events{/privacy}","received_events_url":"https://api.github.com/users/adipose/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/adipose/Rocket.Chat","description":"Have your own Slack like online chat, built with Meteor.","fork":true,"url":"https://api.github.com/repos/adipose/Rocket.Chat","forks_url":"https://api.github.com/repos/adipose/Rocket.Chat/forks","keys_url":"https://api.github.com/repos/adipose/Rocket.Chat/keys{/key_id}","collaborators_url":"https://api.github.com/repos/adipose/Rocket.Chat/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/adipose/Rocket.Chat/teams","hooks_url":"https://api.github.com/repos/adipose/Rocket.Chat/hooks","issue_events_url":"https://api.github.com/repos/adipose/Rocket.Chat/issues/events{/number}","events_url":"https://api.github.com/repos/adipose/Rocket.Chat/events","assignees_url":"https://api.github.com/repos/adipose/Rocket.Chat/assignees{/user}","branches_url":"https://api.github.com/repos/adipose/Rocket.Chat/branches{/branch}","tags_url":"https://api.github.com/repos/adipose/Rocket.Chat/tags","blobs_url":"https://api.github.com/repos/adipose/Rocket.Chat/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/adipose/Rocket.Chat/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/adipose/Rocket.Chat/git/refs{/sha}","trees_url":"https://api.github.com/repos/adipose/Rocket.Chat/git/trees{/sha}","statuses_url":"https://api.github.com/repos/adipose/Rocket.Chat/statuses/{sha}","languages_url":"https://api.github.com/repos/adipose/Rocket.Chat/languages","stargazers_url":"https://api.github.com/repos/adipose/Rocket.Chat/stargazers","contributors_url":"https://api.github.com/repos/adipose/Rocket.Chat/contributors","subscribers_url":"https://api.github.com/repos/adipose/Rocket.Chat/subscribers","subscription_url":"https://api.github.com/repos/adipose/Rocket.Chat/subscription","commits_url":"https://api.github.com/repos/adipose/Rocket.Chat/commits{/sha}","git_commits_url":"https://api.github.com/repos/adipose/Rocket.Chat/git/commits{/sha}","comments_url":"https://api.github.com/repos/adipose/Rocket.Chat/comments{/number}","issue_comment_url":"https://api.github.com/repos/adipose/Rocket.Chat/issues/comments{/number}","contents_url":"https://api.github.com/repos/adipose/Rocket.Chat/contents/{+path}","compare_url":"https://api.github.com/repos/adipose/Rocket.Chat/compare/{base}...{head}","merges_url":"https://api.github.com/repos/adipose/Rocket.Chat/merges","archive_url":"https://api.github.com/repos/adipose/Rocket.Chat/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/adipose/Rocket.Chat/downloads","issues_url":"https://api.github.com/repos/adipose/Rocket.Chat/issues{/number}","pulls_url":"https://api.github.com/repos/adipose/Rocket.Chat/pulls{/number}","milestones_url":"https://api.github.com/repos/adipose/Rocket.Chat/milestones{/number}","notifications_url":"https://api.github.com/repos/adipose/Rocket.Chat/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/adipose/Rocket.Chat/labels{/name}","releases_url":"https://api.github.com/repos/adipose/Rocket.Chat/releases{/id}","deployments_url":"https://api.github.com/repos/adipose/Rocket.Chat/deployments","created_at":"2018-07-23T23:43:23Z","updated_at":"2018-07-23T23:43:30Z","pushed_at":"2018-08-01T18:28:01Z","git_url":"git://github.com/adipose/Rocket.Chat.git","ssh_url":"git@github.com:adipose/Rocket.Chat.git","clone_url":"https://github.com/adipose/Rocket.Chat.git","svn_url":"https://github.com/adipose/Rocket.Chat","homepage":"https://rocket.chat/","size":74656,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"RocketChat:develop","ref":"develop","sha":"1a37a7529aea0f2699b87d9ca77b6d1eacadb4a5","user":{"login":"RocketChat","id":12508788,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyNTA4Nzg4","avatar_url":"https://avatars1.githubusercontent.com/u/12508788?v=4","gravatar_id":"","url":"https://api.github.com/users/RocketChat","html_url":"https://github.com/RocketChat","followers_url":"https://api.github.com/users/RocketChat/followers","following_url":"https://api.github.com/users/RocketChat/following{/other_user}","gists_url":"https://api.github.com/users/RocketChat/gists{/gist_id}","starred_url":"https://api.github.com/users/RocketChat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RocketChat/subscriptions","organizations_url":"https://api.github.com/users/RocketChat/orgs","repos_url":"https://api.github.com/users/RocketChat/repos","events_url":"https://api.github.com/users/RocketChat/events{/privacy}","received_events_url":"https://api.github.com/users/RocketChat/received_events","type":"Organization","site_admin":false},"repo":{"id":35866694,"node_id":"MDEwOlJlcG9zaXRvcnkzNTg2NjY5NA==","name":"Rocket.Chat","full_name":"RocketChat/Rocket.Chat","owner":{"login":"RocketChat","id":12508788,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyNTA4Nzg4","avatar_url":"https://avatars1.githubusercontent.com/u/12508788?v=4","gravatar_id":"","url":"https://api.github.com/users/RocketChat","html_url":"https://github.com/RocketChat","followers_url":"https://api.github.com/users/RocketChat/followers","following_url":"https://api.github.com/users/RocketChat/following{/other_user}","gists_url":"https://api.github.com/users/RocketChat/gists{/gist_id}","starred_url":"https://api.github.com/users/RocketChat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RocketChat/subscriptions","organizations_url":"https://api.github.com/users/RocketChat/orgs","repos_url":"https://api.github.com/users/RocketChat/repos","events_url":"https://api.github.com/users/RocketChat/events{/privacy}","received_events_url":"https://api.github.com/users/RocketChat/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/RocketChat/Rocket.Chat","description":"Have your own Slack like online chat, built with Meteor.","fork":false,"url":"https://api.github.com/repos/RocketChat/Rocket.Chat","forks_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/forks","keys_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/keys{/key_id}","collaborators_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/teams","hooks_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/hooks","issue_events_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/issues/events{/number}","events_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/events","assignees_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/assignees{/user}","branches_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/branches{/branch}","tags_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/tags","blobs_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/git/refs{/sha}","trees_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/git/trees{/sha}","statuses_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/statuses/{sha}","languages_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/languages","stargazers_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/stargazers","contributors_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/contributors","subscribers_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/subscribers","subscription_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/subscription","commits_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/commits{/sha}","git_commits_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/git/commits{/sha}","comments_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/comments{/number}","issue_comment_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/issues/comments{/number}","contents_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/contents/{+path}","compare_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/compare/{base}...{head}","merges_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/merges","archive_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/downloads","issues_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/issues{/number}","pulls_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/pulls{/number}","milestones_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/milestones{/number}","notifications_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/labels{/name}","releases_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/releases{/id}","deployments_url":"https://api.github.com/repos/RocketChat/Rocket.Chat/deployments","created_at":"2015-05-19T07:36:09Z","updated_at":"2018-08-01T17:14:16Z","pushed_at":"2018-08-01T18:28:04Z","git_url":"git://github.com/RocketChat/Rocket.Chat.git","ssh_url":"git@github.com:RocketChat/Rocket.Chat.git","clone_url":"https://github.com/RocketChat/Rocket.Chat.git","svn_url":"https://github.com/RocketChat/Rocket.Chat","homepage":"https://rocket.chat/","size":76009,"stargazers_count":19190,"watchers_count":19190,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":4072,"mirror_url":null,"archived":false,"open_issues_count":2038,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":4072,"open_issues":2038,"watchers":19190,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/RocketChat/Rocket.Chat/pulls/11641"},"html":{"href":"https://github.com/RocketChat/Rocket.Chat/pull/11641"},"issue":{"href":"https://api.github.com/repos/RocketChat/Rocket.Chat/issues/11641"},"comments":{"href":"https://api.github.com/repos/RocketChat/Rocket.Chat/issues/11641/comments"},"review_comments":{"href":"https://api.github.com/repos/RocketChat/Rocket.Chat/pulls/11641/comments"},"review_comment":{"href":"https://api.github.com/repos/RocketChat/Rocket.Chat/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/RocketChat/Rocket.Chat/pulls/11641/commits"},"statuses":{"href":"https://api.github.com/repos/RocketChat/Rocket.Chat/statuses/7e988d79b28262109c812a56dc4a8295883ec989"}},"author_association":"NONE"}}
{"actor":{"display_login":"codacy-bot"}}