{"action":"created","comment":{"url":"https://api.github.com/repos/ox-it/sakai/pulls/comments/75888622","id":75888622,"diff_hunk":"@@ -0,0 +1,44 @@\n+package org.sakaiproject.profile2.tool.components;\n+\n+import org.apache.wicket.validation.IValidatable;\n+import org.apache.wicket.validation.Validatable;\n+import org.apache.wicket.validation.validator.AbstractValidator;\n+import org.apache.wicket.validation.validator.EmailAddressValidator;\n+import org.sakaiproject.component.cover.ServerConfigurationService;\n+import org.sakaiproject.util.Validator;\n+\n+import java.util.Map;\n+\n+/**\n+ * Validator for email address in profile\n+ * uses Wicket's EmailAddressValidator for email format check and kernel's\n+ * Validator to check if the email address is of local domain or not.\n+ */\n+public class EmailValidator extends AbstractValidator {\n+\tprivate static final long serialVersionUID = 1L;\n+\tprivate static final String OFFICIAL_USER_NAME = \"Official Username\";\n+\n+\tpublic void onValidate(IValidatable validatable) {\n+\t\tString emailText = (String)validatable.getValue();\n+\t\tMap map = super.variablesMap(validatable);\n+\t\t//Check first if the email address is of correct format\n+\t\tif (isValidEmailAddress(emailText)) {\n+\t\t\t//check if email address contains any of accepted local/official hosts\n+\t\t\tif(!Validator.isAllowedLocalEmailDomain(emailText)){\n+\t\t\t\tmap.put(\"invalidAccount\", ServerConfigurationService.getString(\"invalidNonOfficialAccountString\"));\n+\t\t\t\tmap.put(\"localAccount\", ServerConfigurationService.getString(\"localUserAccount\", OFFICIAL_USER_NAME));\n+\t\t\t\terror(validatable, getClass().getSimpleName() + \".profile.emailbaddomain\", map);\n+\t\t\t}\n+\t\t}","path":"profile2/tool/src/java/org/sakaiproject/profile2/tool/components/EmailValidator.java","position":32,"original_position":32,"commit_id":"488560f5851640aa5bf85b0df45d701daa64d8be","original_commit_id":"488560f5851640aa5bf85b0df45d701daa64d8be","user":{"login":"buckett","id":5921,"avatar_url":"https://avatars.githubusercontent.com/u/5921?v=3","gravatar_id":"","url":"https://api.github.com/users/buckett","html_url":"https://github.com/buckett","followers_url":"https://api.github.com/users/buckett/followers","following_url":"https://api.github.com/users/buckett/following{/other_user}","gists_url":"https://api.github.com/users/buckett/gists{/gist_id}","starred_url":"https://api.github.com/users/buckett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/buckett/subscriptions","organizations_url":"https://api.github.com/users/buckett/orgs","repos_url":"https://api.github.com/users/buckett/repos","events_url":"https://api.github.com/users/buckett/events{/privacy}","received_events_url":"https://api.github.com/users/buckett/received_events","type":"User","site_admin":false},"body":"Could you match the style of the project.","created_at":"2016-08-23T15:19:55Z","updated_at":"2016-08-23T15:19:55Z","html_url":"https://github.com/ox-it/sakai/pull/145#discussion_r75888622","pull_request_url":"https://api.github.com/repos/ox-it/sakai/pulls/145","_links":{"self":{"href":"https://api.github.com/repos/ox-it/sakai/pulls/comments/75888622"},"html":{"href":"https://github.com/ox-it/sakai/pull/145#discussion_r75888622"},"pull_request":{"href":"https://api.github.com/repos/ox-it/sakai/pulls/145"}}},"pull_request":{"url":"https://api.github.com/repos/ox-it/sakai/pulls/145","id":82371070,"html_url":"https://github.com/ox-it/sakai/pull/145","diff_url":"https://github.com/ox-it/sakai/pull/145.diff","patch_url":"https://github.com/ox-it/sakai/pull/145.patch","issue_url":"https://api.github.com/repos/ox-it/sakai/issues/145","number":145,"state":"open","locked":false,"title":"WL-4148 Added email domain validator in profile tool.","user":{"login":"ouit0408","id":13135327,"avatar_url":"https://avatars.githubusercontent.com/u/13135327?v=3","gravatar_id":"","url":"https://api.github.com/users/ouit0408","html_url":"https://github.com/ouit0408","followers_url":"https://api.github.com/users/ouit0408/followers","following_url":"https://api.github.com/users/ouit0408/following{/other_user}","gists_url":"https://api.github.com/users/ouit0408/gists{/gist_id}","starred_url":"https://api.github.com/users/ouit0408/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ouit0408/subscriptions","organizations_url":"https://api.github.com/users/ouit0408/orgs","repos_url":"https://api.github.com/users/ouit0408/repos","events_url":"https://api.github.com/users/ouit0408/events{/privacy}","received_events_url":"https://api.github.com/users/ouit0408/received_events","type":"User","site_admin":false},"body":"Created new EmailValidator class for validating email in profile.It uses\r\nWicket's EmailAddressValidator to check the format of email and Kernel's\r\nValidator class to check for the valid domain.\r\n\r\nRemoved duplicate 'official.user.name' from admin.properties in user tool.","created_at":"2016-08-23T14:05:04Z","updated_at":"2016-08-23T15:19:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c0902d541dc99ade3e27db0621018304d6948a25","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/ox-it/sakai/pulls/145/commits","review_comments_url":"https://api.github.com/repos/ox-it/sakai/pulls/145/comments","review_comment_url":"https://api.github.com/repos/ox-it/sakai/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ox-it/sakai/issues/145/comments","statuses_url":"https://api.github.com/repos/ox-it/sakai/statuses/488560f5851640aa5bf85b0df45d701daa64d8be","head":{"label":"ox-it:WL-4148","ref":"WL-4148","sha":"488560f5851640aa5bf85b0df45d701daa64d8be","user":{"login":"ox-it","id":351950,"avatar_url":"https://avatars.githubusercontent.com/u/351950?v=3","gravatar_id":"","url":"https://api.github.com/users/ox-it","html_url":"https://github.com/ox-it","followers_url":"https://api.github.com/users/ox-it/followers","following_url":"https://api.github.com/users/ox-it/following{/other_user}","gists_url":"https://api.github.com/users/ox-it/gists{/gist_id}","starred_url":"https://api.github.com/users/ox-it/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ox-it/subscriptions","organizations_url":"https://api.github.com/users/ox-it/orgs","repos_url":"https://api.github.com/users/ox-it/repos","events_url":"https://api.github.com/users/ox-it/events{/privacy}","received_events_url":"https://api.github.com/users/ox-it/received_events","type":"Organization","site_admin":false},"repo":{"id":40708205,"name":"sakai","full_name":"ox-it/sakai","owner":{"login":"ox-it","id":351950,"avatar_url":"https://avatars.githubusercontent.com/u/351950?v=3","gravatar_id":"","url":"https://api.github.com/users/ox-it","html_url":"https://github.com/ox-it","followers_url":"https://api.github.com/users/ox-it/followers","following_url":"https://api.github.com/users/ox-it/following{/other_user}","gists_url":"https://api.github.com/users/ox-it/gists{/gist_id}","starred_url":"https://api.github.com/users/ox-it/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ox-it/subscriptions","organizations_url":"https://api.github.com/users/ox-it/orgs","repos_url":"https://api.github.com/users/ox-it/repos","events_url":"https://api.github.com/users/ox-it/events{/privacy}","received_events_url":"https://api.github.com/users/ox-it/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ox-it/sakai","description":"Oxford's deployment of Sakai","fork":false,"url":"https://api.github.com/repos/ox-it/sakai","forks_url":"https://api.github.com/repos/ox-it/sakai/forks","keys_url":"https://api.github.com/repos/ox-it/sakai/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ox-it/sakai/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ox-it/sakai/teams","hooks_url":"https://api.github.com/repos/ox-it/sakai/hooks","issue_events_url":"https://api.github.com/repos/ox-it/sakai/issues/events{/number}","events_url":"https://api.github.com/repos/ox-it/sakai/events","assignees_url":"https://api.github.com/repos/ox-it/sakai/assignees{/user}","branches_url":"https://api.github.com/repos/ox-it/sakai/branches{/branch}","tags_url":"https://api.github.com/repos/ox-it/sakai/tags","blobs_url":"https://api.github.com/repos/ox-it/sakai/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ox-it/sakai/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ox-it/sakai/git/refs{/sha}","trees_url":"https://api.github.com/repos/ox-it/sakai/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ox-it/sakai/statuses/{sha}","languages_url":"https://api.github.com/repos/ox-it/sakai/languages","stargazers_url":"https://api.github.com/repos/ox-it/sakai/stargazers","contributors_url":"https://api.github.com/repos/ox-it/sakai/contributors","subscribers_url":"https://api.github.com/repos/ox-it/sakai/subscribers","subscription_url":"https://api.github.com/repos/ox-it/sakai/subscription","commits_url":"https://api.github.com/repos/ox-it/sakai/commits{/sha}","git_commits_url":"https://api.github.com/repos/ox-it/sakai/git/commits{/sha}","comments_url":"https://api.github.com/repos/ox-it/sakai/comments{/number}","issue_comment_url":"https://api.github.com/repos/ox-it/sakai/issues/comments{/number}","contents_url":"https://api.github.com/repos/ox-it/sakai/contents/{+path}","compare_url":"https://api.github.com/repos/ox-it/sakai/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ox-it/sakai/merges","archive_url":"https://api.github.com/repos/ox-it/sakai/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ox-it/sakai/downloads","issues_url":"https://api.github.com/repos/ox-it/sakai/issues{/number}","pulls_url":"https://api.github.com/repos/ox-it/sakai/pulls{/number}","milestones_url":"https://api.github.com/repos/ox-it/sakai/milestones{/number}","notifications_url":"https://api.github.com/repos/ox-it/sakai/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ox-it/sakai/labels{/name}","releases_url":"https://api.github.com/repos/ox-it/sakai/releases{/id}","deployments_url":"https://api.github.com/repos/ox-it/sakai/deployments","created_at":"2015-08-14T09:54:32Z","updated_at":"2016-08-17T10:06:07Z","pushed_at":"2016-08-23T15:13:52Z","git_url":"git://github.com/ox-it/sakai.git","ssh_url":"git@github.com:ox-it/sakai.git","clone_url":"https://github.com/ox-it/sakai.git","svn_url":"https://github.com/ox-it/sakai","homepage":"https://weblearn.ox.ac.uk/","size":324799,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":6,"forks":3,"open_issues":6,"watchers":0,"default_branch":"11.x"}},"base":{"label":"ox-it:11.x","ref":"11.x","sha":"e0cb577c3cd41b06f807d5a1d8624af8a14b2385","user":{"login":"ox-it","id":351950,"avatar_url":"https://avatars.githubusercontent.com/u/351950?v=3","gravatar_id":"","url":"https://api.github.com/users/ox-it","html_url":"https://github.com/ox-it","followers_url":"https://api.github.com/users/ox-it/followers","following_url":"https://api.github.com/users/ox-it/following{/other_user}","gists_url":"https://api.github.com/users/ox-it/gists{/gist_id}","starred_url":"https://api.github.com/users/ox-it/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ox-it/subscriptions","organizations_url":"https://api.github.com/users/ox-it/orgs","repos_url":"https://api.github.com/users/ox-it/repos","events_url":"https://api.github.com/users/ox-it/events{/privacy}","received_events_url":"https://api.github.com/users/ox-it/received_events","type":"Organization","site_admin":false},"repo":{"id":40708205,"name":"sakai","full_name":"ox-it/sakai","owner":{"login":"ox-it","id":351950,"avatar_url":"https://avatars.githubusercontent.com/u/351950?v=3","gravatar_id":"","url":"https://api.github.com/users/ox-it","html_url":"https://github.com/ox-it","followers_url":"https://api.github.com/users/ox-it/followers","following_url":"https://api.github.com/users/ox-it/following{/other_user}","gists_url":"https://api.github.com/users/ox-it/gists{/gist_id}","starred_url":"https://api.github.com/users/ox-it/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ox-it/subscriptions","organizations_url":"https://api.github.com/users/ox-it/orgs","repos_url":"https://api.github.com/users/ox-it/repos","events_url":"https://api.github.com/users/ox-it/events{/privacy}","received_events_url":"https://api.github.com/users/ox-it/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ox-it/sakai","description":"Oxford's deployment of Sakai","fork":false,"url":"https://api.github.com/repos/ox-it/sakai","forks_url":"https://api.github.com/repos/ox-it/sakai/forks","keys_url":"https://api.github.com/repos/ox-it/sakai/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ox-it/sakai/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ox-it/sakai/teams","hooks_url":"https://api.github.com/repos/ox-it/sakai/hooks","issue_events_url":"https://api.github.com/repos/ox-it/sakai/issues/events{/number}","events_url":"https://api.github.com/repos/ox-it/sakai/events","assignees_url":"https://api.github.com/repos/ox-it/sakai/assignees{/user}","branches_url":"https://api.github.com/repos/ox-it/sakai/branches{/branch}","tags_url":"https://api.github.com/repos/ox-it/sakai/tags","blobs_url":"https://api.github.com/repos/ox-it/sakai/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ox-it/sakai/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ox-it/sakai/git/refs{/sha}","trees_url":"https://api.github.com/repos/ox-it/sakai/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ox-it/sakai/statuses/{sha}","languages_url":"https://api.github.com/repos/ox-it/sakai/languages","stargazers_url":"https://api.github.com/repos/ox-it/sakai/stargazers","contributors_url":"https://api.github.com/repos/ox-it/sakai/contributors","subscribers_url":"https://api.github.com/repos/ox-it/sakai/subscribers","subscription_url":"https://api.github.com/repos/ox-it/sakai/subscription","commits_url":"https://api.github.com/repos/ox-it/sakai/commits{/sha}","git_commits_url":"https://api.github.com/repos/ox-it/sakai/git/commits{/sha}","comments_url":"https://api.github.com/repos/ox-it/sakai/comments{/number}","issue_comment_url":"https://api.github.com/repos/ox-it/sakai/issues/comments{/number}","contents_url":"https://api.github.com/repos/ox-it/sakai/contents/{+path}","compare_url":"https://api.github.com/repos/ox-it/sakai/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ox-it/sakai/merges","archive_url":"https://api.github.com/repos/ox-it/sakai/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ox-it/sakai/downloads","issues_url":"https://api.github.com/repos/ox-it/sakai/issues{/number}","pulls_url":"https://api.github.com/repos/ox-it/sakai/pulls{/number}","milestones_url":"https://api.github.com/repos/ox-it/sakai/milestones{/number}","notifications_url":"https://api.github.com/repos/ox-it/sakai/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ox-it/sakai/labels{/name}","releases_url":"https://api.github.com/repos/ox-it/sakai/releases{/id}","deployments_url":"https://api.github.com/repos/ox-it/sakai/deployments","created_at":"2015-08-14T09:54:32Z","updated_at":"2016-08-17T10:06:07Z","pushed_at":"2016-08-23T15:13:52Z","git_url":"git://github.com/ox-it/sakai.git","ssh_url":"git@github.com:ox-it/sakai.git","clone_url":"https://github.com/ox-it/sakai.git","svn_url":"https://github.com/ox-it/sakai","homepage":"https://weblearn.ox.ac.uk/","size":324799,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":6,"forks":3,"open_issues":6,"watchers":0,"default_branch":"11.x"}},"_links":{"self":{"href":"https://api.github.com/repos/ox-it/sakai/pulls/145"},"html":{"href":"https://github.com/ox-it/sakai/pull/145"},"issue":{"href":"https://api.github.com/repos/ox-it/sakai/issues/145"},"comments":{"href":"https://api.github.com/repos/ox-it/sakai/issues/145/comments"},"review_comments":{"href":"https://api.github.com/repos/ox-it/sakai/pulls/145/comments"},"review_comment":{"href":"https://api.github.com/repos/ox-it/sakai/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ox-it/sakai/pulls/145/commits"},"statuses":{"href":"https://api.github.com/repos/ox-it/sakai/statuses/488560f5851640aa5bf85b0df45d701daa64d8be"}}}}
{"actor":{"display_login":"buckett"}}