Commit Graph

94 Commits

Author SHA1 Message Date
RD WebDesign
4966f01dde Use and set the unit on setupVars.conf option TEMPERATUREUNIT
New behavior!!!
The temperature unit will be set GLOBALLY and not per browser.

- if a TEMPERATUREUNIT is set in setupVars.conf file, the value will be used.
- if there is no unit set in setupVars.conf, "C" will be used;
- changing the value on the web interface WILL CHANGE setupVars.conf.
- if the browser has an old value set on locastorage, this will be ingnored.

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2023-01-27 16:45:38 -03:00
RD WebDesign
d12ef014e5 Use constants in place of class constants
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2022-09-08 23:47:09 -03:00
RD WebDesign
509113296c Move login form to a new page
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2022-08-12 18:04:57 -03: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
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
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
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
056b4fed72 Fixing double json_encode output
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2022-02-14 17:46:00 -03:00
Alexandr Salamatov
5137206dcc adjust indentation
Signed-off-by: Alexandr Salamatov <wpgnetworks@gmail.com>
2022-01-21 14:28:33 -06:00
Alexandr Salamatov
39f0da7eb5 API call to modify local CNAME records
Signed-off-by: Alexandr Salamatov <wpgnetworks@gmail.com>
2022-01-20 21:22:01 -06:00
Alexandr Salamatov
dc598295ca API call to modify local DNS records
Signed-off-by: Alexandr Salamatov <wpgnetworks@gmail.com>
2022-01-19 16:07:18 -06: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
RD WebDesign
7bb82d0cff Fix api.php?status ( replicate #2031 and pi-hole/pi-hole#4485) (#2052)
* Replicating changes made by other PRs

(#2031 and pi-hole/pi-hole#4485)

Signed-off-by: rdwebdesign <github@rdwebdesign.com.br>

* Use the same messages used in #2031

Signed-off-by: rdwebdesign <github@rdwebdesign.com.br>

* Keep the old responses to avoid break things

Signed-off-by: rdwebdesign <github@rdwebdesign.com.br>

* More comments less variables

Signed-off-by: rdwebdesign <github@rdwebdesign.com.br>
2022-01-06 23:12:26 +01:00
Adam Warner
05582b9722 Merge pull request #1251 from willemstuursma/fix-warning-for-unlink
Fixes #1227 Fix possible warning when unlinking files
2020-06-17 07:09:53 +01:00
Willem Stuursma-Ruwen
95379bbe7c #1227 Test if file exists instead of silencing errors 2020-06-10 21:29:45 +02:00
DL6ER
24269a0370 Remove break after die as it cannot be reached.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-05-26 23:25:19 +02:00
DL6ER
2fac217943 Re-implement api.php?list actions for add, sub and get.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-05-26 18:40:33 +02:00
Willem Stuursma-Ruwen
5971707263 Fixes #1227 Fix possible warning when unlinking files
Signed-off-by: Willem Stuursma-Ruwen <willem@stuursma.name>
2020-05-10 21:18:03 +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
Mike Souza
203d41103a Add API support for list actions
Signed-off-by: Mike Souza <contact@michael-souza.com>
2018-08-26 11:56:44 -04:00
DL6ER
7f8d8fe7e2 Rename the new endpoint to "api.php?versions" and include also current and latest versions + current branches
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-06-07 20:21:12 +02:00
DL6ER
f35f663be9 Add api.php?updatecheck endpoint
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-06-07 20:20:16 +02:00
DL6ER
c8f0db326b Remove ancient and completely outdated PHP-only API. Pi-hole v4.0 will only use the FTL-PHP API.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-05-24 14:06:46 +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
fcf2eb663f Specify one common place for defining the IP of a non-local FTL instance. Fixes #589
Signed-off-by: DL6ER <dl6er@dl6er.de>
2017-10-02 12:19:24 +02:00
DL6ER
e87046e04a Don't require authentication for api.php?status
Signed-off-by: DL6ER <dl6er@dl6er.de>
2017-09-21 21:59:04 +02:00
Mcat12
0fde8e0dca Add status API method 2017-03-24 16:27:37 -04:00
DL6ER
35dcb9b5ed Improve fallback handling of the dashboard for when FTL is not running 2017-03-24 15:30:03 +01:00
DL6ER
fb8f0a081e Move API functions that are neither FTL nor PHP specific (enable, disable) to api.php 2017-03-01 14:05:38 +01:00
DL6ER
7a73053bfd Merge branch 'devel' into new/FTL-integration
Conflicts:
	api.php
2017-02-28 13:49:34 +01:00
Mcat12
3b5578321a Merge pull request #413 from pi-hole/tweak/enable_disable_API
Improve Enable/Disable through API
2017-02-27 21:42:16 -05:00
DL6ER
e6d0dd4839 Add version/type parameters to API (will be used in the future to decide what backend is powering the frontend) (#414) 2017-02-27 23:12:39 +01:00
DL6ER
03550f36aa Merge branch 'devel' into tweak/enable_disable_API 2017-02-27 22:52:22 +01:00
DL6ER
8d59283d09 Small typo 2017-02-23 14:27:37 +01:00
DL6ER
616213d10b Improve Enable/Disable through API as often requested 2017-02-23 14:24:14 +01:00
DL6ER
a6a4c944b0 Several optimizations to the new FTL API 2017-02-23 14:20:26 +01:00
DL6ER
e422e820d1 Show disable timer across all devices 2017-02-22 15:44:07 +01:00
DL6ER
d7fdaf9273 Fix whitespace caused by added license headers 2017-02-19 21:19:02 +01:00
DL6ER
1975c261d0 Moved FTL API into own file as well 2017-02-19 14:52:28 +01:00
DL6ER
bbab9f8bfd Removed double license header in api.php 2017-02-19 14:24:23 +01:00
DL6ER
86bfa663f9 Merge branch 'devel' into new/FTL-integration
Conflicts:
	scripts/pi-hole/php/auth.php
	scripts/pi-hole/php/password.php
2017-02-19 14:20:56 +01:00
DL6ER
f88092175e Conflicts:
api.php
	scripts/pi-hole/php/FTL.php
	scripts/pi-hole/php/auth.php
	scripts/pi-hole/php/password.php
2017-02-19 14:17:52 +01:00
DL6ER
4f70973cbc EUPL license (#402)
* Move whole project to EUPL, copy MIT license to scripts/vendor/ and style/vendor/

* Added header to main PHP files

* Modified scripts in scripts/pi-hole/php

* Added header to scripts/pi-hole/js files

* Added license header to our custom style script

* Slight reformulation
2017-02-18 14:20:51 +01:00
DL6ER
aabff35bef Squashed commit of the following:
- Dynamically fall back to PHP API functions to ensure API does always repond even if FTL is not runnung for some reason
- Update PHP API from current devel branch
- Increase flexibility in getQueryTypes API call
- Hide top ads list if nothing to display
- Proper display of activated privacy mode
- Remove spinner (would otherwise not be removed for zero results)
- Update tables every 10 seconds
- Update query types and forward destinations plots every 10 seconds
- More verbose output in top lists (total number next to percentage in tooltip)
- Implemented "recentBlocked" keyword for API
- Ensure compatibility with PHP5 version < 5.4
- Adjust output format of overTimeData10mins to comply with PHP API
- Further speedup of Query Log page by showing only the recent 10 minutes by default
- Hide temperature if FTL is not running and show FTL status
- Add information to Settings page
- Adjust error message when loading of query log failed
- Move processing of domainname, clientIP, clientname and time interval filters for the Query Log page to FTL for speed enhancement
- Generate link if pi.hole comes up in the Top Domains list
- Remove resolve DNS names option - this is now enabled by default (daemon will only do it once per day instead of PHP-API which did it on every reloading of the web interface)
- Add socket timeout of 10 seconds + modification to Settings page since FTL backend supports API_EXCLUDE_CLIENTS filtering with both IP addresses and host names (also mixed)
- Improved Query Log page
2017-02-16 08:52:30 +01:00
DL6ER
9b799819bf Added header to main PHP files 2017-02-14 14:57:58 +01:00
DL6ER
aa31fd13fe Use is_numeric(...) for checking if is either or type int or double or a valid numeric string 2017-01-27 11:48:35 +01:00
Mcat12
96826da1f2 Return numbers as numbers in summaryRaw 2017-01-26 21:33:18 -05:00
Mcat12
cd198d0793 Require auth for tailLog 2017-01-14 18:03:57 -05:00
DL6ER
5cbfe6a5be Merge branch 'devel' into TopItems 2016-12-30 20:42:33 +00:00