mirror of
https://github.com/grocy/grocy.git
synced 2026-04-05 12:26:15 +02:00
Formatting
This commit is contained in:
parent
af24c402ec
commit
8bb1ff03ac
|
|
@ -27,17 +27,18 @@ class ReverseProxyAuthMiddleware extends AuthMiddleware
|
|||
if (!isset($_SERVER[GROCY_REVERSE_PROXY_AUTH_HEADER]))
|
||||
{
|
||||
// Variable is not set
|
||||
throw new \Exception('ReverseProxyAuthMiddleware: ' . GROCY_REVERSE_PROXY_AUTH_HEADER . ' env variable is missing, could not be found in $_SERVER array.');
|
||||
throw new \Exception('ReverseProxyAuthMiddleware: ' . GROCY_REVERSE_PROXY_AUTH_HEADER . ' env variable is missing (could not be found in $_SERVER array)');
|
||||
}
|
||||
|
||||
|
||||
$username = $_SERVER[GROCY_REVERSE_PROXY_AUTH_HEADER];
|
||||
if (strlen($username) === 0)
|
||||
{
|
||||
// Variable is empty
|
||||
throw new \Exception('ReverseProxyAuthMiddleware: ' . GROCY_REVERSE_PROXY_AUTH_HEADER . ' env variable is invalid');
|
||||
}
|
||||
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
$username = $request->getHeader(GROCY_REVERSE_PROXY_AUTH_HEADER);
|
||||
if (count($username) !== 1)
|
||||
{
|
||||
|
|
@ -46,8 +47,6 @@ class ReverseProxyAuthMiddleware extends AuthMiddleware
|
|||
}
|
||||
$username = $username[0];
|
||||
}
|
||||
|
||||
|
||||
|
||||
$user = $db->users()->where('username', $username)->fetch();
|
||||
if ($user == null)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user