Commit Graph

55 Commits

Author SHA1 Message Date
DL6ER
6a39cc3b4a Disable Yoda style
Signed-off-by: DL6ER <dl6er@dl6er.de>
2022-08-12 18:55:27 +02:00
DL6ER
97a76669a2 Explicitly set blank_line_before_statement to exclude include* and require*
Signed-off-by: DL6ER <dl6er@dl6er.de>
2022-08-07 20:55:02 +02:00
DL6ER
4e4f13b996 Fix remaining styling change
Signed-off-by: DL6ER <dl6er@dl6er.de>
2022-08-07 12:09:07 +02:00
DL6ER
6ec4b8a529 Run PHP-CS-Fixer on all files
Signed-off-by: DL6ER <dl6er@dl6er.de>
2022-08-07 12:04:03 +02:00
RD WebDesign
6adf8e0132 Fixing lines without multiple of 4 spaces
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2022-08-01 01:57:13 -03:00
RD WebDesign
a3234d1306 Replacing tabs with 4 spaces
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2022-08-01 01:28:30 -03:00
RD WebDesign
2bc918ad6e Use 4 spaces to indent PHP files.
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2022-08-01 01:18:26 -03:00
RD WebDesign
79187b1258 Simplify header.php
- move some functions to `func.php`
- move sidebar to its own file `sidebar.php`
- fix indentation
- LCARS CSS: hide menu headers when logged off
- LCARS CSS: invert hover and active menu colors

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2022-07-20 18:59:36 -03:00
Christian König
7208e794af Create separat converIDNAToUnicode function in func.php
Signed-off-by: Christian König <ckoenig@posteo.de>
2022-07-13 22:10:10 +02:00
Christian König
678b4c96b6 Create separat convertDomainToIDNA function in func.php
Signed-off-by: Christian König <ckoenig@posteo.de>
2022-07-13 19:42:18 +02:00
RD WebDesign
245583c40d Remove unused parameter
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2022-06-27 19:05:32 -03:00
Christian König
0ccf727edd Use API gateway endpoint
Signed-off-by: Christian König <ckoenig@posteo.de>
2022-06-10 23:41:45 +02:00
RD WebDesign
cd4152058b Use the same types, as returned by FTL
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2022-05-30 13:14:03 -03:00
RD WebDesign
e2e3b07a0e Remove duplicate function declarations
and move functions to `func.php`.

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2022-05-11 18:14:37 -03:00
Adam Warner
242654e149 Fix some suggestions / ignore others
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2022-04-22 17:17:59 +01:00
RD WebDesign
84d31da743 Calling FTL API directly from PHP
- Using constants for default values
- Remove unnecessary variable
- Replace `piholeStatusAPI()` with a call to FTL API
- Transfer `api.php?status` code from `api.php` to `api_FTL.php`
- Change `piholeStatus()` to use FTL info (no need to use `pihole`).

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2022-03-10 16:20:00 -03:00
RD WebDesign
ab6b7ae326 Change pihole status in api_FTL.php (#2059)
Using "pihole status web" info

Signed-off-by: rdwebdesign <github@rdwebdesign.com.br>
2022-01-08 20:21:43 +01:00
yubiuser
e00d706b49 Fix tabs->spaces
Signed-off-by: yubiuser <ckoenig@posteo.de>
2021-10-15 07:42:00 +02:00
yubiuser
ab9454a582 Also use variable to disable reload in delteALL functions
Signed-off-by: yubiuser <ckoenig@posteo.de>
2021-10-13 20:47:02 +02:00
yubiuser
b80c97f6d3 Do only reload pihole once after Local DNS Records or CNAME have been modified
Signed-off-by: yubiuser <ckoenig@posteo.de>
2021-10-12 21:37:06 +02:00
yubiuser
9f0e5fa67e Use getCustomDNSEntries in deleteAllCustomDNSEntries
Signed-off-by: yubiuser <ckoenig@posteo.de>
2021-10-12 20:50:37 +02:00
yubiuser
7f13dda4a8 Fix regex
Signed-off-by: yubiuser <ckoenig@posteo.de>
2021-09-21 19:59:24 +02:00
yubiuser
2d41191ac3 Lift prefix limitaion for --rev-server
Signed-off-by: yubiuser <ckoenig@posteo.de>
2021-09-21 09:25:31 +02:00
Adam Warner
25df783378 Apply htmlentities in a couple of places to prevent xss
Co-authored-by: wtwver <wtwver@users.noreply.github.com>
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2021-09-11 20:03:05 +01:00
Adam Warner
a7ec9510b5 re-implement fix introduced in 1664090a01
Release v5.5.1 (based on `master`) has fixed this in `savesettings.php`, but the functionality has since been moved to `func.php` in `devel`, and so the fix needs applying here, too.

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2021-08-04 20:44:20 +01:00
DL6ER
559150bb1f Fix inverse logic when adding domains on the group management pages.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2021-07-25 19:03:34 +02:00
DL6ER
03920e3595 Move validation functions into func.php and use the same validation in all cases.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2021-07-25 16:59:16 +02:00
Dennis Alexandersson
93464cb9bf Trim CNAME target input field value data
Signed-off-by: Dennis Alexandersson <dennis@alexandersson.xyz>
2021-03-06 10:00:32 +01:00
DL6ER
d065328eb1 Merge branch 'devel' into new/OTHER_types
Signed-off-by: DL6ER <dl6er@dl6er.de>
2021-01-15 05:52:16 +01:00
Adam Warner
136006b1ee Merge pull request #1675 from pi-hole/new/SVCB_HTTPS
Add SVCB and HTTPS types
2021-01-13 21:15:12 +00:00
DL6ER
9b19104ae6 Merge pull request #1654 from buchwasa/phpstan-fixes
Fixes in func.php from phpstan
2020-12-31 11:59:23 +01:00
DL6ER
fa2279d473 Add SVCB and HTTPS types and reduce code duplication
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-12-31 10:54:01 +01:00
yubiuser
42e7915b53 Fix typo
Signed-off-by: yubiuser <ckoenig@posteo.de>
2020-12-20 20:35:21 +01:00
yubiuser
c07b710d07 Validate target domain for CNAME records
Signed-off-by: yubiuser <ckoenig@posteo.de>
2020-12-20 20:26:37 +01:00
buchwasa
98e6a45242 Fixes in func.php from phpstan
Signed-off-by: buchwasa <17461354+buchwasa@users.noreply.github.com>
2020-12-10 16:51:42 -05:00
marank
b597a0fcbb Merge branch 'devel' into devel 2020-06-21 12:20:33 +02:00
Adam Warner
c949516ee1 make use of utils.escapeHtml on the JS side of things, and html_entity_decode/htmlentities in PHP
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2020-06-13 18:50:36 +01:00
Matthias rank
212da94228 Added token verification
Moved CNAME functions to func.php
Added teleporter support
Fixed CNAME and DNS file declaration (filename was declarated in seperate file, therefore trying to read those files from func.php failed)
Fixed error and success response functions in func.php (calling addCustomDNSEntry and addCustomCNAMEEntry repeatedly from teleporter failed because of error function defined inside of those functions)

Signed-off-by: Matthias Rank <development@m-rank.de>
2020-05-21 14:48:13 +02:00
Jack'lul
e12ebcbd08 Trim user input where applicable
Signed-off-by: Jack'lul <jacklulcat@gmail.com>
2020-05-14 18:01:36 +02:00
DL6ER
ac3c178ce9 Add import for Local DNS Records.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-05-12 20:23:26 +02:00
Samu Voutilainen
39ec67829b Execute pihole through wrapper
All different exec() calls basically just calls sudo pihole,
with various different syntaxes. Using a wrapper function
allows sanitization of arguments for better safety.

Signed-off-by: Samu Voutilainen <smar@smar.fi>
2020-04-17 07:55:16 +03:00
Adam Warner
54610496a1 Merge pull request #1035 from Mograine/master
Add ability to manage custom DNS records
2019-11-29 13:28:56 +00:00
Mograine
192ad7ce8b Allow to use same Domain for IPv4/IPv6
Signed-off-by: Mograine <ghiot.pierre@gmail.com>
2019-10-28 13:18:08 +01:00
DL6ER
cd2daa3239 Review comments
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-07-24 19:41:04 +02:00
Mark Drobnak
02cc5fad15 Write newline after wildcard
This makes the web interface add wildcards in the same way as the CLI.

Signed-off-by: Mark Drobnak <mark.drobnak@gmail.com>
2018-09-01 19:34:25 -04:00
DL6ER
7c9f09db0e Directly write imported regex file to disk instead of useing bash callbacks
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-07-15 12:56:40 +02:00
DL6ER
3e4613caf0 Move function add_regex($regex) to func.php
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-07-15 12:48:46 +02:00
Mcat12
862db2ba9e Use hash_equals in password.php (and move it to funcs.php)
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-01-19 17:52:06 -05:00
DL6ER
94bdb18fe1 Fix domain validation function (#538) 2017-07-01 21:38:04 +10:00
DL6ER
d4bcede042 Accept underscores when validating domain names (#533) 2017-06-30 17:43:30 +10:00