mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-29 18:20:01 +00:00
Fix all test channels for user and owner.
This commit is contained in:
@@ -105,6 +105,26 @@ class Preferences
|
||||
|
||||
return $this->getForUser($user, $name, $default);
|
||||
}
|
||||
public function getEncryptedForUser(User $user, string $name, null|array|bool|int|string $default = null): ?Preference
|
||||
{
|
||||
$result = $this->getForUser($user, $name, $default);
|
||||
if ('' === $result->data) {
|
||||
Log::warning(sprintf('Empty encrypted preference found: "%s"', $name));
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
try {
|
||||
$result->data = decrypt($result->data);
|
||||
} catch (DecryptException $e) {
|
||||
Log::error(sprintf('Could not decrypt preference "%s": %s', $name, $e->getMessage()));
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function getForUser(User $user, string $name, null|array|bool|int|string $default = null): ?Preference
|
||||
{
|
||||
|
Reference in New Issue
Block a user