Skip to content

Commit cfcaca3

Browse files
szaimenMichaIng
andcommitted
allow to disable the imagick warning
Signed-off-by: szaimen <szaimen@e.mail.de> Co-Authored-By: MichaIng <micha@dietpi.com>
1 parent 5f64492 commit cfcaca3

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
@@ -714,20 +714,6 @@ protected function hasRecommendedPHPModules(): array {
714714
$recommendedPHPModules[] = 'intl';
715715
}
716716

717-
if (!extension_loaded('bcmath')) {
718-
$recommendedPHPModules[] = 'bcmath';
719-
}
720-
721-
if (!extension_loaded('gmp')) {
722-
$recommendedPHPModules[] = 'gmp';
723-
}
724-
725-
if ($this->config->getAppValue('theming', 'enabled', 'no') === 'yes') {
726-
if (!extension_loaded('imagick')) {
727-
$recommendedPHPModules[] = 'imagick';
728-
}
729-
}
730-
731717
if (!defined('PASSWORD_ARGON2I') && PHP_VERSION_ID >= 70400) {
732718
// Installing php-sodium on >=php7.4 will provide PASSWORD_ARGON2I
733719
// on previous version argon2 wasn't part of the "standard" extension
@@ -739,6 +725,25 @@ protected function hasRecommendedPHPModules(): array {
739725
return $recommendedPHPModules;
740726
}
741727

728+
protected function isImagickEnabled(): bool {
729+
if ($this->config->getAppValue('theming', 'enabled', 'no') === 'yes') {
730+
if (!extension_loaded('imagick')) {
731+
return false;
732+
}
733+
}
734+
return true;
735+
}
736+
737+
protected function areWebauthnExtensionsEnabled(): bool {
738+
if (!extension_loaded('bcmath')) {
739+
return false;
740+
}
741+
if (!extension_loaded('gmp')) {
742+
return false;
743+
}
744+
return true;
745+
}
746+
742747
protected function isMysqlUsedWithoutUTF8MB4(): bool {
743748
return ($this->config->getSystemValue('dbtype', 'sqlite') === 'mysql') && ($this->config->getSystemValue('mysql.utf8mb4', false) === false);
744749
}
@@ -870,6 +875,8 @@ public function check() {
870875
'databaseConversionDocumentation' => $this->urlGenerator->linkToDocs('admin-db-conversion'),
871876
'isMemoryLimitSufficient' => $this->memoryInfo->isMemoryLimitSufficient(),
872877
'appDirsWithDifferentOwner' => $this->getAppDirsWithDifferentOwner(),
878+
'isImagickEnabled' => $this->isImagickEnabled(),
879+
'areWebauthnExtensionsEnabled' => $this->areWebauthnExtensionsEnabled(),
873880
'recommendedPHPModules' => $this->hasRecommendedPHPModules(),
874881
'pendingBigIntConversionColumns' => $this->hasBigIntConversionPendingColumns(),
875882
'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)