{"action":"created","comment":{"url":"https://api.github.com/repos/ubccr/xdmod/pulls/comments/124851741","pull_request_review_id":47182718,"id":124851741,"diff_hunk":"@@ -174,8 +157,37 @@ private function notifyAdminOfNewUser($user, $samlAttributes, $linked, $error =\n                 print_r($samlAttributes, true);\n         }\n \n-        $mail->Body = $body;\n+        $shouldAddReply = false;\n+\n+        if ($userEmail != NO_EMAIL_ADDRESS_SET) {\n+            $shouldAddReply = true;\n+        }\n+\n+        $recipient\n+        = (xd_utilities\\getConfiguration('general', 'debug_mode') == 'on')\n+        ? xd_utilities\\getConfiguration('general', 'debug_recipient')\n+        : xd_utilities\\getConfiguration('general', 'contact_page_recipient');\n+\n+        if ($error) {\n+            $subject = \"[xdmod] Error Creating federated user\";\n+        } else {\n+            $subject = \"[xdmod] New \" . ($linked ? \"linked\": \"unlinked\") . \" federated user created\";\n+        }\n+\n+        $properties = array(","path":"classes/Authentication/SAML/XDSamlAuthentication.php","position":46,"original_position":46,"commit_id":"855a1ea98e68bae2836430f73fb00c0f7cc24bb2","original_commit_id":"855a1ea98e68bae2836430f73fb00c0f7cc24bb2","user":{"login":"jpwhite4","id":5342179,"avatar_url":"https://avatars1.githubusercontent.com/u/5342179?v=3","gravatar_id":"","url":"https://api.github.com/users/jpwhite4","html_url":"https://github.com/jpwhite4","followers_url":"https://api.github.com/users/jpwhite4/followers","following_url":"https://api.github.com/users/jpwhite4/following{/other_user}","gists_url":"https://api.github.com/users/jpwhite4/gists{/gist_id}","starred_url":"https://api.github.com/users/jpwhite4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpwhite4/subscriptions","organizations_url":"https://api.github.com/users/jpwhite4/orgs","repos_url":"https://api.github.com/users/jpwhite4/repos","events_url":"https://api.github.com/users/jpwhite4/events{/privacy}","received_events_url":"https://api.github.com/users/jpwhite4/received_events","type":"User","site_admin":false},"body":"This pull request currently adds more required boilerplate code to the source rather than reducing it!\r\n\r\nPlease change this so that you only specify the properties that asre different from the default values.","created_at":"2017-06-29T16:38:23Z","updated_at":"2017-06-29T16:38:26Z","html_url":"https://github.com/ubccr/xdmod/pull/178#discussion_r124851741","pull_request_url":"https://api.github.com/repos/ubccr/xdmod/pulls/178","_links":{"self":{"href":"https://api.github.com/repos/ubccr/xdmod/pulls/comments/124851741"},"html":{"href":"https://github.com/ubccr/xdmod/pull/178#discussion_r124851741"},"pull_request":{"href":"https://api.github.com/repos/ubccr/xdmod/pulls/178"}}},"pull_request":{"url":"https://api.github.com/repos/ubccr/xdmod/pulls/178","id":128183555,"html_url":"https://github.com/ubccr/xdmod/pull/178","diff_url":"https://github.com/ubccr/xdmod/pull/178.diff","patch_url":"https://github.com/ubccr/xdmod/pull/178.patch","issue_url":"https://api.github.com/repos/ubccr/xdmod/issues/178","number":178,"state":"open","locked":false,"title":"Centralized mail-related code","user":{"login":"jpearce185","id":20168776,"avatar_url":"https://avatars3.githubusercontent.com/u/20168776?v=3","gravatar_id":"","url":"https://api.github.com/users/jpearce185","html_url":"https://github.com/jpearce185","followers_url":"https://api.github.com/users/jpearce185/followers","following_url":"https://api.github.com/users/jpearce185/following{/other_user}","gists_url":"https://api.github.com/users/jpearce185/gists{/gist_id}","starred_url":"https://api.github.com/users/jpearce185/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpearce185/subscriptions","organizations_url":"https://api.github.com/users/jpearce185/orgs","repos_url":"https://api.github.com/users/jpearce185/repos","events_url":"https://api.github.com/users/jpearce185/events{/privacy}","received_events_url":"https://api.github.com/users/jpearce185/received_events","type":"User","site_admin":false},"body":"<!--- Provide a general summary of your changes in the Title above -->\r\n\r\n## Description\r\nAny code pertaining to creating/sending emails has been moved into a central location.  This allows each file to have only one mail-related function called in it which will handle all mail-oriented functions.\r\n\r\n## Motivation and Context\r\nThis condenses the amount of code that goes into individual files, and instead puts it all in one file.  This will provide ease when editing code pertaining to mail because it will only need to be done in one place, not several.\r\n\r\n## Tests performed\r\nI started by requesting a password reset from the 'Trouble logging in' section within the 'Log in' window using multiple test emails.  From there I proceeded back into the log in window and signed up using a test email.  From here I logged in using a preexisting test account and created a report via the 'Report Generator' tab.  I then sent the report first as a PDF, and secondly as a Word document.  Next, I opened the 'Contact Us' tab, filled out, and submitted each of the three forms.  I then went into the dashboard and created a new user using a test email, and then sent that new user a password reset email as an admin.  I then logged in as this new test user and repeated the Report Generator and Contact form tests.  I then completely logged out and attempted logging in using federated user credentials to which the response I received back was \"No peer endpoint available to which to send SAML response,\" which is the expected response.\r\n\r\n## Types of changes\r\n<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->\r\n- [ ] Bug fix (non-breaking change which fixes an issue)\r\n- [ ] New feature (non-breaking change which adds functionality)\r\n- [ ] Breaking change (fix or feature that would cause existing functionality to change)\r\n- [x] Code cleanup\r\n\r\n## Checklist:\r\n<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->\r\n<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->\r\n- [x] My code follows the code style of this project as found in the **CONTRIBUTING** document.\r\n- [ ] I have added tests to cover my changes.\r\n- [ ] All new and existing tests passed.\r\n","created_at":"2017-06-29T15:38:45Z","updated_at":"2017-06-29T16:38:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d90b1a68b3ef5e212afdc7c46d3098569de16656","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/ubccr/xdmod/pulls/178/commits","review_comments_url":"https://api.github.com/repos/ubccr/xdmod/pulls/178/comments","review_comment_url":"https://api.github.com/repos/ubccr/xdmod/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ubccr/xdmod/issues/178/comments","statuses_url":"https://api.github.com/repos/ubccr/xdmod/statuses/855a1ea98e68bae2836430f73fb00c0f7cc24bb2","head":{"label":"jpearce185:condense-mail","ref":"condense-mail","sha":"855a1ea98e68bae2836430f73fb00c0f7cc24bb2","user":{"login":"jpearce185","id":20168776,"avatar_url":"https://avatars3.githubusercontent.com/u/20168776?v=3","gravatar_id":"","url":"https://api.github.com/users/jpearce185","html_url":"https://github.com/jpearce185","followers_url":"https://api.github.com/users/jpearce185/followers","following_url":"https://api.github.com/users/jpearce185/following{/other_user}","gists_url":"https://api.github.com/users/jpearce185/gists{/gist_id}","starred_url":"https://api.github.com/users/jpearce185/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpearce185/subscriptions","organizations_url":"https://api.github.com/users/jpearce185/orgs","repos_url":"https://api.github.com/users/jpearce185/repos","events_url":"https://api.github.com/users/jpearce185/events{/privacy}","received_events_url":"https://api.github.com/users/jpearce185/received_events","type":"User","site_admin":false},"repo":{"id":93531291,"name":"xdmod","full_name":"jpearce185/xdmod","owner":{"login":"jpearce185","id":20168776,"avatar_url":"https://avatars3.githubusercontent.com/u/20168776?v=3","gravatar_id":"","url":"https://api.github.com/users/jpearce185","html_url":"https://github.com/jpearce185","followers_url":"https://api.github.com/users/jpearce185/followers","following_url":"https://api.github.com/users/jpearce185/following{/other_user}","gists_url":"https://api.github.com/users/jpearce185/gists{/gist_id}","starred_url":"https://api.github.com/users/jpearce185/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpearce185/subscriptions","organizations_url":"https://api.github.com/users/jpearce185/orgs","repos_url":"https://api.github.com/users/jpearce185/repos","events_url":"https://api.github.com/users/jpearce185/events{/privacy}","received_events_url":"https://api.github.com/users/jpearce185/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jpearce185/xdmod","description":"An open framework for collecting and analyzing HPC metrics.","fork":true,"url":"https://api.github.com/repos/jpearce185/xdmod","forks_url":"https://api.github.com/repos/jpearce185/xdmod/forks","keys_url":"https://api.github.com/repos/jpearce185/xdmod/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jpearce185/xdmod/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jpearce185/xdmod/teams","hooks_url":"https://api.github.com/repos/jpearce185/xdmod/hooks","issue_events_url":"https://api.github.com/repos/jpearce185/xdmod/issues/events{/number}","events_url":"https://api.github.com/repos/jpearce185/xdmod/events","assignees_url":"https://api.github.com/repos/jpearce185/xdmod/assignees{/user}","branches_url":"https://api.github.com/repos/jpearce185/xdmod/branches{/branch}","tags_url":"https://api.github.com/repos/jpearce185/xdmod/tags","blobs_url":"https://api.github.com/repos/jpearce185/xdmod/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jpearce185/xdmod/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jpearce185/xdmod/git/refs{/sha}","trees_url":"https://api.github.com/repos/jpearce185/xdmod/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jpearce185/xdmod/statuses/{sha}","languages_url":"https://api.github.com/repos/jpearce185/xdmod/languages","stargazers_url":"https://api.github.com/repos/jpearce185/xdmod/stargazers","contributors_url":"https://api.github.com/repos/jpearce185/xdmod/contributors","subscribers_url":"https://api.github.com/repos/jpearce185/xdmod/subscribers","subscription_url":"https://api.github.com/repos/jpearce185/xdmod/subscription","commits_url":"https://api.github.com/repos/jpearce185/xdmod/commits{/sha}","git_commits_url":"https://api.github.com/repos/jpearce185/xdmod/git/commits{/sha}","comments_url":"https://api.github.com/repos/jpearce185/xdmod/comments{/number}","issue_comment_url":"https://api.github.com/repos/jpearce185/xdmod/issues/comments{/number}","contents_url":"https://api.github.com/repos/jpearce185/xdmod/contents/{+path}","compare_url":"https://api.github.com/repos/jpearce185/xdmod/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jpearce185/xdmod/merges","archive_url":"https://api.github.com/repos/jpearce185/xdmod/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jpearce185/xdmod/downloads","issues_url":"https://api.github.com/repos/jpearce185/xdmod/issues{/number}","pulls_url":"https://api.github.com/repos/jpearce185/xdmod/pulls{/number}","milestones_url":"https://api.github.com/repos/jpearce185/xdmod/milestones{/number}","notifications_url":"https://api.github.com/repos/jpearce185/xdmod/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jpearce185/xdmod/labels{/name}","releases_url":"https://api.github.com/repos/jpearce185/xdmod/releases{/id}","deployments_url":"https://api.github.com/repos/jpearce185/xdmod/deployments","created_at":"2017-06-06T15:01:58Z","updated_at":"2017-06-06T15:02:02Z","pushed_at":"2017-06-29T15:43:45Z","git_url":"git://github.com/jpearce185/xdmod.git","ssh_url":"git@github.com:jpearce185/xdmod.git","clone_url":"https://github.com/jpearce185/xdmod.git","svn_url":"https://github.com/jpearce185/xdmod","homepage":"http://open.xdmod.org","size":4982,"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,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"xdmod6.7"}},"base":{"label":"ubccr:xdmod7.0","ref":"xdmod7.0","sha":"ba7f68fb3534e020eed6ca252fb8bc5cbb9af2df","user":{"login":"ubccr","id":2301947,"avatar_url":"https://avatars1.githubusercontent.com/u/2301947?v=3","gravatar_id":"","url":"https://api.github.com/users/ubccr","html_url":"https://github.com/ubccr","followers_url":"https://api.github.com/users/ubccr/followers","following_url":"https://api.github.com/users/ubccr/following{/other_user}","gists_url":"https://api.github.com/users/ubccr/gists{/gist_id}","starred_url":"https://api.github.com/users/ubccr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ubccr/subscriptions","organizations_url":"https://api.github.com/users/ubccr/orgs","repos_url":"https://api.github.com/users/ubccr/repos","events_url":"https://api.github.com/users/ubccr/events{/privacy}","received_events_url":"https://api.github.com/users/ubccr/received_events","type":"Organization","site_admin":false},"repo":{"id":72233032,"name":"xdmod","full_name":"ubccr/xdmod","owner":{"login":"ubccr","id":2301947,"avatar_url":"https://avatars1.githubusercontent.com/u/2301947?v=3","gravatar_id":"","url":"https://api.github.com/users/ubccr","html_url":"https://github.com/ubccr","followers_url":"https://api.github.com/users/ubccr/followers","following_url":"https://api.github.com/users/ubccr/following{/other_user}","gists_url":"https://api.github.com/users/ubccr/gists{/gist_id}","starred_url":"https://api.github.com/users/ubccr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ubccr/subscriptions","organizations_url":"https://api.github.com/users/ubccr/orgs","repos_url":"https://api.github.com/users/ubccr/repos","events_url":"https://api.github.com/users/ubccr/events{/privacy}","received_events_url":"https://api.github.com/users/ubccr/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ubccr/xdmod","description":"An open framework for collecting and analyzing HPC metrics.","fork":false,"url":"https://api.github.com/repos/ubccr/xdmod","forks_url":"https://api.github.com/repos/ubccr/xdmod/forks","keys_url":"https://api.github.com/repos/ubccr/xdmod/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ubccr/xdmod/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ubccr/xdmod/teams","hooks_url":"https://api.github.com/repos/ubccr/xdmod/hooks","issue_events_url":"https://api.github.com/repos/ubccr/xdmod/issues/events{/number}","events_url":"https://api.github.com/repos/ubccr/xdmod/events","assignees_url":"https://api.github.com/repos/ubccr/xdmod/assignees{/user}","branches_url":"https://api.github.com/repos/ubccr/xdmod/branches{/branch}","tags_url":"https://api.github.com/repos/ubccr/xdmod/tags","blobs_url":"https://api.github.com/repos/ubccr/xdmod/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ubccr/xdmod/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ubccr/xdmod/git/refs{/sha}","trees_url":"https://api.github.com/repos/ubccr/xdmod/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ubccr/xdmod/statuses/{sha}","languages_url":"https://api.github.com/repos/ubccr/xdmod/languages","stargazers_url":"https://api.github.com/repos/ubccr/xdmod/stargazers","contributors_url":"https://api.github.com/repos/ubccr/xdmod/contributors","subscribers_url":"https://api.github.com/repos/ubccr/xdmod/subscribers","subscription_url":"https://api.github.com/repos/ubccr/xdmod/subscription","commits_url":"https://api.github.com/repos/ubccr/xdmod/commits{/sha}","git_commits_url":"https://api.github.com/repos/ubccr/xdmod/git/commits{/sha}","comments_url":"https://api.github.com/repos/ubccr/xdmod/comments{/number}","issue_comment_url":"https://api.github.com/repos/ubccr/xdmod/issues/comments{/number}","contents_url":"https://api.github.com/repos/ubccr/xdmod/contents/{+path}","compare_url":"https://api.github.com/repos/ubccr/xdmod/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ubccr/xdmod/merges","archive_url":"https://api.github.com/repos/ubccr/xdmod/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ubccr/xdmod/downloads","issues_url":"https://api.github.com/repos/ubccr/xdmod/issues{/number}","pulls_url":"https://api.github.com/repos/ubccr/xdmod/pulls{/number}","milestones_url":"https://api.github.com/repos/ubccr/xdmod/milestones{/number}","notifications_url":"https://api.github.com/repos/ubccr/xdmod/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ubccr/xdmod/labels{/name}","releases_url":"https://api.github.com/repos/ubccr/xdmod/releases{/id}","deployments_url":"https://api.github.com/repos/ubccr/xdmod/deployments","created_at":"2016-10-28T18:41:25Z","updated_at":"2017-06-14T09:54:52Z","pushed_at":"2017-06-29T16:19:48Z","git_url":"git://github.com/ubccr/xdmod.git","ssh_url":"git@github.com:ubccr/xdmod.git","clone_url":"https://github.com/ubccr/xdmod.git","svn_url":"https://github.com/ubccr/xdmod","homepage":"http://open.xdmod.org","size":4993,"stargazers_count":17,"watchers_count":17,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":18,"mirror_url":null,"open_issues_count":9,"forks":18,"open_issues":9,"watchers":17,"default_branch":"xdmod7.0"}},"_links":{"self":{"href":"https://api.github.com/repos/ubccr/xdmod/pulls/178"},"html":{"href":"https://github.com/ubccr/xdmod/pull/178"},"issue":{"href":"https://api.github.com/repos/ubccr/xdmod/issues/178"},"comments":{"href":"https://api.github.com/repos/ubccr/xdmod/issues/178/comments"},"review_comments":{"href":"https://api.github.com/repos/ubccr/xdmod/pulls/178/comments"},"review_comment":{"href":"https://api.github.com/repos/ubccr/xdmod/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ubccr/xdmod/pulls/178/commits"},"statuses":{"href":"https://api.github.com/repos/ubccr/xdmod/statuses/855a1ea98e68bae2836430f73fb00c0f7cc24bb2"}}}}
{"actor":{"display_login":"jpwhite4"}}