Skip to content

Commit

Permalink
improve admin message of some extensions
Browse files Browse the repository at this point in the history
Signed-off-by: szaimen <szaimen@e.mail.de>
  • Loading branch information
szaimen committed Mar 7, 2022
1 parent 7aab8d8 commit 70bd008
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 15 deletions.
35 changes: 21 additions & 14 deletions apps/settings/lib/Controller/CheckSetupController.php
Original file line number Diff line number Diff line change
Expand Up @@ -709,20 +709,6 @@ protected function hasRecommendedPHPModules(): array {
$recommendedPHPModules[] = 'intl';
}

if (!extension_loaded('bcmath')) {
$recommendedPHPModules[] = 'bcmath';
}

if (!extension_loaded('gmp')) {
$recommendedPHPModules[] = 'gmp';
}

if ($this->config->getAppValue('theming', 'enabled', 'no') === 'yes' && $this->config->getAppValue('core', 'disableImagickWarning', '') !== 'yes') {
if (!extension_loaded('imagick')) {
$recommendedPHPModules[] = 'imagick';
}
}

if (!defined('PASSWORD_ARGON2I') && PHP_VERSION_ID >= 70400) {
// Installing php-sodium on >=php7.4 will provide PASSWORD_ARGON2I
// on previous version argon2 wasn't part of the "standard" extension
Expand All @@ -734,6 +720,25 @@ protected function hasRecommendedPHPModules(): array {
return $recommendedPHPModules;
}

protected function isImagickEnabled(): bool {
if ($this->config->getAppValue('theming', 'enabled', 'no') === 'yes') {
if (!extension_loaded('imagick')) {
return false;
}
}
return true;
}

protected function areWebauthnExtensionsEnabled(): bool {
if (!extension_loaded('bcmath')) {
return false;
}
if (!extension_loaded('gmp')) {
return false;
}
return true;
}

protected function isMysqlUsedWithoutUTF8MB4(): bool {
return ($this->config->getSystemValue('dbtype', 'sqlite') === 'mysql') && ($this->config->getSystemValue('mysql.utf8mb4', false) === false);
}
Expand Down Expand Up @@ -865,6 +870,8 @@ public function check() {
'databaseConversionDocumentation' => $this->urlGenerator->linkToDocs('admin-db-conversion'),
'isMemoryLimitSufficient' => $this->memoryInfo->isMemoryLimitSufficient(),
'appDirsWithDifferentOwner' => $this->getAppDirsWithDifferentOwner(),
'isImagickEnabled' => $this->isImagickEnabled(),
'areWebauthnExtensionsEnabled' => $this->areWebauthnExtensionsEnabled(),
'recommendedPHPModules' => $this->hasRecommendedPHPModules(),
'pendingBigIntConversionColumns' => $this->hasBigIntConversionPendingColumns(),
'isMysqlUsedWithoutUTF8MB4' => $this->isMysqlUsedWithoutUTF8MB4(),
Expand Down
20 changes: 19 additions & 1 deletion core/js/setupchecks.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@
}
if(!data.hasFileinfoInstalled) {
messages.push({
msg: t('core', 'The PHP module "fileinfo" is missing. It is strongly recommended to enable this module to get the best results with MIME type detection.'),
msg: t('core', 'The PHP "fileinfo" is missing. It is strongly recommended to enable this module to get the best results with MIME type detection.'),
type: OC.SetupChecks.MESSAGE_TYPE_INFO
});
}
Expand Down Expand Up @@ -423,6 +423,24 @@
type: OC.SetupChecks.MESSAGE_TYPE_INFO
})
}
if (!data.isImagickEnabled) {
messages.push({
msg: t(
'core',
'Imagick is not enabled although the theming app is. For Favicon generation to work correctly, you need to install the imagick PHP extension.'
),
type: OC.SetupChecks.MESSAGE_TYPE_INFO
})
}
if (!data.areWebauthnExtensionsEnabled) {
messages.push({
msg: t(
'core',
'The PHP extensions gmp or bcmath are not enabled. For Webauthn to work correctly, please enable these extensions.'
),
type: OC.SetupChecks.MESSAGE_TYPE_INFO
})
}
if (data.imageMagickLacksSVGSupport) {
messages.push({
msg: t(
Expand Down

0 comments on commit 70bd008

Please sign in to comment.