ePHD
February 14, 2018, 5:07pm
1
Pi-hole in a larger environment where Admins and Users coexist.
Rather than just giving a "password" field to whitelist the blocked domain, a typical user should also have the option "Request Access" with a small box for justifying the request being sent to the Admin.
This could just be a simple section with a notification icon for anyone logging in to the Admin panel to review, accept/deny requests. It would also be nice to have email notifications, I realize this would require a lot more work.
Mcat12
February 14, 2018, 6:06pm
2
There is already the option to specify an admin email address, which shows up in the block page.
pi-hole:development
← pi-hole:new/adminemail
opened 02:27PM - 14 Sep 17 UTC
**By submitting this pull request, I confirm the following:**
- [x] I have re… ad and understood the [contributors guide](https://github.com/pi-hole/pi-hole/blob/master/CONTRIBUTING.md).
- [x] I have checked that [another pull request](https://github.com/pi-hole/pi-hole/pulls) for this purpose does not exist.
- [x] I have considered, and confirmed that this submission will be valuable to others.
- [x] I accept that this submission may not be used, and the pull request closed at the will of the maintainer.
- [x] I give this submission freely, and claim no ownership to its content.
**How familiar are you with the codebase?:**
9
---
The Block Page has functionality that checks `setupVars.conf` for an `ADMIN_EMAIL` variable. If set, it will display "ask the administrator" as a hyperlink to the defined email address.
This can also be set via the GUI in v4.0
pi-hole:devel
← kkirsche:fix-579
opened 07:51PM - 26 May 18 UTC
**By submitting this pull request, I confirm the following:**
**NOTE:** This… is a redo of #757 after I messed up the rebase when applying the XSS fix. I have done my best to make sure this is using tabs, by using Sublime instead of Atom. It did properly show tab space rather than "spaces width" in the editor, so hope this is better.
- [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.
- [X] I have made only one major change in my proposed changes.
- [X] I have commented my proposed changes within the code.
- [ ] I have tested my proposed changes.
- [X] I am willing to help maintain this change if there are issues with it later.
- [X] I give this submission freely and claim no ownership.
- [X] It is compatible with the [EUPL 1.2 license](https://opensource.org/licenses/EUPL-1.1)
- [X] I have squashed any insignificant commits. ([`git rebase`](http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html))
- [X] I have Signed Off all commits. ([`git commit --signoff`](https://git-scm.com/docs/git-commit#git-commit---signoff))
This 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.
---
**What does this PR aim to accomplish?:**
Fix #579 — Adds Web UI option to control the `ADMIN_EMAIL` setupVars.conf value.
**How does this PR accomplish the above?:**
This 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`
Within 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.
If 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
If 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.
**What documentation changes (if any) are needed to support this PR?:**
N/A