mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-06 14:12:15 +00:00
Reformat various code.
This commit is contained in:
@@ -81,7 +81,7 @@ class RemoteUserGuard implements Guard
|
||||
$header = config('auth.guard_email');
|
||||
|
||||
if (null !== $header) {
|
||||
$emailAddress = (string)(request()->server($header) ?? null);
|
||||
$emailAddress = (string) (request()->server($header) ?? null);
|
||||
$preference = app('preferences')->getForUser($retrievedUser, 'remote_guard_alt_email');
|
||||
|
||||
if (null !== $emailAddress && null === $preference && $emailAddress !== $userID) {
|
||||
@@ -93,6 +93,14 @@ class RemoteUserGuard implements Guard
|
||||
$this->user = $retrievedUser;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function guest(): bool
|
||||
{
|
||||
return !$this->check();
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
@@ -104,9 +112,17 @@ class RemoteUserGuard implements Guard
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function guest(): bool
|
||||
public function user(): ?User
|
||||
{
|
||||
return !$this->check();
|
||||
return $this->user;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function hasUser()
|
||||
{
|
||||
// TODO: Implement hasUser() method.
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -125,14 +141,6 @@ class RemoteUserGuard implements Guard
|
||||
$this->user = $user;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function user(): ?User
|
||||
{
|
||||
return $this->user;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
@@ -140,12 +148,4 @@ class RemoteUserGuard implements Guard
|
||||
{
|
||||
throw new FireflyException('Did not implement RemoteUserGuard::validate()');
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function hasUser()
|
||||
{
|
||||
// TODO: Implement hasUser() method.
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,10 +57,10 @@ class RemoteUserProvider implements UserProvider
|
||||
Log::debug(sprintf('User with email "%s" not found. Will be created.', $identifier));
|
||||
$user = User::create(
|
||||
[
|
||||
'blocked' => false,
|
||||
'blocked' => false,
|
||||
'blocked_code' => null,
|
||||
'email' => $identifier,
|
||||
'password' => bcrypt(Str::random(64)),
|
||||
'email' => $identifier,
|
||||
'password' => bcrypt(Str::random(64)),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user