Commit Graph

77 Commits

Author SHA1 Message Date
Christian König
97200b8462 Add missing Parentheses
Signed-off-by: Christian König <ckoenig@posteo.de>
2022-11-03 22:39:12 +01:00
Christian König
08a6b46d15 Require auth for more API endpoints
Signed-off-by: Christian König <ckoenig@posteo.de>
2022-11-03 22:39:12 +01:00
DL6ER
6a39cc3b4a Disable Yoda style
Signed-off-by: DL6ER <dl6er@dl6er.de>
2022-08-12 18:55:27 +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
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
730b6b093b Use the correct endpoint for MAXLOGAGE
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2022-06-01 00:39:04 -03:00
RD WebDesign
58492c9be9 Add content type header
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2022-04-22 02:32:56 -03:00
yubiuser
edca3ee1c3 Remove obsolete comment 2022-04-13 07:04:59 +02:00
Christian König
4642569cae Move exit to the right place
Signed-off-by: Christian König <ckoenig@posteo.de>
2022-04-11 21:16:47 +02:00
Christian König
434dd025f1 Fix merge conflicts
Signed-off-by: Christian König <ckoenig@posteo.de>
2022-04-11 20:21:13 +02:00
Christian König
32d539f1a9 Add proper guarding
Signed-off-by: Christian König <ckoenig@posteo.de>
2022-04-11 20:19:00 +02:00
Christian König
12be6dd732 Improve loop for ?getAllQueries from FTL
Signed-off-by: Christian König <ckoenig@posteo.de>
2022-04-11 20:18:32 +02:00
Christian König
8cc92c0517 Return FTLnotrunning to javascript instead of no response
Signed-off-by: Christian König <ckoenig@posteo.de>
2022-04-08 20:49:29 +01:00
Christian König
45340aaa23 Guard socket and FTL response
Signed-off-by: Christian König <ckoenig@posteo.de>
2022-04-08 20:49:29 +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
rdwebdesign
171bf81b11 Retreives maxlogage calling api_FTL.php
FTL defines MAXLOGAGE value.
PHP retrieves the value and converts seconds to hours
Javascript calls the API to update the value.

Signed-off-by: rdwebdesign <github@rdwebdesign.com.br>
2022-02-01 22:56:06 -03:00
RD WebDesign
f0c3ecded3 Use formmated string for "api.php?summary" (#2067)
restoring the old behavior

Signed-off-by: rdwebdesign <github@rdwebdesign.com.br>
2022-01-10 19:23:37 +01: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
DL6ER
b7c0fcb131 Ensure number formatting is taking place in browser-scope to use client- instead of browser-based number localization
Signed-off-by: DL6ER <dl6er@dl6er.de>
2021-12-26 11:32:13 +01:00
IvanI3
ce3e2dba0a Handle empty "" domain in query top list correctly (#1790)
If an empty domains requests "" in top queries we get "PHP Notice:  Undefined offset: 2 in /var/www/html/admin/api_FTL.php on line 107" in web-server logs.
This workaround suppress this error.
2021-10-06 23:46:28 +01:00
DL6ER
a120e72524 Add EDE if available
Signed-off-by: DL6ER <dl6er@dl6er.de>
2021-06-28 20:35:51 +02:00
Adam Warner
62ac184116 replace "~" by " " in getAllQueries response
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2020-12-23 18:42:51 +00:00
Aidan Woods
8acfe1394e Require auth for recentBlocked function
Signed-off-by: Aidan Woods <aidantwoods@gmail.com>
2020-12-05 13:47:20 +00:00
DL6ER
6e0e1bbb41 Add button to remove dynamic DHCP leases. They are immediately removed both from FTL and the dhcp.leases file (FTL takes care of updating the file!) WITHOUT the need for a restart of the DHCP/DNS resolver.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-11-23 13:35:40 +01:00
DL6ER
64a2419fa9 Add ability to filter for blocked queries in conjunction the client filter in the Query Log. Request such filtered data when clicking on a client in the Top Clients (blocked only) table on the dashboard.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-08-02 19:54:54 +02:00
XhmikosR
e805d0a75c api_FTL: Remove duplicate semicolon
Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2020-05-18 11:14:35 +03:00
DL6ER
300d8d4b1f UTF-8 encode all strings read from the FTL interface before JSON-encoding them
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-11-02 10:30:07 +01:00
Mark Drobnak
51cc3661ff Merge pull request #830 from pi-hole/new/cacheinfo
Add DNS cache information to Settings page
2018-08-30 16:07:21 -04:00
DL6ER
053d28980f Use new variable name for new array in api_FTL.php
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-08-25 14:14:00 +02:00
DL6ER
c2dbefecc2 Add new api.php?getCacheInfo callback
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-08-16 14:29:49 +02:00
DL6ER
6fb2dab5bc Extend query log and API to be able to handle requests limited to specific forward destinations and query types
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-08-15 14:36:37 +02:00
Mark Drobnak
92db9400de Merge pull request #765 from pi-hole/tweak/client-names
Use new `client-names` FTL response format
2018-06-07 21:40:19 -04:00
Mcat12
357da1d15a Expose both name and IP of client
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-06-06 18:27:55 -04:00
Mark Drobnak
117aaa071f Remove overTimeDataForwards
The FTL API has removed the underlying command and data.

Signed-off-by: Mark Drobnak <newtoncat12@yahoo.com>
2018-06-03 23:11:21 -04:00
Mcat12
6f93f89e59 Use new client-names FTL response format
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-06-03 16:13:59 -04:00
DL6ER
b2743ed245 Fix a minor bug with api.php?getClientNames when hostnames are present more than once on the local network (maybe once IPv6, once IPv4)
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-05-28 17:42:11 +02:00
DL6ER
5a473ecbde Add "api.php?topClientsBlocked"
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-05-10 15:05:46 +02:00
Walter
2c2a091b03 Changes concerning the date the gravity list was last changed. Used in the webinterface dashboard as a tooltip, and now also available in the API (both PHP and FTL). Function was moved to new file /scripts/pi-hole/php/gravity.php to keep things neat and to avoid duplicate code. 2018-04-23 20:32:38 +02:00
DL6ER
de1674e5ae Don't use resolveHostname in api.php?getAllQueries
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-04-15 11:39:42 +02:00
DL6ER
a5635e7d3f Fix "FastCGI-stderr: PHP Notice: Undefined offset: 3" error
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-04-15 11:28:46 +02:00
DL6ER
cd6684a37c Remove resolveHostname() in client-names
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-04-15 11:26:15 +02:00
DL6ER
a1824a45d4 Improve way PHP connects to FTL
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-04-15 10:56:52 +02:00
DL6ER
8fffc4e89a Use host names returned by FTLDNS instead of trying to obtain them in PHP
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-04-11 18:31:15 +02:00
DL6ER
71a7c84cba Make second argument of resolveHostname() optional
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-04-04 12:32:55 +02:00
DL6ER
5e8f4b2584 Merge branch 'devel' into FTLDNS 2018-04-01 16:46:35 +02:00
DL6ER
1ec38e3a79 Don't want IPs in Query Log output
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-03-05 16:35:42 +01:00
DL6ER
02f14ceb05 Add name resolution capabilites (with caching) for web interface
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-02-25 09:44:01 +01:00
DL6ER
1db322b963 Show most recent 100 queries instead of queries within most recent 10 minutes
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-02-10 14:10:55 +01:00
Adam Warner
1d6875e632 Merge pull request #594 from pi-hole/tweak/API_stats_formating
Allow "domains_being_blocked" and "status" to contains non-numeric values
2017-10-31 19:39:54 +00:00
DL6ER
fd766dfdbb Merge pull request #593 from pi-hole/fix/non-local-FTL
Explicitly allow non-local FTL installations
2017-10-23 08:47:02 +02:00