diff options
| author | Simon Rettberg | 2026-04-28 14:42:07 +0200 |
|---|---|---|
| committer | Simon Rettberg | 2026-04-28 14:42:07 +0200 |
| commit | f1e35d43695f914677fcf8b2b4550a3c58cdcf10 (patch) | |
| tree | 99b9ca7ba24cbaed033963c20ff41e9303d28a21 /modules-available/webinterface/inc/webinterface.inc.php | |
| parent | Add README.md (diff) | |
| download | slx-admin-f1e35d43695f914677fcf8b2b4550a3c58cdcf10.tar.gz slx-admin-f1e35d43695f914677fcf8b2b4550a3c58cdcf10.tar.xz slx-admin-f1e35d43695f914677fcf8b2b4550a3c58cdcf10.zip | |
Add IP address normalization, add support for X-Forwarded-For
Tests written by Junie AI
Diffstat (limited to 'modules-available/webinterface/inc/webinterface.inc.php')
| -rw-r--r-- | modules-available/webinterface/inc/webinterface.inc.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/modules-available/webinterface/inc/webinterface.inc.php b/modules-available/webinterface/inc/webinterface.inc.php index d50acd50..2541ea24 100644 --- a/modules-available/webinterface/inc/webinterface.inc.php +++ b/modules-available/webinterface/inc/webinterface.inc.php @@ -11,6 +11,8 @@ class WebInterface public const PROP_API_KEY = 'webinterface.api-key'; + public const PROP_PROXIES_TRUSTED = 'webinterface.proxies-trusted'; + /** * Read data all handled domains from current certificate. * SAN takes precedence, if empty, we fall back to CN. @@ -139,4 +141,20 @@ class WebInterface Property::set(self::PROP_API_KEY, empty($key) ? null : $key); } + /** + * List of trusted proxies. Key is the IP address, value is optional comment. + */ + public static function getProxiesTrusted(): array + { + return Property::get(self::PROP_PROXIES_TRUSTED, []); + } + + /** + * Set list of trusted proxies. Key is the IP address, value is optional comment. + */ + public static function setProxiesTrusted(array $proxies): void + { + Property::set(self::PROP_PROXIES_TRUSTED, $proxies); + } + }
\ No newline at end of file |
