Skip to content

Commit 3ca15ad

Browse files
committed
Merge branch 'development' into release
2 parents 6001498 + 36f0a68 commit 3ca15ad

File tree

313 files changed

+5478
-1946
lines changed

Some content is hidden

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

313 files changed

+5478
-1946
lines changed

.env.example.complete

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,10 @@ STORAGE_URL=false
143143
# Can be 'standard', 'ldap', 'saml2' or 'oidc'
144144
AUTH_METHOD=standard
145145

146+
# Automatically initiate login via external auth system if it's the only auth method.
147+
# Works with saml2 or oidc auth methods.
148+
AUTH_AUTO_INITIATE=false
149+
146150
# Social authentication configuration
147151
# All disabled by default.
148152
# Refer to https://www.bookstackapp.com/docs/admin/third-party-auth/

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
# These are supported funding model platforms
22

33
github: [ssddanbrown]
4+
ko_fi: ssddanbrown

.github/ISSUE_TEMPLATE/language_request.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Language Request
2-
description: Request a new language to be added to CrowdIn for you to translate
2+
description: Request a new language to be added to Crowdin for you to translate
33
labels: [":earth_africa: Translations"]
44
assignees:
55
- ssddanbrown
@@ -23,7 +23,7 @@ body:
2323
This issue template is to request a new language be added to our [Crowdin translation management project](https://crowdin.com/project/bookstack).
2424
Please don't use this template to request a new language that you are not prepared to provide translations for.
2525
options:
26-
- label: I confirm I'm offering to help translate for this new language via CrowdIn.
26+
- label: I confirm I'm offering to help translate for this new language via Crowdin.
2727
required: true
2828
- type: markdown
2929
attributes:

.github/translators.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,3 +243,18 @@ Shukrullo (vodiylik) :: Uzbek
243243
William W. (Nevnt) :: Chinese Traditional
244244
eamaro :: Portuguese
245245
Ypsilon-dev :: Arabic
246+
Hieu Vuong Trung (vuongtrunghieu) :: Vietnamese
247+
David Clubb (davidoclubb) :: Welsh
248+
welles freire (wellesximenes) :: Portuguese, Brazilian
249+
Magnus Jensen (MagnusHJensen) :: Danish
250+
Hesley Magno (hesleymagno) :: Portuguese, Brazilian
251+
Éric Gaspar (erga) :: French
252+
Fr3shlama :: German
253+
DSR :: Spanish, Argentina
254+
Andrii Bodnar (andrii-bodnar) :: Ukrainian
255+
Younes el Anjri (younesea28) :: Dutch
256+
Guclu Ozturk (gucluoz) :: Turkish
257+
Atmis :: French
258+
redjack666 :: Chinese Traditional
259+
Ashita007 :: Russian
260+
lihaorr :: Chinese Simplified

app/Actions/ActivityType.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@ class ActivityType
1616
const CHAPTER_MOVE = 'chapter_move';
1717

1818
const BOOK_CREATE = 'book_create';
19+
const BOOK_CREATE_FROM_CHAPTER = 'book_create_from_chapter';
1920
const BOOK_UPDATE = 'book_update';
2021
const BOOK_DELETE = 'book_delete';
2122
const BOOK_SORT = 'book_sort';
2223

2324
const BOOKSHELF_CREATE = 'bookshelf_create';
25+
const BOOKSHELF_CREATE_FROM_BOOK = 'bookshelf_create_from_book';
2426
const BOOKSHELF_UPDATE = 'bookshelf_update';
2527
const BOOKSHELF_DELETE = 'bookshelf_delete';
2628

app/Actions/TagRepo.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ public function queryWithTotals(string $searchTerm, string $nameFilter): Builder
2828
'name',
2929
($searchTerm || $nameFilter) ? 'value' : DB::raw('COUNT(distinct value) as `values`'),
3030
DB::raw('COUNT(id) as usages'),
31-
DB::raw('SUM(IF(entity_type = \'BookStack\\\\Page\', 1, 0)) as page_count'),
32-
DB::raw('SUM(IF(entity_type = \'BookStack\\\\Chapter\', 1, 0)) as chapter_count'),
33-
DB::raw('SUM(IF(entity_type = \'BookStack\\\\Book\', 1, 0)) as book_count'),
34-
DB::raw('SUM(IF(entity_type = \'BookStack\\\\BookShelf\', 1, 0)) as shelf_count'),
31+
DB::raw('SUM(IF(entity_type = \'page\', 1, 0)) as page_count'),
32+
DB::raw('SUM(IF(entity_type = \'chapter\', 1, 0)) as chapter_count'),
33+
DB::raw('SUM(IF(entity_type = \'book\', 1, 0)) as book_count'),
34+
DB::raw('SUM(IF(entity_type = \'bookshelf\', 1, 0)) as shelf_count'),
3535
])
3636
->orderBy($nameFilter ? 'value' : 'name');
3737

app/Auth/Access/GroupSyncService.php

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,27 @@ protected function roleMatchesGroupNames(Role $role, array $groupNames): bool
2828
*/
2929
protected function externalIdMatchesGroupNames(string $externalId, array $groupNames): bool
3030
{
31-
$externalAuthIds = explode(',', strtolower($externalId));
32-
33-
foreach ($externalAuthIds as $externalAuthId) {
34-
if (in_array(trim($externalAuthId), $groupNames)) {
31+
foreach ($this->parseRoleExternalAuthId($externalId) as $externalAuthId) {
32+
if (in_array($externalAuthId, $groupNames)) {
3533
return true;
3634
}
3735
}
3836

3937
return false;
4038
}
4139

40+
protected function parseRoleExternalAuthId(string $externalId): array
41+
{
42+
$inputIds = preg_split('/(?<!\\\),/', $externalId);
43+
$cleanIds = [];
44+
45+
foreach ($inputIds as $inputId) {
46+
$cleanIds[] = str_replace('\,', ',', trim($inputId));
47+
}
48+
49+
return $cleanIds;
50+
}
51+
4252
/**
4353
* Match an array of group names to BookStack system roles.
4454
* Formats group names to be lower-case and hyphenated.

app/Config/app.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
'locale' => env('APP_LANG', 'en'),
7272

7373
// Locales available
74-
'locales' => ['en', 'ar', 'bg', 'bs', 'ca', 'cs', 'da', 'de', 'de_informal', 'es', 'es_AR', 'et', 'eu', 'fa', 'fr', 'he', 'hr', 'hu', 'id', 'it', 'ja', 'ko', 'lt', 'lv', 'nl', 'nb', 'pt', 'pt_BR', 'sk', 'sl', 'sv', 'pl', 'ru', 'th', 'tr', 'uk', 'uz', 'vi', 'zh_CN', 'zh_TW'],
74+
'locales' => ['en', 'ar', 'bg', 'bs', 'ca', 'cs', 'cy', 'da', 'de', 'de_informal', 'es', 'es_AR', 'et', 'eu', 'fa', 'fr', 'he', 'hr', 'hu', 'id', 'it', 'ja', 'ko', 'lt', 'lv', 'nl', 'nb', 'pt', 'pt_BR', 'sk', 'sl', 'sv', 'pl', 'ru', 'th', 'tr', 'uk', 'uz', 'vi', 'zh_CN', 'zh_TW'],
7575

7676
// Application Fallback Locale
7777
'fallback_locale' => 'en',

app/Config/auth.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
// Options: standard, ldap, saml2, oidc
1414
'method' => env('AUTH_METHOD', 'standard'),
1515

16+
// Automatically initiate login via external auth system if it's the sole auth method.
17+
// Works with saml2 or oidc auth methods.
18+
'auto_initiate' => env('AUTH_AUTO_INITIATE', false),
19+
1620
// Authentication Defaults
1721
// This option controls the default authentication "guard" and password
1822
// reset options for your application.

app/Config/session.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
// to the server if the browser has a HTTPS connection. This will keep
7373
// the cookie from being sent to you if it can not be done securely.
7474
'secure' => env('SESSION_SECURE_COOKIE', null)
75-
?? Str::startsWith(env('APP_URL'), 'https:'),
75+
?? Str::startsWith(env('APP_URL', ''), 'https:'),
7676

7777
// HTTP Access Only
7878
// Setting this value to true will prevent JavaScript from accessing the

0 commit comments

Comments
 (0)