mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-28 17:02:04 +03:00
Guest control: Cleaned methods involved in fetching/handling
- Moves guest user caching from User class to app container for simplicity. - Updates test to use simpler $this->users->guest() method for consistency. - Streamlined helpers to avoid function overlap for simplicity. - Extracted user profile dropdown while doing changes.
This commit is contained in:
@ -47,7 +47,7 @@ class SettingService
|
||||
$default = config('setting-defaults.user.' . $key, false);
|
||||
}
|
||||
|
||||
if ($user->isDefault()) {
|
||||
if ($user->isGuest()) {
|
||||
return $this->getFromSession($key, $default);
|
||||
}
|
||||
|
||||
@ -206,7 +206,7 @@ class SettingService
|
||||
*/
|
||||
public function putUser(User $user, string $key, string $value): bool
|
||||
{
|
||||
if ($user->isDefault()) {
|
||||
if ($user->isGuest()) {
|
||||
session()->put($key, $value);
|
||||
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user