summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@users.noreply.github.com>2024-02-24 13:13:15 +0100
committerGitHub <noreply@github.com>2024-02-24 13:13:15 +0100
commitbe74c03de2c44664cd7fb4df5288279051044ad1 (patch)
treebfaf51e5fb7cc99a30f43debc6ff4d61c5aa0be7 /apps
parente79d42604d475646f4a83a674d85f8ce4f4dc07d (diff)
parent2f41b9c09261e421967f65518bc1ec063efe92c3 (diff)
downloadnextcloud-server-be74c03de2c44664cd7fb4df5288279051044ad1.tar.gz
nextcloud-server-be74c03de2c44664cd7fb4df5288279051044ad1.zip
Merge pull request #39276 from nextcloud/fix/noid/full-upper-const
Diffstat (limited to 'apps')
-rw-r--r--apps/files_external/lib/Command/Applicable.php2
-rw-r--r--apps/files_external/lib/Config/ConfigAdapter.php2
-rw-r--r--apps/files_external/lib/Controller/StoragesController.php2
-rw-r--r--apps/files_external/lib/Controller/UserGlobalStoragesController.php2
-rw-r--r--apps/files_external/lib/Lib/StorageConfig.php8
-rw-r--r--apps/files_external/lib/Service/DBConfigService.php4
-rw-r--r--apps/files_external/lib/Service/UserStoragesService.php5
-rw-r--r--apps/files_external/tests/Auth/Password/GlobalAuth.php2
-rw-r--r--apps/files_external/tests/Service/DBConfigServiceTest.php10
9 files changed, 20 insertions, 17 deletions
diff --git a/apps/files_external/lib/Command/Applicable.php b/apps/files_external/lib/Command/Applicable.php
index dbedc72825c..6d917ae11b1 100644
--- a/apps/files_external/lib/Command/Applicable.php
+++ b/apps/files_external/lib/Command/Applicable.php
@@ -91,7 +91,7 @@ class Applicable extends Base {
return Response::HTTP_NOT_FOUND;
}
- if ($mount->getType() === StorageConfig::MOUNT_TYPE_PERSONAl) {
+ if ($mount->getType() === StorageConfig::MOUNT_TYPE_PERSONAL) {
$output->writeln('<error>Can\'t change applicables on personal mounts</error>');
return self::FAILURE;
}
diff --git a/apps/files_external/lib/Config/ConfigAdapter.php b/apps/files_external/lib/Config/ConfigAdapter.php
index c06df7765b6..a60ee84820b 100644
--- a/apps/files_external/lib/Config/ConfigAdapter.php
+++ b/apps/files_external/lib/Config/ConfigAdapter.php
@@ -140,7 +140,7 @@ class ConfigAdapter implements IMountProvider {
}, $storages, $storageConfigs);
$mounts = array_map(function (StorageConfig $storageConfig, Storage\IStorage $storage) use ($user, $loader) {
- if ($storageConfig->getType() === StorageConfig::MOUNT_TYPE_PERSONAl) {
+ if ($storageConfig->getType() === StorageConfig::MOUNT_TYPE_PERSONAL) {
return new PersonalMount(
$this->userStoragesService,
$storageConfig,
diff --git a/apps/files_external/lib/Controller/StoragesController.php b/apps/files_external/lib/Controller/StoragesController.php
index 229e2d1930e..157ea0e7088 100644
--- a/apps/files_external/lib/Controller/StoragesController.php
+++ b/apps/files_external/lib/Controller/StoragesController.php
@@ -307,7 +307,7 @@ abstract class StoragesController extends Controller {
$data = $storage->jsonSerialize(true);
$isAdmin = $this->groupManager->isAdmin($this->userSession->getUser()->getUID());
- $data['can_edit'] = $storage->getType() === StorageConfig::MOUNT_TYPE_PERSONAl || $isAdmin;
+ $data['can_edit'] = $storage->getType() === StorageConfig::MOUNT_TYPE_PERSONAL || $isAdmin;
return new DataResponse(
$data,
diff --git a/apps/files_external/lib/Controller/UserGlobalStoragesController.php b/apps/files_external/lib/Controller/UserGlobalStoragesController.php
index 7b3f54d25c7..5ada021ccab 100644
--- a/apps/files_external/lib/Controller/UserGlobalStoragesController.php
+++ b/apps/files_external/lib/Controller/UserGlobalStoragesController.php
@@ -138,7 +138,7 @@ class UserGlobalStoragesController extends StoragesController {
$data = $storage->jsonSerialize(true);
$isAdmin = $this->groupManager->isAdmin($this->userSession->getUser()->getUID());
- $data['can_edit'] = $storage->getType() === StorageConfig::MOUNT_TYPE_PERSONAl || $isAdmin;
+ $data['can_edit'] = $storage->getType() === StorageConfig::MOUNT_TYPE_PERSONAL || $isAdmin;
return new DataResponse(
$data,
diff --git a/apps/files_external/lib/Lib/StorageConfig.php b/apps/files_external/lib/Lib/StorageConfig.php
index 9e89e8fcc99..2d7d0687635 100644
--- a/apps/files_external/lib/Lib/StorageConfig.php
+++ b/apps/files_external/lib/Lib/StorageConfig.php
@@ -40,6 +40,8 @@ use OCA\Files_External\ResponseDefinitions;
*/
class StorageConfig implements \JsonSerializable {
public const MOUNT_TYPE_ADMIN = 1;
+ public const MOUNT_TYPE_PERSONAL = 2;
+ /** @deprecated use MOUNT_TYPE_PERSONAL (full uppercase) instead */
public const MOUNT_TYPE_PERSONAl = 2;
/**
@@ -384,14 +386,14 @@ class StorageConfig implements \JsonSerializable {
}
/**
- * @return int self::MOUNT_TYPE_ADMIN or self::MOUNT_TYPE_PERSONAl
+ * @return int self::MOUNT_TYPE_ADMIN or self::MOUNT_TYPE_PERSONAL
*/
public function getType() {
return $this->type;
}
/**
- * @param int $type self::MOUNT_TYPE_ADMIN or self::MOUNT_TYPE_PERSONAl
+ * @param int $type self::MOUNT_TYPE_ADMIN or self::MOUNT_TYPE_PERSONAL
*/
public function setType($type) {
$this->type = $type;
@@ -435,7 +437,7 @@ class StorageConfig implements \JsonSerializable {
$result['statusMessage'] = $this->statusMessage;
}
$result['userProvided'] = $this->authMechanism instanceof IUserProvided;
- $result['type'] = ($this->getType() === self::MOUNT_TYPE_PERSONAl) ? 'personal': 'system';
+ $result['type'] = ($this->getType() === self::MOUNT_TYPE_PERSONAL) ? 'personal': 'system';
return $result;
}
diff --git a/apps/files_external/lib/Service/DBConfigService.php b/apps/files_external/lib/Service/DBConfigService.php
index ca1d3a6696c..0488ddad548 100644
--- a/apps/files_external/lib/Service/DBConfigService.php
+++ b/apps/files_external/lib/Service/DBConfigService.php
@@ -37,6 +37,8 @@ use OCP\Security\ICrypto;
*/
class DBConfigService {
public const MOUNT_TYPE_ADMIN = 1;
+ public const MOUNT_TYPE_PERSONAL = 2;
+ /** @deprecated use MOUNT_TYPE_PERSONAL (full uppercase) instead */
public const MOUNT_TYPE_PERSONAl = 2;
public const APPLICABLE_TYPE_GLOBAL = 1;
@@ -234,7 +236,7 @@ class DBConfigService {
public function getUserMountsFor($type, $value) {
$builder = $this->connection->getQueryBuilder();
$query = $this->getForQuery($builder, $type, $value);
- $query->andWhere($builder->expr()->eq('m.type', $builder->expr()->literal(self::MOUNT_TYPE_PERSONAl, IQueryBuilder::PARAM_INT)));
+ $query->andWhere($builder->expr()->eq('m.type', $builder->expr()->literal(self::MOUNT_TYPE_PERSONAL, IQueryBuilder::PARAM_INT)));
return $this->getMountsFromQuery($query);
}
diff --git a/apps/files_external/lib/Service/UserStoragesService.php b/apps/files_external/lib/Service/UserStoragesService.php
index 47a6e919853..70004e7cdcc 100644
--- a/apps/files_external/lib/Service/UserStoragesService.php
+++ b/apps/files_external/lib/Service/UserStoragesService.php
@@ -31,7 +31,6 @@ namespace OCA\Files_External\Service;
use OC\Files\Filesystem;
use OCA\Files_External\Lib\StorageConfig;
use OCA\Files_External\NotFoundException;
-
use OCP\EventDispatcher\IEventDispatcher;
use OCP\Files\Config\IUserMountCache;
use OCP\IUserSession;
@@ -103,7 +102,7 @@ class UserStoragesService extends StoragesService {
}
protected function getType() {
- return DBConfigService::MOUNT_TYPE_PERSONAl;
+ return DBConfigService::MOUNT_TYPE_PERSONAL;
}
/**
@@ -144,7 +143,7 @@ class UserStoragesService extends StoragesService {
}
protected function isApplicable(StorageConfig $config) {
- return ($config->getApplicableUsers() === [$this->getUser()->getUID()]) && $config->getType() === StorageConfig::MOUNT_TYPE_PERSONAl;
+ return ($config->getApplicableUsers() === [$this->getUser()->getUID()]) && $config->getType() === StorageConfig::MOUNT_TYPE_PERSONAL;
}
public function removeStorage($id) {
diff --git a/apps/files_external/tests/Auth/Password/GlobalAuth.php b/apps/files_external/tests/Auth/Password/GlobalAuth.php
index 611efd3a8eb..867e3329cb8 100644
--- a/apps/files_external/tests/Auth/Password/GlobalAuth.php
+++ b/apps/files_external/tests/Auth/Password/GlobalAuth.php
@@ -113,7 +113,7 @@ class GlobalAuthTest extends TestCase {
$this->credentialsManager->expects($this->never())
->method('retrieve');
- $storage = $this->getStorageConfig(StorageConfig::MOUNT_TYPE_PERSONAl);
+ $storage = $this->getStorageConfig(StorageConfig::MOUNT_TYPE_PERSONAL);
$this->instance->manipulateStorageConfig($storage);
$this->assertEquals([], $storage->getBackendOptions());
diff --git a/apps/files_external/tests/Service/DBConfigServiceTest.php b/apps/files_external/tests/Service/DBConfigServiceTest.php
index f5a93435a1d..2842bfd1b66 100644
--- a/apps/files_external/tests/Service/DBConfigServiceTest.php
+++ b/apps/files_external/tests/Service/DBConfigServiceTest.php
@@ -198,7 +198,7 @@ class DBConfigServiceTest extends TestCase {
public function testGetAdminMounts() {
$id1 = $this->addMount('/test', 'foo', 'bar', 100, DBConfigService::MOUNT_TYPE_ADMIN);
- $this->addMount('/test2', 'foo2', 'bar2', 100, DBConfigService::MOUNT_TYPE_PERSONAl);
+ $this->addMount('/test2', 'foo2', 'bar2', 100, DBConfigService::MOUNT_TYPE_PERSONAL);
$mounts = $this->dbConfig->getAdminMounts();
$this->assertCount(1, $mounts);
@@ -208,7 +208,7 @@ class DBConfigServiceTest extends TestCase {
public function testGetAdminMountsFor() {
$id1 = $this->addMount('/test', 'foo', 'bar', 100, DBConfigService::MOUNT_TYPE_ADMIN);
$this->addMount('/test2', 'foo2', 'bar2', 100, DBConfigService::MOUNT_TYPE_ADMIN);
- $id3 = $this->addMount('/test3', 'foo3', 'bar3', 100, DBConfigService::MOUNT_TYPE_PERSONAl);
+ $id3 = $this->addMount('/test3', 'foo3', 'bar3', 100, DBConfigService::MOUNT_TYPE_PERSONAL);
$this->dbConfig->addApplicable($id1, DBConfigService::APPLICABLE_TYPE_USER, 'test');
$this->dbConfig->addApplicable($id3, DBConfigService::APPLICABLE_TYPE_USER, 'test');
@@ -221,8 +221,8 @@ class DBConfigServiceTest extends TestCase {
public function testGetUserMountsFor() {
$id1 = $this->addMount('/test', 'foo', 'bar', 100, DBConfigService::MOUNT_TYPE_ADMIN);
- $this->addMount('/test2', 'foo2', 'bar2', 100, DBConfigService::MOUNT_TYPE_PERSONAl);
- $id3 = $this->addMount('/test3', 'foo3', 'bar3', 100, DBConfigService::MOUNT_TYPE_PERSONAl);
+ $this->addMount('/test2', 'foo2', 'bar2', 100, DBConfigService::MOUNT_TYPE_PERSONAL);
+ $id3 = $this->addMount('/test3', 'foo3', 'bar3', 100, DBConfigService::MOUNT_TYPE_PERSONAL);
$this->dbConfig->addApplicable($id1, DBConfigService::APPLICABLE_TYPE_USER, 'test');
$this->dbConfig->addApplicable($id3, DBConfigService::APPLICABLE_TYPE_USER, 'test');
@@ -285,7 +285,7 @@ class DBConfigServiceTest extends TestCase {
public function testGetAllMounts() {
$id1 = $this->addMount('/test', 'foo', 'bar', 100, DBConfigService::MOUNT_TYPE_ADMIN);
- $id2 = $this->addMount('/test2', 'foo2', 'bar2', 100, DBConfigService::MOUNT_TYPE_PERSONAl);
+ $id2 = $this->addMount('/test2', 'foo2', 'bar2', 100, DBConfigService::MOUNT_TYPE_PERSONAL);
$mounts = $this->dbConfig->getAllMounts();
$this->assertCount(2, $mounts);