mirror of
https://github.com/mailcow/mailcow-dockerized.git
synced 2026-11-05 07:58:20 +00:00
[Nginx][Web] Pass the client address to sogo-auth for EAS/DAV logins
This commit is contained in:
3 files changed
+12
No files matched your search
@@ -12,6 +12,11 @@ $session_var_pass = 'sogo-sso-pass';
|
||||
// external clients can never supply it (bare fastcgi param, not an HTTP header)
|
||||
$is_internal_auth = (($_SERVER['SOGO_AUTH_INTERNAL'] ?? '') === '1');
|
||||
|
||||
// the loopback is no client: use the client of the original request for logs, netfilter and API IP checks
|
||||
if ($is_internal_auth && filter_var($_SERVER['SOGO_AUTH_CLIENT_IP'] ?? '', FILTER_VALIDATE_IP)) {
|
||||
$_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_X_REAL_IP'] = $_SERVER['SOGO_AUTH_CLIENT_IP'];
|
||||
}
|
||||
|
||||
// validate credentials for basic auth requests
|
||||
if ($is_internal_auth && isset($_SERVER['PHP_AUTH_USER'])) {
|
||||
// load prerequisites only when required
|
||||
|
||||
Reference in new issue
Block a user