-
-
Notifications
You must be signed in to change notification settings - Fork 566
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update add.php #1360
Update add.php #1360
Conversation
Added removal from blacklist if adding to whitelist Added removal from whitelist if we add to the blacklist Added removal option from both lists option "none"
Code readability has been improved
I was looking over this PR on saturday, then life kind of got in the way. I am not sure if the change is a necessary one, at least in the case of removing from one list when adding to the other. We already made a change in https://github.com/pi-hole/AdminLTE/blob/devel/scripts/pi-hole/php/database.php#L139 |
If this has been implemented at the database level, that's fine. Have you tested it on sample requests? |
It's implemented in the method All I'm saying is that a call to Insert This has been tested from the web interface: |
I understand it makes sense. In that case, it could be useful to reset (cleaning the domain from all lists). I tried to solve this by adding "none" |
Yeah, removing from probably makes sense. I believe |
I think api is really needed. However, there is probably a need to rewrite. |
For sure. I think for the purposes of this PR, you should be able to get away with only having the case for Although, can you test that removing those two lines still has the desired effects for the extension this is for? |
You mean remove changes for case white and black? Because this is implemented with datebase query? |
Sorry, I wasn't clear! Yes, those two are redundant |
I can delete but I have no way to check on dev branch (I'm using a docker instance) |
Hello, i checked out the dev branch currently. And actually the replace feature which is done in the database.php is doing exactly the correct thing. Adding a domain to the whitelist/blacklist that is already on a list gets replaced. Perfect! But i think the none option is also nice to have, removing a domain from any list. |
Duplicate functionality has been removed
Closing in favour of #1387 Thank you, nonetheless, for your contribution! |
Added removal from blacklist if adding to whitelist
Added removal from whitelist if we add to the blacklist
Added removal option from both lists black & white option "none"