{"action":"created","comment":{"url":"https://api.github.com/repos/heiglandreas/authLdap/pulls/comments/49668344","id":49668344,"diff_hunk":"@@ -362,13 +360,17 @@ function authLdap_login($user, $username, $password, $already_md5 = false)\n                 $user_info['user_email'] = $username . '@example.com';\n             }\n             $userid = wp_insert_user($user_info);\n+            if (is_wp_error($userid)) {\n+                authLdap_debug('Error creating user : ' . $userid->get_error_message());\n+                trigger_error('Error creating user: ' . $userid->get_error_message());\n+                return $userid;\n+            }\n         }\n \n-        // if the user exists, wp_insert_user will update the existing user record\n-        if (is_wp_error($userid)) {\n-            authLdap_debug('Error creating user : ' . $userid->get_error_message());\n-            trigger_error('Error creating user: ' . $userid->get_error_message());\n-            return $userid;","path":"authLdap.php","position":106,"original_position":106,"commit_id":"731e8ca5cb814c47f5e588e6ea71a42bcf17efc2","original_commit_id":"731e8ca5cb814c47f5e588e6ea71a42bcf17efc2","user":{"login":"sbeus","id":2540691,"avatar_url":"https://avatars.githubusercontent.com/u/2540691?v=3","gravatar_id":"","url":"https://api.github.com/users/sbeus","html_url":"https://github.com/sbeus","followers_url":"https://api.github.com/users/sbeus/followers","following_url":"https://api.github.com/users/sbeus/following{/other_user}","gists_url":"https://api.github.com/users/sbeus/gists{/gist_id}","starred_url":"https://api.github.com/users/sbeus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbeus/subscriptions","organizations_url":"https://api.github.com/users/sbeus/orgs","repos_url":"https://api.github.com/users/sbeus/repos","events_url":"https://api.github.com/users/sbeus/events{/privacy}","received_events_url":"https://api.github.com/users/sbeus/received_events","type":"User","site_admin":false},"body":"Right.  See previous comment.","created_at":"2016-01-13T23:36:25Z","updated_at":"2016-01-13T23:36:25Z","html_url":"https://github.com/heiglandreas/authLdap/pull/99#discussion_r49668344","pull_request_url":"https://api.github.com/repos/heiglandreas/authLdap/pulls/99","_links":{"self":{"href":"https://api.github.com/repos/heiglandreas/authLdap/pulls/comments/49668344"},"html":{"href":"https://github.com/heiglandreas/authLdap/pull/99#discussion_r49668344"},"pull_request":{"href":"https://api.github.com/repos/heiglandreas/authLdap/pulls/99"}}},"pull_request":{"url":"https://api.github.com/repos/heiglandreas/authLdap/pulls/99","id":55684921,"html_url":"https://github.com/heiglandreas/authLdap/pull/99","diff_url":"https://github.com/heiglandreas/authLdap/pull/99.diff","patch_url":"https://github.com/heiglandreas/authLdap/pull/99.patch","issue_url":"https://api.github.com/repos/heiglandreas/authLdap/issues/99","number":99,"state":"open","locked":false,"title":"Add multirole support","user":{"login":"sbeus","id":2540691,"avatar_url":"https://avatars.githubusercontent.com/u/2540691?v=3","gravatar_id":"","url":"https://api.github.com/users/sbeus","html_url":"https://github.com/sbeus","followers_url":"https://api.github.com/users/sbeus/followers","following_url":"https://api.github.com/users/sbeus/following{/other_user}","gists_url":"https://api.github.com/users/sbeus/gists{/gist_id}","starred_url":"https://api.github.com/users/sbeus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbeus/subscriptions","organizations_url":"https://api.github.com/users/sbeus/orgs","repos_url":"https://api.github.com/users/sbeus/repos","events_url":"https://api.github.com/users/sbeus/events{/privacy}","received_events_url":"https://api.github.com/users/sbeus/received_events","type":"User","site_admin":false},"body":"Existing authLdap code only supported users having a single role and would cause problems with other plugins (e.g. Members) that exploit WordPress' native support for multiple roles.  This update should allow a user to belong to multiple roles and gracefully add roles based on LDAP group, if configured to do so.  Simple tests using my specific use case have validated this change.","created_at":"2016-01-11T22:04:23Z","updated_at":"2016-01-13T23:36:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"24c059e97251bcb3ccce95aefa7a950a54d37a57","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/heiglandreas/authLdap/pulls/99/commits","review_comments_url":"https://api.github.com/repos/heiglandreas/authLdap/pulls/99/comments","review_comment_url":"https://api.github.com/repos/heiglandreas/authLdap/pulls/comments{/number}","comments_url":"https://api.github.com/repos/heiglandreas/authLdap/issues/99/comments","statuses_url":"https://api.github.com/repos/heiglandreas/authLdap/statuses/731e8ca5cb814c47f5e588e6ea71a42bcf17efc2","head":{"label":"sbeus:master","ref":"master","sha":"731e8ca5cb814c47f5e588e6ea71a42bcf17efc2","user":{"login":"sbeus","id":2540691,"avatar_url":"https://avatars.githubusercontent.com/u/2540691?v=3","gravatar_id":"","url":"https://api.github.com/users/sbeus","html_url":"https://github.com/sbeus","followers_url":"https://api.github.com/users/sbeus/followers","following_url":"https://api.github.com/users/sbeus/following{/other_user}","gists_url":"https://api.github.com/users/sbeus/gists{/gist_id}","starred_url":"https://api.github.com/users/sbeus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbeus/subscriptions","organizations_url":"https://api.github.com/users/sbeus/orgs","repos_url":"https://api.github.com/users/sbeus/repos","events_url":"https://api.github.com/users/sbeus/events{/privacy}","received_events_url":"https://api.github.com/users/sbeus/received_events","type":"User","site_admin":false},"repo":{"id":49456477,"name":"authLdap","full_name":"sbeus/authLdap","owner":{"login":"sbeus","id":2540691,"avatar_url":"https://avatars.githubusercontent.com/u/2540691?v=3","gravatar_id":"","url":"https://api.github.com/users/sbeus","html_url":"https://github.com/sbeus","followers_url":"https://api.github.com/users/sbeus/followers","following_url":"https://api.github.com/users/sbeus/following{/other_user}","gists_url":"https://api.github.com/users/sbeus/gists{/gist_id}","starred_url":"https://api.github.com/users/sbeus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbeus/subscriptions","organizations_url":"https://api.github.com/users/sbeus/orgs","repos_url":"https://api.github.com/users/sbeus/repos","events_url":"https://api.github.com/users/sbeus/events{/privacy}","received_events_url":"https://api.github.com/users/sbeus/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sbeus/authLdap","description":"LDAP-Authentication for WordPress","fork":true,"url":"https://api.github.com/repos/sbeus/authLdap","forks_url":"https://api.github.com/repos/sbeus/authLdap/forks","keys_url":"https://api.github.com/repos/sbeus/authLdap/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sbeus/authLdap/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sbeus/authLdap/teams","hooks_url":"https://api.github.com/repos/sbeus/authLdap/hooks","issue_events_url":"https://api.github.com/repos/sbeus/authLdap/issues/events{/number}","events_url":"https://api.github.com/repos/sbeus/authLdap/events","assignees_url":"https://api.github.com/repos/sbeus/authLdap/assignees{/user}","branches_url":"https://api.github.com/repos/sbeus/authLdap/branches{/branch}","tags_url":"https://api.github.com/repos/sbeus/authLdap/tags","blobs_url":"https://api.github.com/repos/sbeus/authLdap/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sbeus/authLdap/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sbeus/authLdap/git/refs{/sha}","trees_url":"https://api.github.com/repos/sbeus/authLdap/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sbeus/authLdap/statuses/{sha}","languages_url":"https://api.github.com/repos/sbeus/authLdap/languages","stargazers_url":"https://api.github.com/repos/sbeus/authLdap/stargazers","contributors_url":"https://api.github.com/repos/sbeus/authLdap/contributors","subscribers_url":"https://api.github.com/repos/sbeus/authLdap/subscribers","subscription_url":"https://api.github.com/repos/sbeus/authLdap/subscription","commits_url":"https://api.github.com/repos/sbeus/authLdap/commits{/sha}","git_commits_url":"https://api.github.com/repos/sbeus/authLdap/git/commits{/sha}","comments_url":"https://api.github.com/repos/sbeus/authLdap/comments{/number}","issue_comment_url":"https://api.github.com/repos/sbeus/authLdap/issues/comments{/number}","contents_url":"https://api.github.com/repos/sbeus/authLdap/contents/{+path}","compare_url":"https://api.github.com/repos/sbeus/authLdap/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sbeus/authLdap/merges","archive_url":"https://api.github.com/repos/sbeus/authLdap/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sbeus/authLdap/downloads","issues_url":"https://api.github.com/repos/sbeus/authLdap/issues{/number}","pulls_url":"https://api.github.com/repos/sbeus/authLdap/pulls{/number}","milestones_url":"https://api.github.com/repos/sbeus/authLdap/milestones{/number}","notifications_url":"https://api.github.com/repos/sbeus/authLdap/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sbeus/authLdap/labels{/name}","releases_url":"https://api.github.com/repos/sbeus/authLdap/releases{/id}","created_at":"2016-01-11T21:45:42Z","updated_at":"2016-01-11T21:45:44Z","pushed_at":"2016-01-12T15:57:36Z","git_url":"git://github.com/sbeus/authLdap.git","ssh_url":"git@github.com:sbeus/authLdap.git","clone_url":"https://github.com/sbeus/authLdap.git","svn_url":"https://github.com/sbeus/authLdap","homepage":"http://andreas.heigl.org/cat/dev/wp/authldap/","size":157,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"heiglandreas:master","ref":"master","sha":"07b99d56d7e554178e1fd70179c42d38afba7219","user":{"login":"heiglandreas","id":91998,"avatar_url":"https://avatars.githubusercontent.com/u/91998?v=3","gravatar_id":"","url":"https://api.github.com/users/heiglandreas","html_url":"https://github.com/heiglandreas","followers_url":"https://api.github.com/users/heiglandreas/followers","following_url":"https://api.github.com/users/heiglandreas/following{/other_user}","gists_url":"https://api.github.com/users/heiglandreas/gists{/gist_id}","starred_url":"https://api.github.com/users/heiglandreas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heiglandreas/subscriptions","organizations_url":"https://api.github.com/users/heiglandreas/orgs","repos_url":"https://api.github.com/users/heiglandreas/repos","events_url":"https://api.github.com/users/heiglandreas/events{/privacy}","received_events_url":"https://api.github.com/users/heiglandreas/received_events","type":"User","site_admin":false},"repo":{"id":854518,"name":"authLdap","full_name":"heiglandreas/authLdap","owner":{"login":"heiglandreas","id":91998,"avatar_url":"https://avatars.githubusercontent.com/u/91998?v=3","gravatar_id":"","url":"https://api.github.com/users/heiglandreas","html_url":"https://github.com/heiglandreas","followers_url":"https://api.github.com/users/heiglandreas/followers","following_url":"https://api.github.com/users/heiglandreas/following{/other_user}","gists_url":"https://api.github.com/users/heiglandreas/gists{/gist_id}","starred_url":"https://api.github.com/users/heiglandreas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heiglandreas/subscriptions","organizations_url":"https://api.github.com/users/heiglandreas/orgs","repos_url":"https://api.github.com/users/heiglandreas/repos","events_url":"https://api.github.com/users/heiglandreas/events{/privacy}","received_events_url":"https://api.github.com/users/heiglandreas/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/heiglandreas/authLdap","description":"LDAP-Authentication for WordPress","fork":false,"url":"https://api.github.com/repos/heiglandreas/authLdap","forks_url":"https://api.github.com/repos/heiglandreas/authLdap/forks","keys_url":"https://api.github.com/repos/heiglandreas/authLdap/keys{/key_id}","collaborators_url":"https://api.github.com/repos/heiglandreas/authLdap/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/heiglandreas/authLdap/teams","hooks_url":"https://api.github.com/repos/heiglandreas/authLdap/hooks","issue_events_url":"https://api.github.com/repos/heiglandreas/authLdap/issues/events{/number}","events_url":"https://api.github.com/repos/heiglandreas/authLdap/events","assignees_url":"https://api.github.com/repos/heiglandreas/authLdap/assignees{/user}","branches_url":"https://api.github.com/repos/heiglandreas/authLdap/branches{/branch}","tags_url":"https://api.github.com/repos/heiglandreas/authLdap/tags","blobs_url":"https://api.github.com/repos/heiglandreas/authLdap/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/heiglandreas/authLdap/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/heiglandreas/authLdap/git/refs{/sha}","trees_url":"https://api.github.com/repos/heiglandreas/authLdap/git/trees{/sha}","statuses_url":"https://api.github.com/repos/heiglandreas/authLdap/statuses/{sha}","languages_url":"https://api.github.com/repos/heiglandreas/authLdap/languages","stargazers_url":"https://api.github.com/repos/heiglandreas/authLdap/stargazers","contributors_url":"https://api.github.com/repos/heiglandreas/authLdap/contributors","subscribers_url":"https://api.github.com/repos/heiglandreas/authLdap/subscribers","subscription_url":"https://api.github.com/repos/heiglandreas/authLdap/subscription","commits_url":"https://api.github.com/repos/heiglandreas/authLdap/commits{/sha}","git_commits_url":"https://api.github.com/repos/heiglandreas/authLdap/git/commits{/sha}","comments_url":"https://api.github.com/repos/heiglandreas/authLdap/comments{/number}","issue_comment_url":"https://api.github.com/repos/heiglandreas/authLdap/issues/comments{/number}","contents_url":"https://api.github.com/repos/heiglandreas/authLdap/contents/{+path}","compare_url":"https://api.github.com/repos/heiglandreas/authLdap/compare/{base}...{head}","merges_url":"https://api.github.com/repos/heiglandreas/authLdap/merges","archive_url":"https://api.github.com/repos/heiglandreas/authLdap/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/heiglandreas/authLdap/downloads","issues_url":"https://api.github.com/repos/heiglandreas/authLdap/issues{/number}","pulls_url":"https://api.github.com/repos/heiglandreas/authLdap/pulls{/number}","milestones_url":"https://api.github.com/repos/heiglandreas/authLdap/milestones{/number}","notifications_url":"https://api.github.com/repos/heiglandreas/authLdap/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/heiglandreas/authLdap/labels{/name}","releases_url":"https://api.github.com/repos/heiglandreas/authLdap/releases{/id}","created_at":"2010-08-22T09:49:36Z","updated_at":"2015-12-18T20:13:36Z","pushed_at":"2016-01-12T15:57:37Z","git_url":"git://github.com/heiglandreas/authLdap.git","ssh_url":"git@github.com:heiglandreas/authLdap.git","clone_url":"https://github.com/heiglandreas/authLdap.git","svn_url":"https://github.com/heiglandreas/authLdap","homepage":"http://andreas.heigl.org/cat/dev/wp/authldap/","size":550,"stargazers_count":22,"watchers_count":22,"language":"PHP","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":29,"forks":10,"open_issues":29,"watchers":22,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/heiglandreas/authLdap/pulls/99"},"html":{"href":"https://github.com/heiglandreas/authLdap/pull/99"},"issue":{"href":"https://api.github.com/repos/heiglandreas/authLdap/issues/99"},"comments":{"href":"https://api.github.com/repos/heiglandreas/authLdap/issues/99/comments"},"review_comments":{"href":"https://api.github.com/repos/heiglandreas/authLdap/pulls/99/comments"},"review_comment":{"href":"https://api.github.com/repos/heiglandreas/authLdap/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/heiglandreas/authLdap/pulls/99/commits"},"statuses":{"href":"https://api.github.com/repos/heiglandreas/authLdap/statuses/731e8ca5cb814c47f5e588e6ea71a42bcf17efc2"}}}}