Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/dav/lib/SetupChecks/NeedsSystemAddressBookSync.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function __construct(
}

public function getName(): string {
return $this->l10n->t('Checking for DAV system address book');
return $this->l10n->t('DAV system address book');
}

public function getCategory(): string {
Expand Down
2 changes: 1 addition & 1 deletion apps/settings/lib/SetupChecks/CheckUserCertificates.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function getCategory(): string {
}

public function getName(): string {
return $this->l10n->t('Checking for old user imported certificate');
return $this->l10n->t('Old user imported certificates');
}

public function run(): SetupResult {
Expand Down
2 changes: 1 addition & 1 deletion apps/settings/lib/SetupChecks/DefaultPhoneRegionSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function __construct(
}

public function getName(): string {
return $this->l10n->t('Checking for default phone region');
return $this->l10n->t('Default phone region');
}

public function getCategory(): string {
Expand Down
4 changes: 2 additions & 2 deletions apps/settings/lib/SetupChecks/LegacySSEKeyFormat.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ public function getCategory(): string {
}

public function getName(): string {
return $this->l10n->t('Checking for old server-side-encryption being disabled');
return $this->l10n->t('Old server-side-encryption');
}

public function run(): SetupResult {
if ($this->config->getSystemValueBool('encryption.legacy_format_support', false) === false) {
return SetupResult::success();
return SetupResult::success($this->l10n->t('Disabled'));
}
return SetupResult::warning($this->l10n->t('The old server-side-encryption format is enabled. We recommend disabling this.'), $this->urlGenerator->linkToDocs('admin-sse-legacy-format'));
}
Expand Down
4 changes: 2 additions & 2 deletions apps/settings/lib/SetupChecks/PhpDefaultCharset.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function __construct(
}

public function getName(): string {
return $this->l10n->t('Checking for PHP default charset');
return $this->l10n->t('PHP default charset');
}

public function getCategory(): string {
Expand All @@ -45,7 +45,7 @@ public function getCategory(): string {

public function run(): SetupResult {
if (strtoupper(trim(ini_get('default_charset'))) === 'UTF-8') {
return SetupResult::success();
return SetupResult::success('UTF-8');
} else {
return SetupResult::warning($this->l10n->t('PHP configuration option default_charset should be UTF-8'));
}
Expand Down
2 changes: 1 addition & 1 deletion apps/settings/lib/SetupChecks/PhpOutdated.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function getCategory(): string {
}

public function getName(): string {
return $this->l10n->t('Checking for PHP version');
return $this->l10n->t('PHP version');
}

public function run(): SetupResult {
Expand Down
4 changes: 2 additions & 2 deletions apps/settings/lib/SetupChecks/PhpOutputBuffering.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ public function getCategory(): string {
}

public function getName(): string {
return $this->l10n->t('Checking for PHP output_buffering option');
return $this->l10n->t('PHP output_buffering option');
}

public function run(): SetupResult {
$value = trim(ini_get('output_buffering'));
if ($value === '' || $value === '0') {
return SetupResult::success();
return SetupResult::success($this->l10n->t('Disabled'));
} else {
return SetupResult::error($this->l10n->t('PHP configuration option output_buffering must be disabled'));
}
Expand Down
2 changes: 1 addition & 1 deletion apps/settings/lib/SetupChecks/ReadOnlyConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function __construct(
}

public function getName(): string {
return $this->l10n->t('Checking for configuration file access rights');
return $this->l10n->t('Configuration file access rights');
}

public function getCategory(): string {
Expand Down
70 changes: 32 additions & 38 deletions apps/settings/lib/SetupChecks/SupportedDatabase.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,9 @@
*/
namespace OCA\Settings\SetupChecks;

use Doctrine\DBAL\Platforms\MariaDb1027Platform;
use Doctrine\DBAL\Platforms\MySQL57Platform;
use Doctrine\DBAL\Platforms\MySQL80Platform;
use Doctrine\DBAL\Platforms\MySQLPlatform;
use Doctrine\DBAL\Platforms\OraclePlatform;
use Doctrine\DBAL\Platforms\PostgreSQL100Platform;
use Doctrine\DBAL\Platforms\PostgreSQL94Platform;
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
use Doctrine\DBAL\Platforms\SqlitePlatform;
use OCP\IDBConnection;
use OCP\IL10N;
Expand All @@ -52,45 +48,43 @@ public function getCategory(): string {
}

public function getName(): string {
return $this->l10n->t('Checking for database version');
return $this->l10n->t('Database version');
}

public function run(): SetupResult {
switch (get_class($this->connection->getDatabasePlatform())) {
case MySQL80Platform::class: # extends MySQL57Platform
case MySQL57Platform::class: # extends MySQLPlatform
case MariaDb1027Platform::class: # extends MySQLPlatform
case MySQLPlatform::class:
$result = $this->connection->prepare("SHOW VARIABLES LIKE 'version';");
$result->execute();
$row = $result->fetch();
$version = strtolower($row['Value']);
$version = null;
$databasePlatform = $this->connection->getDatabasePlatform();
if ($databasePlatform instanceof MySQLPlatform) {
$result = $this->connection->prepare("SHOW VARIABLES LIKE 'version';");
$result->execute();
$row = $result->fetch();

Check notice

Code scanning / Psalm

DeprecatedMethod

The method OCP\DB\IPreparedStatement::fetch has been marked as deprecated
$version = $row['Value'];
$versionlc = strtolower($version);

if (str_contains($version, 'mariadb')) {
if (version_compare($version, '10.2', '<')) {
return SetupResult::warning($this->l10n->t('MariaDB version "%s" is used. Nextcloud 21 and higher do not support this version and require MariaDB 10.2 or higher.', $row['Value']));
}
} else {
if (version_compare($version, '8', '<')) {
return SetupResult::warning($this->l10n->t('MySQL version "%s" is used. Nextcloud 21 and higher do not support this version and require MySQL 8.0 or MariaDB 10.2 or higher.', $row['Value']));
}
if (str_contains($versionlc, 'mariadb')) {
if (version_compare($versionlc, '10.2', '<')) {
return SetupResult::warning($this->l10n->t('MariaDB version "%s" is used. Nextcloud 21 and higher do not support this version and require MariaDB 10.2 or higher.', $version));
}
break;
case SqlitePlatform::class:
break;
case PostgreSQL100Platform::class: # extends PostgreSQL94Platform
case PostgreSQL94Platform::class:
$result = $this->connection->prepare('SHOW server_version;');
$result->execute();
$row = $result->fetch();
if (version_compare($row['server_version'], '9.6', '<')) {
return SetupResult::warning($this->l10n->t('PostgreSQL version "%s" is used. Nextcloud 21 and higher do not support this version and require PostgreSQL 9.6 or higher.', $row['server_version']));
} else {
if (version_compare($versionlc, '8', '<')) {
return SetupResult::warning($this->l10n->t('MySQL version "%s" is used. Nextcloud 21 and higher do not support this version and require MySQL 8.0 or MariaDB 10.2 or higher.', $version));
}
break;
case OraclePlatform::class:
break;
}
} elseif ($databasePlatform instanceof PostgreSQLPlatform) {
$result = $this->connection->prepare('SHOW server_version;');
$result->execute();
$row = $result->fetch();

Check notice

Code scanning / Psalm

DeprecatedMethod

The method OCP\DB\IPreparedStatement::fetch has been marked as deprecated
$version = $row['server_version'];
if (version_compare(strtolower($version), '9.6', '<')) {
return SetupResult::warning($this->l10n->t('PostgreSQL version "%s" is used. Nextcloud 21 and higher do not support this version and require PostgreSQL 9.6 or higher.', $version));
}
} elseif ($databasePlatform instanceof OraclePlatform) {
$version = 'Oracle';
} elseif ($databasePlatform instanceof SqlitePlatform) {
$version = 'Sqlite';
} else {
return SetupResult::error($this->l10n->t('Unknown database plaform'));
}
// TODO still show db and version on success?
return SetupResult::success();
return SetupResult::success($version);
}
}
4 changes: 2 additions & 2 deletions apps/user_ldap/lib/SetupChecks/LdapInvalidUuids.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ public function getCategory(): string {
}

public function getName(): string {
return $this->l10n->t('Checking for invalid LDAP UUIDs');
return $this->l10n->t('Invalid LDAP UUIDs');
}

public function run(): SetupResult {
if (count($this->userMapping->getList(0, 1, true)) === 0
&& count($this->groupMapping->getList(0, 1, true)) === 0) {
return SetupResult::success();
return SetupResult::success($this->l10n->t('None found'));
} else {
return SetupResult::warning($this->l10n->t('Invalid UUIDs of LDAP users or groups have been found. Please review your "Override UUID detection" settings in the Expert part of the LDAP configuration and use "occ ldap:update-uuid" to update them.'));
}
Expand Down