{"action":"created","comment":{"url":"https://api.github.com/repos/fsi-open/admin-security-bundle/pulls/comments/35851080","id":35851080,"diff_hunk":"@@ -0,0 +1,60 @@\n+<?php\n+\n+namespace FSi\\Bundle\\AdminSecurityBundle\\EventListener;\n+\n+use FSi\\Bundle\\AdminSecurityBundle\\Event\\AdminSecurityEvents;\n+use FSi\\Bundle\\AdminSecurityBundle\\Event\\ChangePasswordEvent;\n+use FSi\\Bundle\\AdminSecurityBundle\\Security\\User\\UserInterface;\n+use FSi\\Bundle\\AdminSecurityBundle\\Security\\User\\UserPasswordChangeInterface;\n+use Symfony\\Component\\EventDispatcher\\EventSubscriberInterface;\n+use Symfony\\Component\\Security\\Core\\Encoder\\EncoderFactoryInterface;\n+use Symfony\\Component\\Security\\Core\\Encoder\\PasswordEncoderInterface;\n+\n+class UserEncodePasswordListener implements EventSubscriberInterface\n+{\n+    /**\n+     * @var EncoderFactoryInterface\n+     */\n+    private $encoderFactory;\n+\n+    public function __construct(EncoderFactoryInterface $encoderFactory)\n+    {\n+        $this->encoderFactory = $encoderFactory;\n+    }\n+\n+    public static function getSubscribedEvents()\n+    {\n+        return array(\n+            AdminSecurityEvents::CHANGE_PASSWORD => 'onChangePassword'\n+        );\n+    }\n+\n+    /**\n+     * @param ChangePasswordEvent $event\n+     */\n+    public function onChangePassword(ChangePasswordEvent $event)\n+    {\n+        $this->updateUserPassword($event->getUser());\n+    }\n+\n+    /**\n+     * @param UserPasswordChangeInterface $user\n+     */\n+    protected function updateUserPassword(UserPasswordChangeInterface $user)\n+    {\n+        if (0 !== strlen($password = $user->getPlainPassword())) {","path":"EventListener/UserEncodePasswordListener.php","position":45,"original_position":45,"commit_id":"347267a643a8d251588f6f5999aa279786cd9e90","original_commit_id":"347267a643a8d251588f6f5999aa279786cd9e90","user":{"login":"szymach","id":2230556,"avatar_url":"https://avatars.githubusercontent.com/u/2230556?v=3","gravatar_id":"","url":"https://api.github.com/users/szymach","html_url":"https://github.com/szymach","followers_url":"https://api.github.com/users/szymach/followers","following_url":"https://api.github.com/users/szymach/following{/other_user}","gists_url":"https://api.github.com/users/szymach/gists{/gist_id}","starred_url":"https://api.github.com/users/szymach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/szymach/subscriptions","organizations_url":"https://api.github.com/users/szymach/orgs","repos_url":"https://api.github.com/users/szymach/repos","events_url":"https://api.github.com/users/szymach/events{/privacy}","received_events_url":"https://api.github.com/users/szymach/received_events","type":"User","site_admin":false},"body":"it wouldn't hurt to require at least 6 character password","created_at":"2015-07-30T08:59:35Z","updated_at":"2015-07-30T08:59:35Z","html_url":"https://github.com/fsi-open/admin-security-bundle/pull/33#discussion_r35851080","pull_request_url":"https://api.github.com/repos/fsi-open/admin-security-bundle/pulls/33","_links":{"self":{"href":"https://api.github.com/repos/fsi-open/admin-security-bundle/pulls/comments/35851080"},"html":{"href":"https://github.com/fsi-open/admin-security-bundle/pull/33#discussion_r35851080"},"pull_request":{"href":"https://api.github.com/repos/fsi-open/admin-security-bundle/pulls/33"}}},"pull_request":{"url":"https://api.github.com/repos/fsi-open/admin-security-bundle/pulls/33","id":41103841,"html_url":"https://github.com/fsi-open/admin-security-bundle/pull/33","diff_url":"https://github.com/fsi-open/admin-security-bundle/pull/33.diff","patch_url":"https://github.com/fsi-open/admin-security-bundle/pull/33.patch","issue_url":"https://api.github.com/repos/fsi-open/admin-security-bundle/issues/33","number":33,"state":"open","locked":false,"title":"Removed FOSUserBundle","user":{"login":"chives","id":1170578,"avatar_url":"https://avatars.githubusercontent.com/u/1170578?v=3","gravatar_id":"","url":"https://api.github.com/users/chives","html_url":"https://github.com/chives","followers_url":"https://api.github.com/users/chives/followers","following_url":"https://api.github.com/users/chives/following{/other_user}","gists_url":"https://api.github.com/users/chives/gists{/gist_id}","starred_url":"https://api.github.com/users/chives/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chives/subscriptions","organizations_url":"https://api.github.com/users/chives/orgs","repos_url":"https://api.github.com/users/chives/repos","events_url":"https://api.github.com/users/chives/events{/privacy}","received_events_url":"https://api.github.com/users/chives/received_events","type":"User","site_admin":false},"body":"Reimplemented password reset and password change without FOSUB but the bundle is still compatible with it.","created_at":"2015-07-29T09:37:51Z","updated_at":"2015-07-30T08:59:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"37733087250c7466e9cb65014f59a23f01d7575c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/fsi-open/admin-security-bundle/pulls/33/commits","review_comments_url":"https://api.github.com/repos/fsi-open/admin-security-bundle/pulls/33/comments","review_comment_url":"https://api.github.com/repos/fsi-open/admin-security-bundle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fsi-open/admin-security-bundle/issues/33/comments","statuses_url":"https://api.github.com/repos/fsi-open/admin-security-bundle/statuses/347267a643a8d251588f6f5999aa279786cd9e90","head":{"label":"chives:dev","ref":"dev","sha":"347267a643a8d251588f6f5999aa279786cd9e90","user":{"login":"chives","id":1170578,"avatar_url":"https://avatars.githubusercontent.com/u/1170578?v=3","gravatar_id":"","url":"https://api.github.com/users/chives","html_url":"https://github.com/chives","followers_url":"https://api.github.com/users/chives/followers","following_url":"https://api.github.com/users/chives/following{/other_user}","gists_url":"https://api.github.com/users/chives/gists{/gist_id}","starred_url":"https://api.github.com/users/chives/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chives/subscriptions","organizations_url":"https://api.github.com/users/chives/orgs","repos_url":"https://api.github.com/users/chives/repos","events_url":"https://api.github.com/users/chives/events{/privacy}","received_events_url":"https://api.github.com/users/chives/received_events","type":"User","site_admin":false},"repo":{"id":17407235,"name":"admin-security-bundle","full_name":"chives/admin-security-bundle","owner":{"login":"chives","id":1170578,"avatar_url":"https://avatars.githubusercontent.com/u/1170578?v=3","gravatar_id":"","url":"https://api.github.com/users/chives","html_url":"https://github.com/chives","followers_url":"https://api.github.com/users/chives/followers","following_url":"https://api.github.com/users/chives/following{/other_user}","gists_url":"https://api.github.com/users/chives/gists{/gist_id}","starred_url":"https://api.github.com/users/chives/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chives/subscriptions","organizations_url":"https://api.github.com/users/chives/orgs","repos_url":"https://api.github.com/users/chives/repos","events_url":"https://api.github.com/users/chives/events{/privacy}","received_events_url":"https://api.github.com/users/chives/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/chives/admin-security-bundle","description":"Purpose of this bundle is to provide simple authentication & authorization mechanisms for fsi/admin-bundle","fork":true,"url":"https://api.github.com/repos/chives/admin-security-bundle","forks_url":"https://api.github.com/repos/chives/admin-security-bundle/forks","keys_url":"https://api.github.com/repos/chives/admin-security-bundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chives/admin-security-bundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chives/admin-security-bundle/teams","hooks_url":"https://api.github.com/repos/chives/admin-security-bundle/hooks","issue_events_url":"https://api.github.com/repos/chives/admin-security-bundle/issues/events{/number}","events_url":"https://api.github.com/repos/chives/admin-security-bundle/events","assignees_url":"https://api.github.com/repos/chives/admin-security-bundle/assignees{/user}","branches_url":"https://api.github.com/repos/chives/admin-security-bundle/branches{/branch}","tags_url":"https://api.github.com/repos/chives/admin-security-bundle/tags","blobs_url":"https://api.github.com/repos/chives/admin-security-bundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chives/admin-security-bundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chives/admin-security-bundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/chives/admin-security-bundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chives/admin-security-bundle/statuses/{sha}","languages_url":"https://api.github.com/repos/chives/admin-security-bundle/languages","stargazers_url":"https://api.github.com/repos/chives/admin-security-bundle/stargazers","contributors_url":"https://api.github.com/repos/chives/admin-security-bundle/contributors","subscribers_url":"https://api.github.com/repos/chives/admin-security-bundle/subscribers","subscription_url":"https://api.github.com/repos/chives/admin-security-bundle/subscription","commits_url":"https://api.github.com/repos/chives/admin-security-bundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/chives/admin-security-bundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/chives/admin-security-bundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/chives/admin-security-bundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/chives/admin-security-bundle/contents/{+path}","compare_url":"https://api.github.com/repos/chives/admin-security-bundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chives/admin-security-bundle/merges","archive_url":"https://api.github.com/repos/chives/admin-security-bundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chives/admin-security-bundle/downloads","issues_url":"https://api.github.com/repos/chives/admin-security-bundle/issues{/number}","pulls_url":"https://api.github.com/repos/chives/admin-security-bundle/pulls{/number}","milestones_url":"https://api.github.com/repos/chives/admin-security-bundle/milestones{/number}","notifications_url":"https://api.github.com/repos/chives/admin-security-bundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chives/admin-security-bundle/labels{/name}","releases_url":"https://api.github.com/repos/chives/admin-security-bundle/releases{/id}","created_at":"2014-03-04T15:42:01Z","updated_at":"2014-03-25T08:53:10Z","pushed_at":"2015-07-21T10:51:28Z","git_url":"git://github.com/chives/admin-security-bundle.git","ssh_url":"git@github.com:chives/admin-security-bundle.git","clone_url":"https://github.com/chives/admin-security-bundle.git","svn_url":"https://github.com/chives/admin-security-bundle","homepage":null,"size":328,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"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":"fsi-open:remove-fosub","ref":"remove-fosub","sha":"d7362e8ec74d7a5dc8d60911d5076ec964f893c9","user":{"login":"fsi-open","id":2317182,"avatar_url":"https://avatars.githubusercontent.com/u/2317182?v=3","gravatar_id":"","url":"https://api.github.com/users/fsi-open","html_url":"https://github.com/fsi-open","followers_url":"https://api.github.com/users/fsi-open/followers","following_url":"https://api.github.com/users/fsi-open/following{/other_user}","gists_url":"https://api.github.com/users/fsi-open/gists{/gist_id}","starred_url":"https://api.github.com/users/fsi-open/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fsi-open/subscriptions","organizations_url":"https://api.github.com/users/fsi-open/orgs","repos_url":"https://api.github.com/users/fsi-open/repos","events_url":"https://api.github.com/users/fsi-open/events{/privacy}","received_events_url":"https://api.github.com/users/fsi-open/received_events","type":"Organization","site_admin":false},"repo":{"id":15117760,"name":"admin-security-bundle","full_name":"fsi-open/admin-security-bundle","owner":{"login":"fsi-open","id":2317182,"avatar_url":"https://avatars.githubusercontent.com/u/2317182?v=3","gravatar_id":"","url":"https://api.github.com/users/fsi-open","html_url":"https://github.com/fsi-open","followers_url":"https://api.github.com/users/fsi-open/followers","following_url":"https://api.github.com/users/fsi-open/following{/other_user}","gists_url":"https://api.github.com/users/fsi-open/gists{/gist_id}","starred_url":"https://api.github.com/users/fsi-open/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fsi-open/subscriptions","organizations_url":"https://api.github.com/users/fsi-open/orgs","repos_url":"https://api.github.com/users/fsi-open/repos","events_url":"https://api.github.com/users/fsi-open/events{/privacy}","received_events_url":"https://api.github.com/users/fsi-open/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fsi-open/admin-security-bundle","description":"Purpose of this bundle is to provide simple authentication & authorization mechanisms for fsi/admin-bundle","fork":false,"url":"https://api.github.com/repos/fsi-open/admin-security-bundle","forks_url":"https://api.github.com/repos/fsi-open/admin-security-bundle/forks","keys_url":"https://api.github.com/repos/fsi-open/admin-security-bundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fsi-open/admin-security-bundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fsi-open/admin-security-bundle/teams","hooks_url":"https://api.github.com/repos/fsi-open/admin-security-bundle/hooks","issue_events_url":"https://api.github.com/repos/fsi-open/admin-security-bundle/issues/events{/number}","events_url":"https://api.github.com/repos/fsi-open/admin-security-bundle/events","assignees_url":"https://api.github.com/repos/fsi-open/admin-security-bundle/assignees{/user}","branches_url":"https://api.github.com/repos/fsi-open/admin-security-bundle/branches{/branch}","tags_url":"https://api.github.com/repos/fsi-open/admin-security-bundle/tags","blobs_url":"https://api.github.com/repos/fsi-open/admin-security-bundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fsi-open/admin-security-bundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fsi-open/admin-security-bundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/fsi-open/admin-security-bundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fsi-open/admin-security-bundle/statuses/{sha}","languages_url":"https://api.github.com/repos/fsi-open/admin-security-bundle/languages","stargazers_url":"https://api.github.com/repos/fsi-open/admin-security-bundle/stargazers","contributors_url":"https://api.github.com/repos/fsi-open/admin-security-bundle/contributors","subscribers_url":"https://api.github.com/repos/fsi-open/admin-security-bundle/subscribers","subscription_url":"https://api.github.com/repos/fsi-open/admin-security-bundle/subscription","commits_url":"https://api.github.com/repos/fsi-open/admin-security-bundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/fsi-open/admin-security-bundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/fsi-open/admin-security-bundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/fsi-open/admin-security-bundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/fsi-open/admin-security-bundle/contents/{+path}","compare_url":"https://api.github.com/repos/fsi-open/admin-security-bundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fsi-open/admin-security-bundle/merges","archive_url":"https://api.github.com/repos/fsi-open/admin-security-bundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fsi-open/admin-security-bundle/downloads","issues_url":"https://api.github.com/repos/fsi-open/admin-security-bundle/issues{/number}","pulls_url":"https://api.github.com/repos/fsi-open/admin-security-bundle/pulls{/number}","milestones_url":"https://api.github.com/repos/fsi-open/admin-security-bundle/milestones{/number}","notifications_url":"https://api.github.com/repos/fsi-open/admin-security-bundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fsi-open/admin-security-bundle/labels{/name}","releases_url":"https://api.github.com/repos/fsi-open/admin-security-bundle/releases{/id}","created_at":"2013-12-11T20:10:15Z","updated_at":"2015-04-30T11:32:55Z","pushed_at":"2015-07-29T09:37:52Z","git_url":"git://github.com/fsi-open/admin-security-bundle.git","ssh_url":"git@github.com:fsi-open/admin-security-bundle.git","clone_url":"https://github.com/fsi-open/admin-security-bundle.git","svn_url":"https://github.com/fsi-open/admin-security-bundle","homepage":null,"size":556,"stargazers_count":4,"watchers_count":4,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":3,"forks":6,"open_issues":3,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fsi-open/admin-security-bundle/pulls/33"},"html":{"href":"https://github.com/fsi-open/admin-security-bundle/pull/33"},"issue":{"href":"https://api.github.com/repos/fsi-open/admin-security-bundle/issues/33"},"comments":{"href":"https://api.github.com/repos/fsi-open/admin-security-bundle/issues/33/comments"},"review_comments":{"href":"https://api.github.com/repos/fsi-open/admin-security-bundle/pulls/33/comments"},"review_comment":{"href":"https://api.github.com/repos/fsi-open/admin-security-bundle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fsi-open/admin-security-bundle/pulls/33/commits"},"statuses":{"href":"https://api.github.com/repos/fsi-open/admin-security-bundle/statuses/347267a643a8d251588f6f5999aa279786cd9e90"}}}}