{"action":"created","comment":{"url":"https://api.github.com/repos/pi-hole/AdminLTE/pulls/comments/191053453","pull_request_review_id":123561347,"id":191053453,"diff_hunk":"@@ -452,6 +452,21 @@ function readAdlists()\n \t\t\t\t{\n \t\t\t\t\texec('sudo pihole -a -c');\n \t\t\t\t}\n+        $adminemail = trim($_POST[\"adminemail\"])\n+        // If we didn't get an email, don't try to save it\n+        if(strlen($adminemail) == 0 || !isset($adminemail))\n+        {\n+          $adminemail = 'noadminemail'\n+        }\n+        // Make sure that any email we did get is valid, otherwise error\n+        elseif (!filter_var($adminemail, FILTER_VALIDATE_EMAIL)) {\n+          $error  .= \"Administrator email address (\".htmlspecialchars($adminemail).\") is invalid!<br>\";\n+        }\n+        // Save the email after we've validated it\n+        else","path":"scripts/pi-hole/php/savesettings.php","position":15,"original_position":15,"commit_id":"ab8e1076f360bdaeace95d6bc9883bd9c1b4b702","original_commit_id":"ab8e1076f360bdaeace95d6bc9883bd9c1b4b702","user":{"login":"Mcat12","id":4417660,"avatar_url":"https://avatars2.githubusercontent.com/u/4417660?v=4","gravatar_id":"","url":"https://api.github.com/users/Mcat12","html_url":"https://github.com/Mcat12","followers_url":"https://api.github.com/users/Mcat12/followers","following_url":"https://api.github.com/users/Mcat12/following{/other_user}","gists_url":"https://api.github.com/users/Mcat12/gists{/gist_id}","starred_url":"https://api.github.com/users/Mcat12/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mcat12/subscriptions","organizations_url":"https://api.github.com/users/Mcat12/orgs","repos_url":"https://api.github.com/users/Mcat12/repos","events_url":"https://api.github.com/users/Mcat12/events{/privacy}","received_events_url":"https://api.github.com/users/Mcat12/received_events","type":"User","site_admin":false},"body":"The code uses tabs, but this section uses spaces, which causes the indentation to be messed up.","created_at":"2018-05-26T16:36:20Z","updated_at":"2018-05-26T16:36:20Z","html_url":"https://github.com/pi-hole/AdminLTE/pull/757#discussion_r191053453","pull_request_url":"https://api.github.com/repos/pi-hole/AdminLTE/pulls/757","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/pi-hole/AdminLTE/pulls/comments/191053453"},"html":{"href":"https://github.com/pi-hole/AdminLTE/pull/757#discussion_r191053453"},"pull_request":{"href":"https://api.github.com/repos/pi-hole/AdminLTE/pulls/757"}},"in_reply_to_id":191052352},"pull_request":{"url":"https://api.github.com/repos/pi-hole/AdminLTE/pulls/757","id":190741829,"html_url":"https://github.com/pi-hole/AdminLTE/pull/757","diff_url":"https://github.com/pi-hole/AdminLTE/pull/757.diff","patch_url":"https://github.com/pi-hole/AdminLTE/pull/757.patch","issue_url":"https://api.github.com/repos/pi-hole/AdminLTE/issues/757","number":757,"state":"open","locked":false,"title":"Fix 579 | Add interface option for administrator email address","user":{"login":"kkirsche","id":947110,"avatar_url":"https://avatars1.githubusercontent.com/u/947110?v=4","gravatar_id":"","url":"https://api.github.com/users/kkirsche","html_url":"https://github.com/kkirsche","followers_url":"https://api.github.com/users/kkirsche/followers","following_url":"https://api.github.com/users/kkirsche/following{/other_user}","gists_url":"https://api.github.com/users/kkirsche/gists{/gist_id}","starred_url":"https://api.github.com/users/kkirsche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kkirsche/subscriptions","organizations_url":"https://api.github.com/users/kkirsche/orgs","repos_url":"https://api.github.com/users/kkirsche/repos","events_url":"https://api.github.com/users/kkirsche/events{/privacy}","received_events_url":"https://api.github.com/users/kkirsche/received_events","type":"User","site_admin":false},"body":"**By submitting this pull request, I confirm the following:** \r\n\r\n- [X] I have read and understood the [contributors guide](https://github.com/pi-hole/AdminLTE/blob/master/CONTRIBUTING.md), as well as this entire template.\r\n- [X] I have made only one major change in my proposed changes.\r\n- [X] I have commented my proposed changes within the code.\r\n- [ ] I have tested my proposed changes.\r\n- [X] I am willing to help maintain this change if there are issues with it later.\r\n- [X] I give this submission freely and claim no ownership.\r\n- [X] It is compatible with the [EUPL 1.2 license](https://opensource.org/licenses/EUPL-1.1)\r\n- [X] I have squashed any insignificant commits. ([`git rebase`](http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html))\r\n- [X] I have Signed Off all commits. ([`git commit --signoff`](https://git-scm.com/docs/git-commit#git-commit---signoff))\r\n\r\nThis was not tested as I don't know how to easily spin this up in a VM, but not opposed to testing it with a bit of guidance on how to get it up and running. Due to the size of the change, it may not be worth the effort on your side, but figured I'd explain.\r\n\r\n---\r\n\r\n**What does this PR aim to accomplish?:**\r\nFix #579 — Adds Web UI option to control the `ADMIN_EMAIL` setupVars.conf value.\r\n\r\n**How does this PR accomplish the above?:**\r\nThis PR adds a form input named `adminemail` which accepts a value. This is populated with the value of `ADMIN_EMAIL` if it exists. When submitted to the server, it is passed into `savesettings.php`\r\n\r\nWithin the save process, we first trim the email to ensure there is no extra whitespace being submitted causing false positives. We check if the value is set and the length is greater than 0, if not, we ignore the field.\r\n\r\nIf we have a set variable and it has length, we validate that it's a valid email address using `FILTER_VALIDATE_EMAIL`. This is based off of http://php.net/manual/en/filter.examples.validation.php\r\n\r\nIf it's not valid, add to the `$error` variable that this was not a valid email address, otherwise, execute the Pi-hole command to save the email address.\r\n\r\n**What documentation changes (if any) are needed to support this PR?:**\r\nN/A\r\n","created_at":"2018-05-26T13:21:07Z","updated_at":"2018-05-26T16:36:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"58a8f33094139c420fcc9073236e9e98e849ca1b","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/pi-hole/AdminLTE/pulls/757/commits","review_comments_url":"https://api.github.com/repos/pi-hole/AdminLTE/pulls/757/comments","review_comment_url":"https://api.github.com/repos/pi-hole/AdminLTE/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pi-hole/AdminLTE/issues/757/comments","statuses_url":"https://api.github.com/repos/pi-hole/AdminLTE/statuses/ab8e1076f360bdaeace95d6bc9883bd9c1b4b702","head":{"label":"kkirsche:fix-579","ref":"fix-579","sha":"ab8e1076f360bdaeace95d6bc9883bd9c1b4b702","user":{"login":"kkirsche","id":947110,"avatar_url":"https://avatars1.githubusercontent.com/u/947110?v=4","gravatar_id":"","url":"https://api.github.com/users/kkirsche","html_url":"https://github.com/kkirsche","followers_url":"https://api.github.com/users/kkirsche/followers","following_url":"https://api.github.com/users/kkirsche/following{/other_user}","gists_url":"https://api.github.com/users/kkirsche/gists{/gist_id}","starred_url":"https://api.github.com/users/kkirsche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kkirsche/subscriptions","organizations_url":"https://api.github.com/users/kkirsche/orgs","repos_url":"https://api.github.com/users/kkirsche/repos","events_url":"https://api.github.com/users/kkirsche/events{/privacy}","received_events_url":"https://api.github.com/users/kkirsche/received_events","type":"User","site_admin":false},"repo":{"id":134961982,"name":"AdminLTE","full_name":"kkirsche/AdminLTE","owner":{"login":"kkirsche","id":947110,"avatar_url":"https://avatars1.githubusercontent.com/u/947110?v=4","gravatar_id":"","url":"https://api.github.com/users/kkirsche","html_url":"https://github.com/kkirsche","followers_url":"https://api.github.com/users/kkirsche/followers","following_url":"https://api.github.com/users/kkirsche/following{/other_user}","gists_url":"https://api.github.com/users/kkirsche/gists{/gist_id}","starred_url":"https://api.github.com/users/kkirsche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kkirsche/subscriptions","organizations_url":"https://api.github.com/users/kkirsche/orgs","repos_url":"https://api.github.com/users/kkirsche/repos","events_url":"https://api.github.com/users/kkirsche/events{/privacy}","received_events_url":"https://api.github.com/users/kkirsche/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kkirsche/AdminLTE","description":"Pi-hole Dashboard for stats and more","fork":true,"url":"https://api.github.com/repos/kkirsche/AdminLTE","forks_url":"https://api.github.com/repos/kkirsche/AdminLTE/forks","keys_url":"https://api.github.com/repos/kkirsche/AdminLTE/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kkirsche/AdminLTE/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kkirsche/AdminLTE/teams","hooks_url":"https://api.github.com/repos/kkirsche/AdminLTE/hooks","issue_events_url":"https://api.github.com/repos/kkirsche/AdminLTE/issues/events{/number}","events_url":"https://api.github.com/repos/kkirsche/AdminLTE/events","assignees_url":"https://api.github.com/repos/kkirsche/AdminLTE/assignees{/user}","branches_url":"https://api.github.com/repos/kkirsche/AdminLTE/branches{/branch}","tags_url":"https://api.github.com/repos/kkirsche/AdminLTE/tags","blobs_url":"https://api.github.com/repos/kkirsche/AdminLTE/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kkirsche/AdminLTE/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kkirsche/AdminLTE/git/refs{/sha}","trees_url":"https://api.github.com/repos/kkirsche/AdminLTE/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kkirsche/AdminLTE/statuses/{sha}","languages_url":"https://api.github.com/repos/kkirsche/AdminLTE/languages","stargazers_url":"https://api.github.com/repos/kkirsche/AdminLTE/stargazers","contributors_url":"https://api.github.com/repos/kkirsche/AdminLTE/contributors","subscribers_url":"https://api.github.com/repos/kkirsche/AdminLTE/subscribers","subscription_url":"https://api.github.com/repos/kkirsche/AdminLTE/subscription","commits_url":"https://api.github.com/repos/kkirsche/AdminLTE/commits{/sha}","git_commits_url":"https://api.github.com/repos/kkirsche/AdminLTE/git/commits{/sha}","comments_url":"https://api.github.com/repos/kkirsche/AdminLTE/comments{/number}","issue_comment_url":"https://api.github.com/repos/kkirsche/AdminLTE/issues/comments{/number}","contents_url":"https://api.github.com/repos/kkirsche/AdminLTE/contents/{+path}","compare_url":"https://api.github.com/repos/kkirsche/AdminLTE/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kkirsche/AdminLTE/merges","archive_url":"https://api.github.com/repos/kkirsche/AdminLTE/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kkirsche/AdminLTE/downloads","issues_url":"https://api.github.com/repos/kkirsche/AdminLTE/issues{/number}","pulls_url":"https://api.github.com/repos/kkirsche/AdminLTE/pulls{/number}","milestones_url":"https://api.github.com/repos/kkirsche/AdminLTE/milestones{/number}","notifications_url":"https://api.github.com/repos/kkirsche/AdminLTE/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kkirsche/AdminLTE/labels{/name}","releases_url":"https://api.github.com/repos/kkirsche/AdminLTE/releases{/id}","deployments_url":"https://api.github.com/repos/kkirsche/AdminLTE/deployments","created_at":"2018-05-26T13:05:03Z","updated_at":"2018-05-26T13:05:05Z","pushed_at":"2018-05-26T13:18:48Z","git_url":"git://github.com/kkirsche/AdminLTE.git","ssh_url":"git@github.com:kkirsche/AdminLTE.git","clone_url":"https://github.com/kkirsche/AdminLTE.git","svn_url":"https://github.com/kkirsche/AdminLTE","homepage":"https://pi-hole.net","size":25441,"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,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"pi-hole:devel","ref":"devel","sha":"be992a96545cc512c9acd85a89ffa48e2351fe91","user":{"login":"pi-hole","id":16827203,"avatar_url":"https://avatars2.githubusercontent.com/u/16827203?v=4","gravatar_id":"","url":"https://api.github.com/users/pi-hole","html_url":"https://github.com/pi-hole","followers_url":"https://api.github.com/users/pi-hole/followers","following_url":"https://api.github.com/users/pi-hole/following{/other_user}","gists_url":"https://api.github.com/users/pi-hole/gists{/gist_id}","starred_url":"https://api.github.com/users/pi-hole/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pi-hole/subscriptions","organizations_url":"https://api.github.com/users/pi-hole/orgs","repos_url":"https://api.github.com/users/pi-hole/repos","events_url":"https://api.github.com/users/pi-hole/events{/privacy}","received_events_url":"https://api.github.com/users/pi-hole/received_events","type":"Organization","site_admin":false},"repo":{"id":39698170,"name":"AdminLTE","full_name":"pi-hole/AdminLTE","owner":{"login":"pi-hole","id":16827203,"avatar_url":"https://avatars2.githubusercontent.com/u/16827203?v=4","gravatar_id":"","url":"https://api.github.com/users/pi-hole","html_url":"https://github.com/pi-hole","followers_url":"https://api.github.com/users/pi-hole/followers","following_url":"https://api.github.com/users/pi-hole/following{/other_user}","gists_url":"https://api.github.com/users/pi-hole/gists{/gist_id}","starred_url":"https://api.github.com/users/pi-hole/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pi-hole/subscriptions","organizations_url":"https://api.github.com/users/pi-hole/orgs","repos_url":"https://api.github.com/users/pi-hole/repos","events_url":"https://api.github.com/users/pi-hole/events{/privacy}","received_events_url":"https://api.github.com/users/pi-hole/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pi-hole/AdminLTE","description":"Pi-hole Dashboard for stats and more","fork":false,"url":"https://api.github.com/repos/pi-hole/AdminLTE","forks_url":"https://api.github.com/repos/pi-hole/AdminLTE/forks","keys_url":"https://api.github.com/repos/pi-hole/AdminLTE/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pi-hole/AdminLTE/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pi-hole/AdminLTE/teams","hooks_url":"https://api.github.com/repos/pi-hole/AdminLTE/hooks","issue_events_url":"https://api.github.com/repos/pi-hole/AdminLTE/issues/events{/number}","events_url":"https://api.github.com/repos/pi-hole/AdminLTE/events","assignees_url":"https://api.github.com/repos/pi-hole/AdminLTE/assignees{/user}","branches_url":"https://api.github.com/repos/pi-hole/AdminLTE/branches{/branch}","tags_url":"https://api.github.com/repos/pi-hole/AdminLTE/tags","blobs_url":"https://api.github.com/repos/pi-hole/AdminLTE/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pi-hole/AdminLTE/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pi-hole/AdminLTE/git/refs{/sha}","trees_url":"https://api.github.com/repos/pi-hole/AdminLTE/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pi-hole/AdminLTE/statuses/{sha}","languages_url":"https://api.github.com/repos/pi-hole/AdminLTE/languages","stargazers_url":"https://api.github.com/repos/pi-hole/AdminLTE/stargazers","contributors_url":"https://api.github.com/repos/pi-hole/AdminLTE/contributors","subscribers_url":"https://api.github.com/repos/pi-hole/AdminLTE/subscribers","subscription_url":"https://api.github.com/repos/pi-hole/AdminLTE/subscription","commits_url":"https://api.github.com/repos/pi-hole/AdminLTE/commits{/sha}","git_commits_url":"https://api.github.com/repos/pi-hole/AdminLTE/git/commits{/sha}","comments_url":"https://api.github.com/repos/pi-hole/AdminLTE/comments{/number}","issue_comment_url":"https://api.github.com/repos/pi-hole/AdminLTE/issues/comments{/number}","contents_url":"https://api.github.com/repos/pi-hole/AdminLTE/contents/{+path}","compare_url":"https://api.github.com/repos/pi-hole/AdminLTE/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pi-hole/AdminLTE/merges","archive_url":"https://api.github.com/repos/pi-hole/AdminLTE/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pi-hole/AdminLTE/downloads","issues_url":"https://api.github.com/repos/pi-hole/AdminLTE/issues{/number}","pulls_url":"https://api.github.com/repos/pi-hole/AdminLTE/pulls{/number}","milestones_url":"https://api.github.com/repos/pi-hole/AdminLTE/milestones{/number}","notifications_url":"https://api.github.com/repos/pi-hole/AdminLTE/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pi-hole/AdminLTE/labels{/name}","releases_url":"https://api.github.com/repos/pi-hole/AdminLTE/releases{/id}","deployments_url":"https://api.github.com/repos/pi-hole/AdminLTE/deployments","created_at":"2015-07-25T18:45:30Z","updated_at":"2018-05-25T08:24:31Z","pushed_at":"2018-05-26T13:21:08Z","git_url":"git://github.com/pi-hole/AdminLTE.git","ssh_url":"git@github.com:pi-hole/AdminLTE.git","clone_url":"https://github.com/pi-hole/AdminLTE.git","svn_url":"https://github.com/pi-hole/AdminLTE","homepage":"https://pi-hole.net","size":25475,"stargazers_count":291,"watchers_count":291,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":172,"mirror_url":null,"archived":false,"open_issues_count":26,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":172,"open_issues":26,"watchers":291,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pi-hole/AdminLTE/pulls/757"},"html":{"href":"https://github.com/pi-hole/AdminLTE/pull/757"},"issue":{"href":"https://api.github.com/repos/pi-hole/AdminLTE/issues/757"},"comments":{"href":"https://api.github.com/repos/pi-hole/AdminLTE/issues/757/comments"},"review_comments":{"href":"https://api.github.com/repos/pi-hole/AdminLTE/pulls/757/comments"},"review_comment":{"href":"https://api.github.com/repos/pi-hole/AdminLTE/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pi-hole/AdminLTE/pulls/757/commits"},"statuses":{"href":"https://api.github.com/repos/pi-hole/AdminLTE/statuses/ab8e1076f360bdaeace95d6bc9883bd9c1b4b702"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"Mcat12"}}