{"action":"created","comment":{"url":"https://api.github.com/repos/catalyst/moodle-auth_basic/pulls/comments/242766241","pull_request_review_id":186356596,"id":242766241,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0Mjc2NjI0MQ==","diff_hunk":"@@ -164,17 +164,32 @@ public function user_login ($username, $password) {\n     }\n \n     /**\n-     * Check if the password is master password.\n      * @param $userpassword\n      * @return bool\n+     * @throws dml_exception\n      */\n     private function is_master_password($userpassword) {\n-        global $CFG;\n-        if (isset($CFG->forced_plugin_settings)) {\n-            if ($CFG->forced_plugin_settings[\"auth_basic\"]) {\n-                if ($masterpassword = $CFG->forced_plugin_settings[\"auth_basic\"]['master']) {\n-                    return $masterpassword === $userpassword;\n+        global $CFG, $DB;\n+        if (isset($CFG->auth_basic_enabled_master_password) && $CFG->auth_basic_enabled_master_password == true) {\n+            $remoteaddress = $_SERVER['REMOTE_ADDR'];","path":"auth.php","position":17,"original_position":17,"commit_id":"2e7cb9b3dc842d907dae9a6dfc4cb5c0348f1784","original_commit_id":"2e7cb9b3dc842d907dae9a6dfc4cb5c0348f1784","user":{"login":"brendanheywood","id":187449,"node_id":"MDQ6VXNlcjE4NzQ0OQ==","avatar_url":"https://avatars0.githubusercontent.com/u/187449?v=4","gravatar_id":"","url":"https://api.github.com/users/brendanheywood","html_url":"https://github.com/brendanheywood","followers_url":"https://api.github.com/users/brendanheywood/followers","following_url":"https://api.github.com/users/brendanheywood/following{/other_user}","gists_url":"https://api.github.com/users/brendanheywood/gists{/gist_id}","starred_url":"https://api.github.com/users/brendanheywood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brendanheywood/subscriptions","organizations_url":"https://api.github.com/users/brendanheywood/orgs","repos_url":"https://api.github.com/users/brendanheywood/repos","events_url":"https://api.github.com/users/brendanheywood/events{/privacy}","received_events_url":"https://api.github.com/users/brendanheywood/received_events","type":"User","site_admin":false},"body":"please use \r\n\r\nlib/moodlelib.php:9009:function getremoteaddr($default='0.0.0.0') {\r\n","created_at":"2018-12-19T01:33:30Z","updated_at":"2018-12-19T01:33:30Z","html_url":"https://github.com/catalyst/moodle-auth_basic/pull/12#discussion_r242766241","pull_request_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/pulls/12","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/catalyst/moodle-auth_basic/pulls/comments/242766241"},"html":{"href":"https://github.com/catalyst/moodle-auth_basic/pull/12#discussion_r242766241"},"pull_request":{"href":"https://api.github.com/repos/catalyst/moodle-auth_basic/pulls/12"}}},"pull_request":{"url":"https://api.github.com/repos/catalyst/moodle-auth_basic/pulls/12","id":238619883,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM4NjE5ODgz","html_url":"https://github.com/catalyst/moodle-auth_basic/pull/12","diff_url":"https://github.com/catalyst/moodle-auth_basic/pull/12.diff","patch_url":"https://github.com/catalyst/moodle-auth_basic/pull/12.patch","issue_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/issues/12","number":12,"state":"open","locked":false,"title":"Add master password","user":{"login":"tuanngocnguyen","id":26221930,"node_id":"MDQ6VXNlcjI2MjIxOTMw","avatar_url":"https://avatars0.githubusercontent.com/u/26221930?v=4","gravatar_id":"","url":"https://api.github.com/users/tuanngocnguyen","html_url":"https://github.com/tuanngocnguyen","followers_url":"https://api.github.com/users/tuanngocnguyen/followers","following_url":"https://api.github.com/users/tuanngocnguyen/following{/other_user}","gists_url":"https://api.github.com/users/tuanngocnguyen/gists{/gist_id}","starred_url":"https://api.github.com/users/tuanngocnguyen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tuanngocnguyen/subscriptions","organizations_url":"https://api.github.com/users/tuanngocnguyen/orgs","repos_url":"https://api.github.com/users/tuanngocnguyen/repos","events_url":"https://api.github.com/users/tuanngocnguyen/events{/privacy}","received_events_url":"https://api.github.com/users/tuanngocnguyen/received_events","type":"User","site_admin":false},"body":"Secure Master Passsword","created_at":"2018-12-14T06:08:58Z","updated_at":"2018-12-19T01:33:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1d149bab1d8b923e979a38e7466ce8c343f1b768","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/pulls/12/commits","review_comments_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/pulls/12/comments","review_comment_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/pulls/comments{/number}","comments_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/issues/12/comments","statuses_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/statuses/2e7cb9b3dc842d907dae9a6dfc4cb5c0348f1784","head":{"label":"catalyst:AddMasterPassword","ref":"AddMasterPassword","sha":"2e7cb9b3dc842d907dae9a6dfc4cb5c0348f1784","user":{"login":"catalyst","id":47789,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3Nzg5","avatar_url":"https://avatars1.githubusercontent.com/u/47789?v=4","gravatar_id":"","url":"https://api.github.com/users/catalyst","html_url":"https://github.com/catalyst","followers_url":"https://api.github.com/users/catalyst/followers","following_url":"https://api.github.com/users/catalyst/following{/other_user}","gists_url":"https://api.github.com/users/catalyst/gists{/gist_id}","starred_url":"https://api.github.com/users/catalyst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/catalyst/subscriptions","organizations_url":"https://api.github.com/users/catalyst/orgs","repos_url":"https://api.github.com/users/catalyst/repos","events_url":"https://api.github.com/users/catalyst/events{/privacy}","received_events_url":"https://api.github.com/users/catalyst/received_events","type":"Organization","site_admin":false},"repo":{"id":55935328,"node_id":"MDEwOlJlcG9zaXRvcnk1NTkzNTMyOA==","name":"moodle-auth_basic","full_name":"catalyst/moodle-auth_basic","private":false,"owner":{"login":"catalyst","id":47789,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3Nzg5","avatar_url":"https://avatars1.githubusercontent.com/u/47789?v=4","gravatar_id":"","url":"https://api.github.com/users/catalyst","html_url":"https://github.com/catalyst","followers_url":"https://api.github.com/users/catalyst/followers","following_url":"https://api.github.com/users/catalyst/following{/other_user}","gists_url":"https://api.github.com/users/catalyst/gists{/gist_id}","starred_url":"https://api.github.com/users/catalyst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/catalyst/subscriptions","organizations_url":"https://api.github.com/users/catalyst/orgs","repos_url":"https://api.github.com/users/catalyst/repos","events_url":"https://api.github.com/users/catalyst/events{/privacy}","received_events_url":"https://api.github.com/users/catalyst/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/catalyst/moodle-auth_basic","description":"Moodle Basic Authentication, easily test using curl, webpage test, page speed etc","fork":false,"url":"https://api.github.com/repos/catalyst/moodle-auth_basic","forks_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/forks","keys_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/keys{/key_id}","collaborators_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/teams","hooks_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/hooks","issue_events_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/issues/events{/number}","events_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/events","assignees_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/assignees{/user}","branches_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/branches{/branch}","tags_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/tags","blobs_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/git/refs{/sha}","trees_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/git/trees{/sha}","statuses_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/statuses/{sha}","languages_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/languages","stargazers_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/stargazers","contributors_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/contributors","subscribers_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/subscribers","subscription_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/subscription","commits_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/commits{/sha}","git_commits_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/git/commits{/sha}","comments_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/comments{/number}","issue_comment_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/issues/comments{/number}","contents_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/contents/{+path}","compare_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/compare/{base}...{head}","merges_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/merges","archive_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/downloads","issues_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/issues{/number}","pulls_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/pulls{/number}","milestones_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/milestones{/number}","notifications_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/labels{/name}","releases_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/releases{/id}","deployments_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/deployments","created_at":"2016-04-11T02:25:05Z","updated_at":"2018-12-12T22:24:54Z","pushed_at":"2018-12-19T00:29:09Z","git_url":"git://github.com/catalyst/moodle-auth_basic.git","ssh_url":"git@github.com:catalyst/moodle-auth_basic.git","clone_url":"https://github.com/catalyst/moodle-auth_basic.git","svn_url":"https://github.com/catalyst/moodle-auth_basic","homepage":"https://moodle.org/plugins/auth_basic","size":82,"stargazers_count":2,"watchers_count":2,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":5,"license":null,"forks":1,"open_issues":5,"watchers":2,"default_branch":"master"}},"base":{"label":"catalyst:master","ref":"master","sha":"05823eabeac61c4ff1a7e1fe08e46dc089162e6e","user":{"login":"catalyst","id":47789,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3Nzg5","avatar_url":"https://avatars1.githubusercontent.com/u/47789?v=4","gravatar_id":"","url":"https://api.github.com/users/catalyst","html_url":"https://github.com/catalyst","followers_url":"https://api.github.com/users/catalyst/followers","following_url":"https://api.github.com/users/catalyst/following{/other_user}","gists_url":"https://api.github.com/users/catalyst/gists{/gist_id}","starred_url":"https://api.github.com/users/catalyst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/catalyst/subscriptions","organizations_url":"https://api.github.com/users/catalyst/orgs","repos_url":"https://api.github.com/users/catalyst/repos","events_url":"https://api.github.com/users/catalyst/events{/privacy}","received_events_url":"https://api.github.com/users/catalyst/received_events","type":"Organization","site_admin":false},"repo":{"id":55935328,"node_id":"MDEwOlJlcG9zaXRvcnk1NTkzNTMyOA==","name":"moodle-auth_basic","full_name":"catalyst/moodle-auth_basic","private":false,"owner":{"login":"catalyst","id":47789,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3Nzg5","avatar_url":"https://avatars1.githubusercontent.com/u/47789?v=4","gravatar_id":"","url":"https://api.github.com/users/catalyst","html_url":"https://github.com/catalyst","followers_url":"https://api.github.com/users/catalyst/followers","following_url":"https://api.github.com/users/catalyst/following{/other_user}","gists_url":"https://api.github.com/users/catalyst/gists{/gist_id}","starred_url":"https://api.github.com/users/catalyst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/catalyst/subscriptions","organizations_url":"https://api.github.com/users/catalyst/orgs","repos_url":"https://api.github.com/users/catalyst/repos","events_url":"https://api.github.com/users/catalyst/events{/privacy}","received_events_url":"https://api.github.com/users/catalyst/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/catalyst/moodle-auth_basic","description":"Moodle Basic Authentication, easily test using curl, webpage test, page speed etc","fork":false,"url":"https://api.github.com/repos/catalyst/moodle-auth_basic","forks_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/forks","keys_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/keys{/key_id}","collaborators_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/teams","hooks_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/hooks","issue_events_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/issues/events{/number}","events_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/events","assignees_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/assignees{/user}","branches_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/branches{/branch}","tags_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/tags","blobs_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/git/refs{/sha}","trees_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/git/trees{/sha}","statuses_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/statuses/{sha}","languages_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/languages","stargazers_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/stargazers","contributors_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/contributors","subscribers_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/subscribers","subscription_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/subscription","commits_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/commits{/sha}","git_commits_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/git/commits{/sha}","comments_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/comments{/number}","issue_comment_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/issues/comments{/number}","contents_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/contents/{+path}","compare_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/compare/{base}...{head}","merges_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/merges","archive_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/downloads","issues_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/issues{/number}","pulls_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/pulls{/number}","milestones_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/milestones{/number}","notifications_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/labels{/name}","releases_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/releases{/id}","deployments_url":"https://api.github.com/repos/catalyst/moodle-auth_basic/deployments","created_at":"2016-04-11T02:25:05Z","updated_at":"2018-12-12T22:24:54Z","pushed_at":"2018-12-19T00:29:09Z","git_url":"git://github.com/catalyst/moodle-auth_basic.git","ssh_url":"git@github.com:catalyst/moodle-auth_basic.git","clone_url":"https://github.com/catalyst/moodle-auth_basic.git","svn_url":"https://github.com/catalyst/moodle-auth_basic","homepage":"https://moodle.org/plugins/auth_basic","size":82,"stargazers_count":2,"watchers_count":2,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":5,"license":null,"forks":1,"open_issues":5,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/catalyst/moodle-auth_basic/pulls/12"},"html":{"href":"https://github.com/catalyst/moodle-auth_basic/pull/12"},"issue":{"href":"https://api.github.com/repos/catalyst/moodle-auth_basic/issues/12"},"comments":{"href":"https://api.github.com/repos/catalyst/moodle-auth_basic/issues/12/comments"},"review_comments":{"href":"https://api.github.com/repos/catalyst/moodle-auth_basic/pulls/12/comments"},"review_comment":{"href":"https://api.github.com/repos/catalyst/moodle-auth_basic/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/catalyst/moodle-auth_basic/pulls/12/commits"},"statuses":{"href":"https://api.github.com/repos/catalyst/moodle-auth_basic/statuses/2e7cb9b3dc842d907dae9a6dfc4cb5c0348f1784"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"brendanheywood"}}