{"action":"created","comment":{"url":"https://api.github.com/repos/LukeCarrier/moodle-local_signin/pulls/comments/149945901","pull_request_review_id":75399244,"id":149945901,"diff_hunk":"@@ -0,0 +1,66 @@\n+<?php\n+\n+/**\n+ * Password form\n+ *\n+ * @author Earle Skinner <earle.skinner@avadolearning.com>\n+ * @copyright 2017 AVADO Learning\n+ */\n+\n+namespace local_signin\\form;\n+\n+use coding_exception;\n+use local_signin\\util;\n+use moodleform;\n+\n+defined('MOODLE_INTERNAL') || die;\n+\n+require_once \"{$CFG->libdir}/formslib.php\";\n+\n+class password_form extends moodleform {\n+    /**\n+     * @override \\moodleform\n+     */\n+    public function definition() {\n+        global $frm;\n+\n+        $mform  = $this->_form;\n+\n+        $username = '';\n+        if (isset($frm) && isset($frm->username) && $frm->username) {\n+            $username = $frm->username;\n+        }\n+        $user_attributes = array('placeholder'   => $this->lang_string('form_username_placeholder'),\n+                                 'additionalcss' => $this->lang_string('form_username_button_class'),\n+                                 'readonly'      => '',\n+                                 'value'         => $username);\n+        $mform->addElement('text', 'username', $this->lang_string('form_username_label'), $user_attributes);\n+        $mform->setType('username', PARAM_USERNAME);\n+\n+        $pass_attributes = array('placeholder'   => $this->lang_string('form_password_placeholder'),\n+                                 'additionalcss' => $this->lang_string('form_password_button_class'),\n+                                 'autofocus'     => '');\n+        $mform->addElement('password', 'password', $this->lang_string('form_password_label'), $pass_attributes);\n+        $mform->setType('password', PARAM_RAW);\n+\n+        $mform->addElement('hidden', 'rememberme', 0, array ('id' => 'check_rememberme'));\n+        $mform->setType('rememberme', PARAM_INT);\n+\n+        $submit_attributes = array('additionalcss' => $this->lang_string('form_password_button_class'));\n+        $mform->addElement('submit', 'submitpassword', $this->lang_string('form_password_button_label'), $submit_attributes);\n+\n+        $mform->addElement('html', sprintf('<div class=\"%s\"><a href=\"%s\">%s</a></div>',\n+            $this->lang_string('form_password_changeusername_class'),\n+            new \\moodle_url('/local/signin/change_user.php'),\n+            $this->lang_string('form_password_changeusername_label')));\n+\n+        $mform->addElement('html', sprintf('<div class=\"%s\"><a href=\"%s\">%s</a></div>',\n+            $this->lang_string('form_userpass_forgot_class'),\n+            new \\moodle_url('/local/signin/forgot.php'),","path":"classes/form/password_form.php","position":59,"original_position":59,"commit_id":"16920358c5e6f72f0b448b69be686c9ebda86f02","original_commit_id":"16920358c5e6f72f0b448b69be686c9ebda86f02","user":{"login":"LukeCarrier","id":597015,"avatar_url":"https://avatars0.githubusercontent.com/u/597015?v=4","gravatar_id":"","url":"https://api.github.com/users/LukeCarrier","html_url":"https://github.com/LukeCarrier","followers_url":"https://api.github.com/users/LukeCarrier/followers","following_url":"https://api.github.com/users/LukeCarrier/following{/other_user}","gists_url":"https://api.github.com/users/LukeCarrier/gists{/gist_id}","starred_url":"https://api.github.com/users/LukeCarrier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LukeCarrier/subscriptions","organizations_url":"https://api.github.com/users/LukeCarrier/orgs","repos_url":"https://api.github.com/users/LukeCarrier/repos","events_url":"https://api.github.com/users/LukeCarrier/events{/privacy}","received_events_url":"https://api.github.com/users/LukeCarrier/received_events","type":"User","site_admin":false},"body":"Could you import `moodle_url` with a `use` statement at the top of the file?","created_at":"2017-11-09T12:17:46Z","updated_at":"2017-11-09T12:55:24Z","html_url":"https://github.com/LukeCarrier/moodle-local_signin/pull/1#discussion_r149945901","pull_request_url":"https://api.github.com/repos/LukeCarrier/moodle-local_signin/pulls/1","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/LukeCarrier/moodle-local_signin/pulls/comments/149945901"},"html":{"href":"https://github.com/LukeCarrier/moodle-local_signin/pull/1#discussion_r149945901"},"pull_request":{"href":"https://api.github.com/repos/LukeCarrier/moodle-local_signin/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/LukeCarrier/moodle-local_signin/pulls/1","id":149759871,"html_url":"https://github.com/LukeCarrier/moodle-local_signin/pull/1","diff_url":"https://github.com/LukeCarrier/moodle-local_signin/pull/1.diff","patch_url":"https://github.com/LukeCarrier/moodle-local_signin/pull/1.patch","issue_url":"https://api.github.com/repos/LukeCarrier/moodle-local_signin/issues/1","number":1,"state":"open","locked":false,"title":"ALP-1764 and ALP-1765 ","user":{"login":"sliute","id":20374619,"avatar_url":"https://avatars1.githubusercontent.com/u/20374619?v=4","gravatar_id":"","url":"https://api.github.com/users/sliute","html_url":"https://github.com/sliute","followers_url":"https://api.github.com/users/sliute/followers","following_url":"https://api.github.com/users/sliute/following{/other_user}","gists_url":"https://api.github.com/users/sliute/gists{/gist_id}","starred_url":"https://api.github.com/users/sliute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sliute/subscriptions","organizations_url":"https://api.github.com/users/sliute/orgs","repos_url":"https://api.github.com/users/sliute/repos","events_url":"https://api.github.com/users/sliute/events{/privacy}","received_events_url":"https://api.github.com/users/sliute/received_events","type":"User","site_admin":false},"body":"This is the no-JS, no-AJAX branch of the new local/signin plugin. See [ALP-1764](https://homelearningcollege.atlassian.net/browse/ALP-1764) and [ALP-1765](https://homelearningcollege.atlassian.net/browse/ALP-1765).\r\n\r\nFor the Behat tests to run, madbehatter needs to be updated with two new step definitions, as per [this Bitbucket PR](https://bitbucket.org/avadolearning/local_madbehatter/pull-requests/5/alp-1764-and-1765-add-steps-for-path-and/diff).","created_at":"2017-10-31T11:29:37Z","updated_at":"2017-11-09T12:55:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"be87b79c11f5dcb8ec39fe14588be523d594074b","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/LukeCarrier/moodle-local_signin/pulls/1/commits","review_comments_url":"https://api.github.com/repos/LukeCarrier/moodle-local_signin/pulls/1/comments","review_comment_url":"https://api.github.com/repos/LukeCarrier/moodle-local_signin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/LukeCarrier/moodle-local_signin/issues/1/comments","statuses_url":"https://api.github.com/repos/LukeCarrier/moodle-local_signin/statuses/16920358c5e6f72f0b448b69be686c9ebda86f02","head":{"label":"AVADOLearning:ALP-1764_2_rememberme","ref":"ALP-1764_2_rememberme","sha":"16920358c5e6f72f0b448b69be686c9ebda86f02","user":{"login":"AVADOLearning","id":11281006,"avatar_url":"https://avatars0.githubusercontent.com/u/11281006?v=4","gravatar_id":"","url":"https://api.github.com/users/AVADOLearning","html_url":"https://github.com/AVADOLearning","followers_url":"https://api.github.com/users/AVADOLearning/followers","following_url":"https://api.github.com/users/AVADOLearning/following{/other_user}","gists_url":"https://api.github.com/users/AVADOLearning/gists{/gist_id}","starred_url":"https://api.github.com/users/AVADOLearning/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AVADOLearning/subscriptions","organizations_url":"https://api.github.com/users/AVADOLearning/orgs","repos_url":"https://api.github.com/users/AVADOLearning/repos","events_url":"https://api.github.com/users/AVADOLearning/events{/privacy}","received_events_url":"https://api.github.com/users/AVADOLearning/received_events","type":"Organization","site_admin":false},"repo":{"id":107100435,"name":"moodle-local_signin","full_name":"AVADOLearning/moodle-local_signin","owner":{"login":"AVADOLearning","id":11281006,"avatar_url":"https://avatars0.githubusercontent.com/u/11281006?v=4","gravatar_id":"","url":"https://api.github.com/users/AVADOLearning","html_url":"https://github.com/AVADOLearning","followers_url":"https://api.github.com/users/AVADOLearning/followers","following_url":"https://api.github.com/users/AVADOLearning/following{/other_user}","gists_url":"https://api.github.com/users/AVADOLearning/gists{/gist_id}","starred_url":"https://api.github.com/users/AVADOLearning/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AVADOLearning/subscriptions","organizations_url":"https://api.github.com/users/AVADOLearning/orgs","repos_url":"https://api.github.com/users/AVADOLearning/repos","events_url":"https://api.github.com/users/AVADOLearning/events{/privacy}","received_events_url":"https://api.github.com/users/AVADOLearning/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/AVADOLearning/moodle-local_signin","description":null,"fork":true,"url":"https://api.github.com/repos/AVADOLearning/moodle-local_signin","forks_url":"https://api.github.com/repos/AVADOLearning/moodle-local_signin/forks","keys_url":"https://api.github.com/repos/AVADOLearning/moodle-local_signin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AVADOLearning/moodle-local_signin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AVADOLearning/moodle-local_signin/teams","hooks_url":"https://api.github.com/repos/AVADOLearning/moodle-local_signin/hooks","issue_events_url":"https://api.github.com/repos/AVADOLearning/moodle-local_signin/issues/events{/number}","events_url":"https://api.github.com/repos/AVADOLearning/moodle-local_signin/events","assignees_url":"https://api.github.com/repos/AVADOLearning/moodle-local_signin/assignees{/user}","branches_url":"https://api.github.com/repos/AVADOLearning/moodle-local_signin/branches{/branch}","tags_url":"https://api.github.com/repos/AVADOLearning/moodle-local_signin/tags","blobs_url":"https://api.github.com/repos/AVADOLearning/moodle-local_signin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AVADOLearning/moodle-local_signin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AVADOLearning/moodle-local_signin/git/refs{/sha}","trees_url":"https://api.github.com/repos/AVADOLearning/moodle-local_signin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AVADOLearning/moodle-local_signin/statuses/{sha}","languages_url":"https://api.github.com/repos/AVADOLearning/moodle-local_signin/languages","stargazers_url":"https://api.github.com/repos/AVADOLearning/moodle-local_signin/stargazers","contributors_url":"https://api.github.com/repos/AVADOLearning/moodle-local_signin/contributors","subscribers_url":"https://api.github.com/repos/AVADOLearning/moodle-local_signin/subscribers","subscription_url":"https://api.github.com/repos/AVADOLearning/moodle-local_signin/subscription","commits_url":"https://api.github.com/repos/AVADOLearning/moodle-local_signin/commits{/sha}","git_commits_url":"https://api.github.com/repos/AVADOLearning/moodle-local_signin/git/commits{/sha}","comments_url":"https://api.github.com/repos/AVADOLearning/moodle-local_signin/comments{/number}","issue_comment_url":"https://api.github.com/repos/AVADOLearning/moodle-local_signin/issues/comments{/number}","contents_url":"https://api.github.com/repos/AVADOLearning/moodle-local_signin/contents/{+path}","compare_url":"https://api.github.com/repos/AVADOLearning/moodle-local_signin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AVADOLearning/moodle-local_signin/merges","archive_url":"https://api.github.com/repos/AVADOLearning/moodle-local_signin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AVADOLearning/moodle-local_signin/downloads","issues_url":"https://api.github.com/repos/AVADOLearning/moodle-local_signin/issues{/number}","pulls_url":"https://api.github.com/repos/AVADOLearning/moodle-local_signin/pulls{/number}","milestones_url":"https://api.github.com/repos/AVADOLearning/moodle-local_signin/milestones{/number}","notifications_url":"https://api.github.com/repos/AVADOLearning/moodle-local_signin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AVADOLearning/moodle-local_signin/labels{/name}","releases_url":"https://api.github.com/repos/AVADOLearning/moodle-local_signin/releases{/id}","deployments_url":"https://api.github.com/repos/AVADOLearning/moodle-local_signin/deployments","created_at":"2017-10-16T08:34:57Z","updated_at":"2017-10-16T08:34:59Z","pushed_at":"2017-11-07T14:25:17Z","git_url":"git://github.com/AVADOLearning/moodle-local_signin.git","ssh_url":"git@github.com:AVADOLearning/moodle-local_signin.git","clone_url":"https://github.com/AVADOLearning/moodle-local_signin.git","svn_url":"https://github.com/AVADOLearning/moodle-local_signin","homepage":null,"size":81,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"LukeCarrier:master","ref":"master","sha":"83e42d811739023bfefd41840be5741f1c0c7782","user":{"login":"LukeCarrier","id":597015,"avatar_url":"https://avatars0.githubusercontent.com/u/597015?v=4","gravatar_id":"","url":"https://api.github.com/users/LukeCarrier","html_url":"https://github.com/LukeCarrier","followers_url":"https://api.github.com/users/LukeCarrier/followers","following_url":"https://api.github.com/users/LukeCarrier/following{/other_user}","gists_url":"https://api.github.com/users/LukeCarrier/gists{/gist_id}","starred_url":"https://api.github.com/users/LukeCarrier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LukeCarrier/subscriptions","organizations_url":"https://api.github.com/users/LukeCarrier/orgs","repos_url":"https://api.github.com/users/LukeCarrier/repos","events_url":"https://api.github.com/users/LukeCarrier/events{/privacy}","received_events_url":"https://api.github.com/users/LukeCarrier/received_events","type":"User","site_admin":false},"repo":{"id":82733841,"name":"moodle-local_signin","full_name":"LukeCarrier/moodle-local_signin","owner":{"login":"LukeCarrier","id":597015,"avatar_url":"https://avatars0.githubusercontent.com/u/597015?v=4","gravatar_id":"","url":"https://api.github.com/users/LukeCarrier","html_url":"https://github.com/LukeCarrier","followers_url":"https://api.github.com/users/LukeCarrier/followers","following_url":"https://api.github.com/users/LukeCarrier/following{/other_user}","gists_url":"https://api.github.com/users/LukeCarrier/gists{/gist_id}","starred_url":"https://api.github.com/users/LukeCarrier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LukeCarrier/subscriptions","organizations_url":"https://api.github.com/users/LukeCarrier/orgs","repos_url":"https://api.github.com/users/LukeCarrier/repos","events_url":"https://api.github.com/users/LukeCarrier/events{/privacy}","received_events_url":"https://api.github.com/users/LukeCarrier/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/LukeCarrier/moodle-local_signin","description":null,"fork":false,"url":"https://api.github.com/repos/LukeCarrier/moodle-local_signin","forks_url":"https://api.github.com/repos/LukeCarrier/moodle-local_signin/forks","keys_url":"https://api.github.com/repos/LukeCarrier/moodle-local_signin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/LukeCarrier/moodle-local_signin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/LukeCarrier/moodle-local_signin/teams","hooks_url":"https://api.github.com/repos/LukeCarrier/moodle-local_signin/hooks","issue_events_url":"https://api.github.com/repos/LukeCarrier/moodle-local_signin/issues/events{/number}","events_url":"https://api.github.com/repos/LukeCarrier/moodle-local_signin/events","assignees_url":"https://api.github.com/repos/LukeCarrier/moodle-local_signin/assignees{/user}","branches_url":"https://api.github.com/repos/LukeCarrier/moodle-local_signin/branches{/branch}","tags_url":"https://api.github.com/repos/LukeCarrier/moodle-local_signin/tags","blobs_url":"https://api.github.com/repos/LukeCarrier/moodle-local_signin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/LukeCarrier/moodle-local_signin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/LukeCarrier/moodle-local_signin/git/refs{/sha}","trees_url":"https://api.github.com/repos/LukeCarrier/moodle-local_signin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/LukeCarrier/moodle-local_signin/statuses/{sha}","languages_url":"https://api.github.com/repos/LukeCarrier/moodle-local_signin/languages","stargazers_url":"https://api.github.com/repos/LukeCarrier/moodle-local_signin/stargazers","contributors_url":"https://api.github.com/repos/LukeCarrier/moodle-local_signin/contributors","subscribers_url":"https://api.github.com/repos/LukeCarrier/moodle-local_signin/subscribers","subscription_url":"https://api.github.com/repos/LukeCarrier/moodle-local_signin/subscription","commits_url":"https://api.github.com/repos/LukeCarrier/moodle-local_signin/commits{/sha}","git_commits_url":"https://api.github.com/repos/LukeCarrier/moodle-local_signin/git/commits{/sha}","comments_url":"https://api.github.com/repos/LukeCarrier/moodle-local_signin/comments{/number}","issue_comment_url":"https://api.github.com/repos/LukeCarrier/moodle-local_signin/issues/comments{/number}","contents_url":"https://api.github.com/repos/LukeCarrier/moodle-local_signin/contents/{+path}","compare_url":"https://api.github.com/repos/LukeCarrier/moodle-local_signin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/LukeCarrier/moodle-local_signin/merges","archive_url":"https://api.github.com/repos/LukeCarrier/moodle-local_signin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/LukeCarrier/moodle-local_signin/downloads","issues_url":"https://api.github.com/repos/LukeCarrier/moodle-local_signin/issues{/number}","pulls_url":"https://api.github.com/repos/LukeCarrier/moodle-local_signin/pulls{/number}","milestones_url":"https://api.github.com/repos/LukeCarrier/moodle-local_signin/milestones{/number}","notifications_url":"https://api.github.com/repos/LukeCarrier/moodle-local_signin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/LukeCarrier/moodle-local_signin/labels{/name}","releases_url":"https://api.github.com/repos/LukeCarrier/moodle-local_signin/releases{/id}","deployments_url":"https://api.github.com/repos/LukeCarrier/moodle-local_signin/deployments","created_at":"2017-02-21T22:31:30Z","updated_at":"2017-02-21T22:31:41Z","pushed_at":"2017-11-07T14:25:18Z","git_url":"git://github.com/LukeCarrier/moodle-local_signin.git","ssh_url":"git@github.com:LukeCarrier/moodle-local_signin.git","clone_url":"https://github.com/LukeCarrier/moodle-local_signin.git","svn_url":"https://github.com/LukeCarrier/moodle-local_signin","homepage":null,"size":23,"stargazers_count":0,"watchers_count":0,"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":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/LukeCarrier/moodle-local_signin/pulls/1"},"html":{"href":"https://github.com/LukeCarrier/moodle-local_signin/pull/1"},"issue":{"href":"https://api.github.com/repos/LukeCarrier/moodle-local_signin/issues/1"},"comments":{"href":"https://api.github.com/repos/LukeCarrier/moodle-local_signin/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/LukeCarrier/moodle-local_signin/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/LukeCarrier/moodle-local_signin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/LukeCarrier/moodle-local_signin/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/LukeCarrier/moodle-local_signin/statuses/16920358c5e6f72f0b448b69be686c9ebda86f02"}},"author_association":"NONE"}}
{"actor":{"display_login":"LukeCarrier"}}