Skip to content

Commit 8de2c28

Browse files
committed
Merge branch 'development' into release
2 parents 0838d5e + 5bf2d80 commit 8de2c28

File tree

350 files changed

+7495
-3294
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

350 files changed

+7495
-3294
lines changed

.env.example.complete

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,14 @@ APP_LANG=en
3636
# APP_LANG will be used if such a header is not provided.
3737
APP_AUTO_LANG_PUBLIC=true
3838

39-
# Application timezone
40-
# Used where dates are displayed such as on exported content.
39+
# Application timezones
40+
# The first option is used to determine what timezone is used for date storage.
41+
# Leaving that as "UTC" is advised.
42+
# The second option is used to set the timezone which will be used for date
43+
# formatting and display. This defaults to the "APP_TIMEZONE" value.
4144
# Valid timezone values can be found here: https://www.php.net/manual/en/timezones.php
4245
APP_TIMEZONE=UTC
46+
APP_DISPLAY_TIMEZONE=UTC
4347

4448
# Application theme
4549
# Used to specific a themes/<APP_THEME> folder where BookStack UI

.github/translators.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ Alexander Predl (Harveyhase68) :: German
177177
Rem (Rem9000) :: Dutch
178178
Michał Stelmach (stelmach-web) :: Polish
179179
arniom :: French
180-
REMOVED_USER :: French; Dutch; Portuguese, Brazilian; Portuguese; Turkish;
180+
REMOVED_USER :: French; German; Dutch; Portuguese, Brazilian; Portuguese; Turkish;
181181
林祖年 (contagion) :: Chinese Traditional
182182
Siamak Guodarzi (siamakgoudarzi88) :: Persian
183183
Lis Maestrelo (lismtrl) :: Portuguese, Brazilian
@@ -222,7 +222,7 @@ SmokingCrop :: Dutch
222222
Maciej Lebiest (Szwendacz) :: Polish
223223
DiscordDigital :: German; German Informal
224224
Gábor Marton (dodver) :: Hungarian
225-
Jasell :: Swedish
225+
Jakob Åsell (Jasell) :: Swedish
226226
Ghost_chu (ghostchu) :: Chinese Simplified
227227
Ravid Shachar (ravidshachar) :: Hebrew
228228
Helga Guchshenskaya (guchshenskaya) :: Russian
@@ -509,3 +509,5 @@ iamwhoiamwhoami :: Swedish
509509
Grogui :: French
510510
MrCharlesIII :: Arabic
511511
David Olsen (dawin) :: Danish
512+
ltnzr :: French
513+
Frank Holler (holler.frank) :: German; German Informal

app/Access/ExternalBaseUserProvider.php

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,18 @@
22

33
namespace BookStack\Access;
44

5+
use BookStack\Users\Models\User;
56
use Illuminate\Contracts\Auth\Authenticatable;
67
use Illuminate\Contracts\Auth\UserProvider;
7-
use Illuminate\Database\Eloquent\Model;
88

99
class ExternalBaseUserProvider implements UserProvider
1010
{
11-
public function __construct(
12-
protected string $model
13-
) {
14-
}
15-
16-
/**
17-
* Create a new instance of the model.
18-
*/
19-
public function createModel(): Model
20-
{
21-
$class = '\\' . ltrim($this->model, '\\');
22-
23-
return new $class();
24-
}
25-
2611
/**
2712
* Retrieve a user by their unique identifier.
2813
*/
2914
public function retrieveById(mixed $identifier): ?Authenticatable
3015
{
31-
return $this->createModel()->newQuery()->find($identifier);
16+
return User::query()->find($identifier);
3217
}
3318

3419
/**
@@ -59,10 +44,7 @@ public function updateRememberToken(Authenticatable $user, $token)
5944
*/
6045
public function retrieveByCredentials(array $credentials): ?Authenticatable
6146
{
62-
// Search current user base by looking up a uid
63-
$model = $this->createModel();
64-
65-
return $model->newQuery()
47+
return User::query()
6648
->where('external_auth_id', $credentials['external_auth_id'])
6749
->first();
6850
}

app/Access/Guards/AsyncExternalBaseSessionGuard.php

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,28 @@
33
namespace BookStack\Access\Guards;
44

55
/**
6-
* Saml2 Session Guard.
6+
* External Auth Session Guard.
77
*
8-
* The saml2 login process is async in nature meaning it does not fit very well
9-
* into the default laravel 'Guard' auth flow. Instead most of the logic is done
10-
* via the Saml2 controller & Saml2Service. This class provides a safer, thin
11-
* version of SessionGuard.
8+
* The login process for external auth (SAML2/OIDC) is async in nature, meaning it does not fit very well
9+
* into the default laravel 'Guard' auth flow. Instead, most of the logic is done via the relevant
10+
* controller and services. This class provides a safer, thin version of SessionGuard.
1211
*/
1312
class AsyncExternalBaseSessionGuard extends ExternalBaseSessionGuard
1413
{
1514
/**
1615
* Validate a user's credentials.
17-
*
18-
* @param array $credentials
19-
*
20-
* @return bool
2116
*/
22-
public function validate(array $credentials = [])
17+
public function validate(array $credentials = []): bool
2318
{
2419
return false;
2520
}
2621

2722
/**
2823
* Attempt to authenticate a user using the given credentials.
2924
*
30-
* @param array $credentials
3125
* @param bool $remember
32-
*
33-
* @return bool
3426
*/
35-
public function attempt(array $credentials = [], $remember = false)
27+
public function attempt(array $credentials = [], $remember = false): bool
3628
{
3729
return false;
3830
}

0 commit comments

Comments
 (0)