Skip to content

Commit b491b5f

Browse files
committed
Merge branch 'development' into release
2 parents 387c786 + 13dae24 commit b491b5f

File tree

388 files changed

+11308
-4535
lines changed

Some content is hidden

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

388 files changed

+11308
-4535
lines changed

.github/translators.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,3 +461,11 @@ Yannis Karlaftis (meliseus) :: Greek
461461
felixxx :: German Informal
462462
randi (randi65535) :: Korean
463463
test65428 :: Greek
464+
zeronell :: Chinese Simplified
465+
julien Vinber (julienVinber) :: French
466+
Hyunwoo Park (oksure) :: Korean
467+
aram.rafeq.7 (aramrafeq2) :: Kurdish
468+
Raphael Moreno (RaphaelMoreno) :: Portuguese, Brazilian
469+
yn (user99) :: Arabic
470+
Pavel Zlatarov (pzlatarov) :: Bulgarian
471+
ingelres :: French

.github/workflows/test-migrations.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
runs-on: ubuntu-24.04
1717
strategy:
1818
matrix:
19-
php: ['8.1', '8.2', '8.3', '8.4']
19+
php: ['8.2', '8.3', '8.4']
2020
steps:
2121
- uses: actions/checkout@v4
2222

.github/workflows/test-php.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ on:
1313
jobs:
1414
build:
1515
if: ${{ github.ref != 'refs/heads/l10n_development' }}
16-
runs-on: ubuntu-22.04
16+
runs-on: ubuntu-24.04
1717
strategy:
1818
matrix:
19-
php: ['8.1', '8.2', '8.3', '8.4']
19+
php: ['8.2', '8.3', '8.4']
2020
steps:
2121
- uses: actions/checkout@v4
2222

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2015-2024, Dan Brown and the BookStack Project contributors.
3+
Copyright (c) 2015-2025, Dan Brown and the BookStack project contributors.
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

app/Access/ExternalBaseUserProvider.php

Lines changed: 13 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,15 @@
88

99
class ExternalBaseUserProvider implements UserProvider
1010
{
11-
/**
12-
* The user model.
13-
*
14-
* @var string
15-
*/
16-
protected $model;
17-
18-
/**
19-
* LdapUserProvider constructor.
20-
*/
21-
public function __construct(string $model)
22-
{
23-
$this->model = $model;
11+
public function __construct(
12+
protected string $model
13+
) {
2414
}
2515

2616
/**
2717
* Create a new instance of the model.
28-
*
29-
* @return Model
3018
*/
31-
public function createModel()
19+
public function createModel(): Model
3220
{
3321
$class = '\\' . ltrim($this->model, '\\');
3422

@@ -37,25 +25,18 @@ public function createModel()
3725

3826
/**
3927
* Retrieve a user by their unique identifier.
40-
*
41-
* @param mixed $identifier
42-
*
43-
* @return Authenticatable|null
4428
*/
45-
public function retrieveById($identifier)
29+
public function retrieveById(mixed $identifier): ?Authenticatable
4630
{
4731
return $this->createModel()->newQuery()->find($identifier);
4832
}
4933

5034
/**
5135
* Retrieve a user by their unique identifier and "remember me" token.
5236
*
53-
* @param mixed $identifier
5437
* @param string $token
55-
*
56-
* @return Authenticatable|null
5738
*/
58-
public function retrieveByToken($identifier, $token)
39+
public function retrieveByToken(mixed $identifier, $token): null
5940
{
6041
return null;
6142
}
@@ -75,12 +56,8 @@ public function updateRememberToken(Authenticatable $user, $token)
7556

7657
/**
7758
* Retrieve a user by the given credentials.
78-
*
79-
* @param array $credentials
80-
*
81-
* @return Authenticatable|null
8259
*/
83-
public function retrieveByCredentials(array $credentials)
60+
public function retrieveByCredentials(array $credentials): ?Authenticatable
8461
{
8562
// Search current user base by looking up a uid
8663
$model = $this->createModel();
@@ -92,15 +69,15 @@ public function retrieveByCredentials(array $credentials)
9269

9370
/**
9471
* Validate a user against the given credentials.
95-
*
96-
* @param Authenticatable $user
97-
* @param array $credentials
98-
*
99-
* @return bool
10072
*/
101-
public function validateCredentials(Authenticatable $user, array $credentials)
73+
public function validateCredentials(Authenticatable $user, array $credentials): bool
10274
{
10375
// Should be done in the guard.
10476
return false;
10577
}
78+
79+
public function rehashPasswordIfRequired(Authenticatable $user, #[\SensitiveParameter] array $credentials, bool $force = false)
80+
{
81+
// No action to perform, any passwords are external in the auth system
82+
}
10683
}

app/Access/Ldap.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function setVersion($ldapConnection, int $version): bool
5454
*
5555
* @return \LDAP\Result|array|false
5656
*/
57-
public function search($ldapConnection, string $baseDn, string $filter, array $attributes = null)
57+
public function search($ldapConnection, string $baseDn, string $filter, array $attributes = [])
5858
{
5959
return ldap_search($ldapConnection, $baseDn, $filter, $attributes);
6060
}
@@ -66,7 +66,7 @@ public function search($ldapConnection, string $baseDn, string $filter, array $a
6666
*
6767
* @return \LDAP\Result|array|false
6868
*/
69-
public function read($ldapConnection, string $baseDn, string $filter, array $attributes = null)
69+
public function read($ldapConnection, string $baseDn, string $filter, array $attributes = [])
7070
{
7171
return ldap_read($ldapConnection, $baseDn, $filter, $attributes);
7272
}
@@ -87,7 +87,7 @@ public function getEntries($ldapConnection, $ldapSearchResult): array|false
8787
*
8888
* @param resource|\LDAP\Connection $ldapConnection
8989
*/
90-
public function searchAndGetEntries($ldapConnection, string $baseDn, string $filter, array $attributes = null): array|false
90+
public function searchAndGetEntries($ldapConnection, string $baseDn, string $filter, array $attributes = []): array|false
9191
{
9292
$search = $this->search($ldapConnection, $baseDn, $filter, $attributes);
9393

@@ -99,7 +99,7 @@ public function searchAndGetEntries($ldapConnection, string $baseDn, string $fil
9999
*
100100
* @param resource|\LDAP\Connection $ldapConnection
101101
*/
102-
public function bind($ldapConnection, string $bindRdn = null, string $bindPassword = null): bool
102+
public function bind($ldapConnection, ?string $bindRdn = null, ?string $bindPassword = null): bool
103103
{
104104
return ldap_bind($ldapConnection, $bindRdn, $bindPassword);
105105
}

app/Access/LdapService.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,14 @@ public function getUserDetails(string $userName): ?array
112112
return null;
113113
}
114114

115-
$userCn = $this->getUserResponseProperty($user, 'cn', null);
115+
$nameDefault = $this->getUserResponseProperty($user, 'cn', null);
116+
if (is_null($nameDefault)) {
117+
$nameDefault = ldap_explode_dn($user['dn'], 1)[0] ?? $user['dn'];
118+
}
119+
116120
$formatted = [
117121
'uid' => $this->getUserResponseProperty($user, $idAttr, $user['dn']),
118-
'name' => $this->getUserDisplayName($user, $displayNameAttrs, $userCn),
122+
'name' => $this->getUserDisplayName($user, $displayNameAttrs, $nameDefault),
119123
'dn' => $user['dn'],
120124
'email' => $this->getUserResponseProperty($user, $emailAttr, null),
121125
'avatar' => $thumbnailAttr ? $this->getUserResponseProperty($user, $thumbnailAttr, null) : null,

app/Access/SocialDriverManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public function addSocialDriver(
9292
string $driverName,
9393
array $config,
9494
string $socialiteHandler,
95-
callable $configureForRedirect = null
95+
?callable $configureForRedirect = null
9696
) {
9797
$this->validDrivers[] = $driverName;
9898
config()->set('services.' . $driverName, $config);

app/Activity/ActivityType.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ class ActivityType
7171
const IMPORT_RUN = 'import_run';
7272
const IMPORT_DELETE = 'import_delete';
7373

74+
const SORT_RULE_CREATE = 'sort_rule_create';
75+
const SORT_RULE_UPDATE = 'sort_rule_update';
76+
const SORT_RULE_DELETE = 'sort_rule_delete';
77+
7478
/**
7579
* Get all the possible values.
7680
*/

app/Activity/Controllers/AuditLogController.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use BookStack\Activity\ActivityType;
66
use BookStack\Activity\Models\Activity;
77
use BookStack\Http\Controller;
8+
use BookStack\Sorting\SortUrl;
89
use BookStack\Util\SimpleListOptions;
910
use Illuminate\Http\Request;
1011

@@ -65,6 +66,7 @@ public function index(Request $request)
6566
'filters' => $filters,
6667
'listOptions' => $listOptions,
6768
'activityTypes' => $types,
69+
'filterSortUrl' => new SortUrl('settings/audit', array_filter($request->except('page')))
6870
]);
6971
}
7072
}

0 commit comments

Comments
 (0)