Skip to content

Commit 7dca146

Browse files
szaimenMichaIng
andcommitted
allow to disable the imagick warning
Signed-off-by: szaimen <[email protected]> Co-Authored-By: MichaIng <[email protected]>
1 parent e96c859 commit 7dca146

File tree

2 files changed

+39
-14
lines changed

2 files changed

+39
-14
lines changed

apps/settings/lib/Controller/CheckSetupController.php

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -709,20 +709,6 @@ protected function hasRecommendedPHPModules(): array {
709709
$recommendedPHPModules[] = 'intl';
710710
}
711711

712-
if (!extension_loaded('bcmath')) {
713-
$recommendedPHPModules[] = 'bcmath';
714-
}
715-
716-
if (!extension_loaded('gmp')) {
717-
$recommendedPHPModules[] = 'gmp';
718-
}
719-
720-
if ($this->config->getAppValue('theming', 'enabled', 'no') === 'yes') {
721-
if (!extension_loaded('imagick')) {
722-
$recommendedPHPModules[] = 'imagick';
723-
}
724-
}
725-
726712
if (!defined('PASSWORD_ARGON2I') && PHP_VERSION_ID >= 70400) {
727713
// Installing php-sodium on >=php7.4 will provide PASSWORD_ARGON2I
728714
// on previous version argon2 wasn't part of the "standard" extension
@@ -734,6 +720,25 @@ protected function hasRecommendedPHPModules(): array {
734720
return $recommendedPHPModules;
735721
}
736722

723+
protected function isImagickEnabled(): bool {
724+
if ($this->config->getAppValue('theming', 'enabled', 'no') === 'yes') {
725+
if (!extension_loaded('imagick')) {
726+
return false;
727+
}
728+
}
729+
return true;
730+
}
731+
732+
protected function areWebauthnExtensionsEnabled(): bool {
733+
if (!extension_loaded('bcmath')) {
734+
return false;
735+
}
736+
if (!extension_loaded('gmp')) {
737+
return false;
738+
}
739+
return true;
740+
}
741+
737742
protected function isMysqlUsedWithoutUTF8MB4(): bool {
738743
return ($this->config->getSystemValue('dbtype', 'sqlite') === 'mysql') && ($this->config->getSystemValue('mysql.utf8mb4', false) === false);
739744
}
@@ -865,6 +870,8 @@ public function check() {
865870
'databaseConversionDocumentation' => $this->urlGenerator->linkToDocs('admin-db-conversion'),
866871
'isMemoryLimitSufficient' => $this->memoryInfo->isMemoryLimitSufficient(),
867872
'appDirsWithDifferentOwner' => $this->getAppDirsWithDifferentOwner(),
873+
'isImagickEnabled' => $this->isImagickEnabled(),
874+
'areWebauthnExtensionsEnabled' => $this->areWebauthnExtensionsEnabled(),
868875
'recommendedPHPModules' => $this->hasRecommendedPHPModules(),
869876
'pendingBigIntConversionColumns' => $this->hasBigIntConversionPendingColumns(),
870877
'isMysqlUsedWithoutUTF8MB4' => $this->isMysqlUsedWithoutUTF8MB4(),

core/js/setupchecks.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,24 @@
423423
type: OC.SetupChecks.MESSAGE_TYPE_INFO
424424
})
425425
}
426+
if (!data.isImagickEnabled) {
427+
messages.push({
428+
msg: t(
429+
'core',
430+
'The PHP module "imagick" is not enabled although the theming app is. For favicon generation to work correctly, you need to install and enable this module.'
431+
),
432+
type: OC.SetupChecks.MESSAGE_TYPE_INFO
433+
})
434+
}
435+
if (!data.areWebauthnExtensionsEnabled) {
436+
messages.push({
437+
msg: t(
438+
'core',
439+
'The PHP modules "gmp" and/or "bcmath" are not enabled. If you use WebAuthn passwordless authentication, these modules are required.'
440+
),
441+
type: OC.SetupChecks.MESSAGE_TYPE_INFO
442+
})
443+
}
426444
if (data.imageMagickLacksSVGSupport) {
427445
messages.push({
428446
msg: t(

0 commit comments

Comments
 (0)