@@ -29,15 +29,15 @@ |
||
29 | 29 | namespace OCA\AdminAudit\Actions; |
30 | 30 | |
31 | 31 | class Trashbin extends Action { |
32 | - public function delete(array $params): void { |
|
33 | - $this->log('File "%s" deleted from trash bin.', |
|
34 | - ['path' => $params['path']], ['path'] |
|
35 | - ); |
|
36 | - } |
|
32 | + public function delete(array $params): void { |
|
33 | + $this->log('File "%s" deleted from trash bin.', |
|
34 | + ['path' => $params['path']], ['path'] |
|
35 | + ); |
|
36 | + } |
|
37 | 37 | |
38 | - public function restore(array $params): void { |
|
39 | - $this->log('File "%s" restored from trash bin.', |
|
40 | - ['path' => $params['filePath']], ['path'] |
|
41 | - ); |
|
42 | - } |
|
38 | + public function restore(array $params): void { |
|
39 | + $this->log('File "%s" restored from trash bin.', |
|
40 | + ['path' => $params['filePath']], ['path'] |
|
41 | + ); |
|
42 | + } |
|
43 | 43 | } |
@@ -29,22 +29,22 @@ |
||
29 | 29 | * @since 22.0.0 |
30 | 30 | */ |
31 | 31 | class AlreadySharedException extends GenericShareException { |
32 | - /** @var IShare */ |
|
33 | - private $existingShare; |
|
32 | + /** @var IShare */ |
|
33 | + private $existingShare; |
|
34 | 34 | |
35 | - /** |
|
36 | - * @since 22.0.0 |
|
37 | - */ |
|
38 | - public function __construct(string $message, IShare $existingShare) { |
|
39 | - parent::__construct($message); |
|
35 | + /** |
|
36 | + * @since 22.0.0 |
|
37 | + */ |
|
38 | + public function __construct(string $message, IShare $existingShare) { |
|
39 | + parent::__construct($message); |
|
40 | 40 | |
41 | - $this->existingShare = $existingShare; |
|
42 | - } |
|
41 | + $this->existingShare = $existingShare; |
|
42 | + } |
|
43 | 43 | |
44 | - /** |
|
45 | - * @since 22.0.0 |
|
46 | - */ |
|
47 | - public function getExistingShare(): IShare { |
|
48 | - return $this->existingShare; |
|
49 | - } |
|
44 | + /** |
|
45 | + * @since 22.0.0 |
|
46 | + */ |
|
47 | + public function getExistingShare(): IShare { |
|
48 | + return $this->existingShare; |
|
49 | + } |
|
50 | 50 | } |
@@ -30,31 +30,31 @@ |
||
30 | 30 | * Fallback implementation for moveFromCache |
31 | 31 | */ |
32 | 32 | trait MoveFromCacheTrait { |
33 | - /** |
|
34 | - * store meta data for a file or folder |
|
35 | - * |
|
36 | - * @param string $file |
|
37 | - * @param array $data |
|
38 | - * |
|
39 | - * @return int file id |
|
40 | - * @throws \RuntimeException |
|
41 | - */ |
|
42 | - abstract public function put($file, array $data); |
|
33 | + /** |
|
34 | + * store meta data for a file or folder |
|
35 | + * |
|
36 | + * @param string $file |
|
37 | + * @param array $data |
|
38 | + * |
|
39 | + * @return int file id |
|
40 | + * @throws \RuntimeException |
|
41 | + */ |
|
42 | + abstract public function put($file, array $data); |
|
43 | 43 | |
44 | - abstract public function copyFromCache(ICache $sourceCache, ICacheEntry $sourceEntry, string $targetPath): int; |
|
44 | + abstract public function copyFromCache(ICache $sourceCache, ICacheEntry $sourceEntry, string $targetPath): int; |
|
45 | 45 | |
46 | - /** |
|
47 | - * Move a file or folder in the cache |
|
48 | - * |
|
49 | - * @param \OCP\Files\Cache\ICache $sourceCache |
|
50 | - * @param string $sourcePath |
|
51 | - * @param string $targetPath |
|
52 | - */ |
|
53 | - public function moveFromCache(ICache $sourceCache, $sourcePath, $targetPath) { |
|
54 | - $sourceEntry = $sourceCache->get($sourcePath); |
|
46 | + /** |
|
47 | + * Move a file or folder in the cache |
|
48 | + * |
|
49 | + * @param \OCP\Files\Cache\ICache $sourceCache |
|
50 | + * @param string $sourcePath |
|
51 | + * @param string $targetPath |
|
52 | + */ |
|
53 | + public function moveFromCache(ICache $sourceCache, $sourcePath, $targetPath) { |
|
54 | + $sourceEntry = $sourceCache->get($sourcePath); |
|
55 | 55 | |
56 | - $this->copyFromCache($sourceCache, $sourceEntry, $targetPath); |
|
56 | + $this->copyFromCache($sourceCache, $sourceEntry, $targetPath); |
|
57 | 57 | |
58 | - $sourceCache->remove($sourcePath); |
|
59 | - } |
|
58 | + $sourceCache->remove($sourcePath); |
|
59 | + } |
|
60 | 60 | } |
@@ -31,22 +31,22 @@ |
||
31 | 31 | use OCP\Migration\SimpleMigrationStep; |
32 | 32 | |
33 | 33 | class Version21000Date20210309185127 extends SimpleMigrationStep { |
34 | - /** |
|
35 | - * @param IOutput $output |
|
36 | - * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
37 | - * @param array $options |
|
38 | - * @return null|ISchemaWrapper |
|
39 | - */ |
|
40 | - public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper { |
|
41 | - /** @var ISchemaWrapper $schema */ |
|
42 | - $schema = $schemaClosure(); |
|
34 | + /** |
|
35 | + * @param IOutput $output |
|
36 | + * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
37 | + * @param array $options |
|
38 | + * @return null|ISchemaWrapper |
|
39 | + */ |
|
40 | + public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper { |
|
41 | + /** @var ISchemaWrapper $schema */ |
|
42 | + $schema = $schemaClosure(); |
|
43 | 43 | |
44 | - $table = $schema->getTable('known_users'); |
|
45 | - if (!$table->hasIndex('ku_known_user')) { |
|
46 | - $table->addIndex(['known_user'], 'ku_known_user'); |
|
47 | - return $schema; |
|
48 | - } |
|
44 | + $table = $schema->getTable('known_users'); |
|
45 | + if (!$table->hasIndex('ku_known_user')) { |
|
46 | + $table->addIndex(['known_user'], 'ku_known_user'); |
|
47 | + return $schema; |
|
48 | + } |
|
49 | 49 | |
50 | - return null; |
|
51 | - } |
|
50 | + return null; |
|
51 | + } |
|
52 | 52 | } |
@@ -29,49 +29,49 @@ |
||
29 | 29 | * @since 12.0.0 |
30 | 30 | */ |
31 | 31 | interface ISearchQuery { |
32 | - /** |
|
33 | - * @return ISearchOperator |
|
34 | - * @since 12.0.0 |
|
35 | - */ |
|
36 | - public function getSearchOperation(); |
|
32 | + /** |
|
33 | + * @return ISearchOperator |
|
34 | + * @since 12.0.0 |
|
35 | + */ |
|
36 | + public function getSearchOperation(); |
|
37 | 37 | |
38 | - /** |
|
39 | - * Get the maximum number of results to return |
|
40 | - * |
|
41 | - * @return integer |
|
42 | - * @since 12.0.0 |
|
43 | - */ |
|
44 | - public function getLimit(); |
|
38 | + /** |
|
39 | + * Get the maximum number of results to return |
|
40 | + * |
|
41 | + * @return integer |
|
42 | + * @since 12.0.0 |
|
43 | + */ |
|
44 | + public function getLimit(); |
|
45 | 45 | |
46 | - /** |
|
47 | - * Get the offset for returned results |
|
48 | - * |
|
49 | - * @return integer |
|
50 | - * @since 12.0.0 |
|
51 | - */ |
|
52 | - public function getOffset(); |
|
46 | + /** |
|
47 | + * Get the offset for returned results |
|
48 | + * |
|
49 | + * @return integer |
|
50 | + * @since 12.0.0 |
|
51 | + */ |
|
52 | + public function getOffset(); |
|
53 | 53 | |
54 | - /** |
|
55 | - * The fields and directions to order by |
|
56 | - * |
|
57 | - * @return ISearchOrder[] |
|
58 | - * @since 12.0.0 |
|
59 | - */ |
|
60 | - public function getOrder(); |
|
54 | + /** |
|
55 | + * The fields and directions to order by |
|
56 | + * |
|
57 | + * @return ISearchOrder[] |
|
58 | + * @since 12.0.0 |
|
59 | + */ |
|
60 | + public function getOrder(); |
|
61 | 61 | |
62 | - /** |
|
63 | - * The user that issued the search |
|
64 | - * |
|
65 | - * @return ?IUser |
|
66 | - * @since 12.0.0 |
|
67 | - */ |
|
68 | - public function getUser(); |
|
62 | + /** |
|
63 | + * The user that issued the search |
|
64 | + * |
|
65 | + * @return ?IUser |
|
66 | + * @since 12.0.0 |
|
67 | + */ |
|
68 | + public function getUser(); |
|
69 | 69 | |
70 | - /** |
|
71 | - * Whether or not the search should be limited to the users home storage |
|
72 | - * |
|
73 | - * @return bool |
|
74 | - * @since 18.0.0 |
|
75 | - */ |
|
76 | - public function limitToHome(): bool; |
|
70 | + /** |
|
71 | + * Whether or not the search should be limited to the users home storage |
|
72 | + * |
|
73 | + * @return bool |
|
74 | + * @since 18.0.0 |
|
75 | + */ |
|
76 | + public function limitToHome(): bool; |
|
77 | 77 | } |
@@ -54,48 +54,48 @@ |
||
54 | 54 | use Psr\Container\ContainerInterface; |
55 | 55 | |
56 | 56 | class Application extends App implements IBootstrap { |
57 | - public function __construct(array $urlParams = []) { |
|
58 | - parent::__construct('provisioning_api', $urlParams); |
|
59 | - } |
|
57 | + public function __construct(array $urlParams = []) { |
|
58 | + parent::__construct('provisioning_api', $urlParams); |
|
59 | + } |
|
60 | 60 | |
61 | - public function register(IRegistrationContext $context): void { |
|
62 | - $context->registerEventListener(UserDeletedEvent::class, UserDeletedListener::class); |
|
61 | + public function register(IRegistrationContext $context): void { |
|
62 | + $context->registerEventListener(UserDeletedEvent::class, UserDeletedListener::class); |
|
63 | 63 | |
64 | - $context->registerService(NewUserMailHelper::class, function (ContainerInterface $c) { |
|
65 | - return new NewUserMailHelper( |
|
66 | - $c->get(Defaults::class), |
|
67 | - $c->get(IURLGenerator::class), |
|
68 | - $c->get(IFactory::class), |
|
69 | - $c->get(IMailer::class), |
|
70 | - $c->get(ISecureRandom::class), |
|
71 | - $c->get(ITimeFactory::class), |
|
72 | - $c->get(IConfig::class), |
|
73 | - $c->get(ICrypto::class), |
|
74 | - Util::getDefaultEmailAddress('no-reply') |
|
75 | - ); |
|
76 | - }); |
|
77 | - $context->registerService(ProvisioningApiMiddleware::class, function (ContainerInterface $c) { |
|
78 | - $user = $c->get(IUserManager::class)->get($c->get('UserId')); |
|
79 | - $isAdmin = false; |
|
80 | - $isSubAdmin = false; |
|
64 | + $context->registerService(NewUserMailHelper::class, function (ContainerInterface $c) { |
|
65 | + return new NewUserMailHelper( |
|
66 | + $c->get(Defaults::class), |
|
67 | + $c->get(IURLGenerator::class), |
|
68 | + $c->get(IFactory::class), |
|
69 | + $c->get(IMailer::class), |
|
70 | + $c->get(ISecureRandom::class), |
|
71 | + $c->get(ITimeFactory::class), |
|
72 | + $c->get(IConfig::class), |
|
73 | + $c->get(ICrypto::class), |
|
74 | + Util::getDefaultEmailAddress('no-reply') |
|
75 | + ); |
|
76 | + }); |
|
77 | + $context->registerService(ProvisioningApiMiddleware::class, function (ContainerInterface $c) { |
|
78 | + $user = $c->get(IUserManager::class)->get($c->get('UserId')); |
|
79 | + $isAdmin = false; |
|
80 | + $isSubAdmin = false; |
|
81 | 81 | |
82 | - if ($user instanceof IUser) { |
|
83 | - $groupManager = $c->get(IGroupManager::class); |
|
84 | - assert($groupManager instanceof GroupManager); |
|
85 | - $isAdmin = $groupManager->isAdmin($user->getUID()); |
|
86 | - $isSubAdmin = $groupManager->getSubAdmin()->isSubAdmin($user); |
|
87 | - } |
|
82 | + if ($user instanceof IUser) { |
|
83 | + $groupManager = $c->get(IGroupManager::class); |
|
84 | + assert($groupManager instanceof GroupManager); |
|
85 | + $isAdmin = $groupManager->isAdmin($user->getUID()); |
|
86 | + $isSubAdmin = $groupManager->getSubAdmin()->isSubAdmin($user); |
|
87 | + } |
|
88 | 88 | |
89 | - return new ProvisioningApiMiddleware( |
|
90 | - $c->get(IControllerMethodReflector::class), |
|
91 | - $isAdmin, |
|
92 | - $isSubAdmin |
|
93 | - ); |
|
94 | - }); |
|
95 | - $context->registerMiddleware(ProvisioningApiMiddleware::class); |
|
96 | - $context->registerCapability(Capabilities::class); |
|
97 | - } |
|
89 | + return new ProvisioningApiMiddleware( |
|
90 | + $c->get(IControllerMethodReflector::class), |
|
91 | + $isAdmin, |
|
92 | + $isSubAdmin |
|
93 | + ); |
|
94 | + }); |
|
95 | + $context->registerMiddleware(ProvisioningApiMiddleware::class); |
|
96 | + $context->registerCapability(Capabilities::class); |
|
97 | + } |
|
98 | 98 | |
99 | - public function boot(IBootContext $context): void { |
|
100 | - } |
|
99 | + public function boot(IBootContext $context): void { |
|
100 | + } |
|
101 | 101 | } |
@@ -36,27 +36,27 @@ |
||
36 | 36 | |
37 | 37 | class Version1002Date20170919123342 extends SimpleMigrationStep { |
38 | 38 | |
39 | - /** |
|
40 | - * @param IOutput $output |
|
41 | - * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
42 | - * @param array $options |
|
43 | - * @return null|ISchemaWrapper |
|
44 | - * @since 13.0.0 |
|
45 | - */ |
|
46 | - public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) { |
|
47 | - /** @var ISchemaWrapper $schema */ |
|
48 | - $schema = $schemaClosure(); |
|
49 | - |
|
50 | - $table = $schema->getTable('twofactor_backupcodes'); |
|
51 | - $column = $table->getColumn('user_id'); |
|
52 | - $column->setDefault(''); |
|
53 | - |
|
54 | - $column = $table->getColumn('used'); |
|
55 | - if ($column->getType()->getName() !== Types::SMALLINT) { |
|
56 | - $column->setType(Type::getType(Types::SMALLINT)); |
|
57 | - $column->setOptions(['length' => 6]); |
|
58 | - } |
|
59 | - |
|
60 | - return $schema; |
|
61 | - } |
|
39 | + /** |
|
40 | + * @param IOutput $output |
|
41 | + * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
42 | + * @param array $options |
|
43 | + * @return null|ISchemaWrapper |
|
44 | + * @since 13.0.0 |
|
45 | + */ |
|
46 | + public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) { |
|
47 | + /** @var ISchemaWrapper $schema */ |
|
48 | + $schema = $schemaClosure(); |
|
49 | + |
|
50 | + $table = $schema->getTable('twofactor_backupcodes'); |
|
51 | + $column = $table->getColumn('user_id'); |
|
52 | + $column->setDefault(''); |
|
53 | + |
|
54 | + $column = $table->getColumn('used'); |
|
55 | + if ($column->getType()->getName() !== Types::SMALLINT) { |
|
56 | + $column->setType(Type::getType(Types::SMALLINT)); |
|
57 | + $column->setOptions(['length' => 6]); |
|
58 | + } |
|
59 | + |
|
60 | + return $schema; |
|
61 | + } |
|
62 | 62 | } |
@@ -16,10 +16,10 @@ |
||
16 | 16 | <?php if ((int)$trustedServer['status'] === TrustedServers::STATUS_OK) { ?> |
17 | 17 | <span class="status success"></span> |
18 | 18 | <?php |
19 | - } elseif ( |
|
20 | - (int)$trustedServer['status'] === TrustedServers::STATUS_PENDING || |
|
21 | - (int)$trustedServer['status'] === TrustedServers::STATUS_ACCESS_REVOKED |
|
22 | - ) { ?> |
|
19 | + } elseif ( |
|
20 | + (int)$trustedServer['status'] === TrustedServers::STATUS_PENDING || |
|
21 | + (int)$trustedServer['status'] === TrustedServers::STATUS_ACCESS_REVOKED |
|
22 | + ) { ?> |
|
23 | 23 | <span class="status indeterminate"></span> |
24 | 24 | <?php } else {?> |
25 | 25 | <span class="status error"></span> |
@@ -32,51 +32,51 @@ |
||
32 | 32 | * @since 8.0.0 |
33 | 33 | */ |
34 | 34 | interface ICertificate { |
35 | - /** |
|
36 | - * @return string |
|
37 | - * @since 8.0.0 |
|
38 | - */ |
|
39 | - public function getName(): string; |
|
35 | + /** |
|
36 | + * @return string |
|
37 | + * @since 8.0.0 |
|
38 | + */ |
|
39 | + public function getName(): string; |
|
40 | 40 | |
41 | - /** |
|
42 | - * @return string|null |
|
43 | - * @since 8.0.0 |
|
44 | - */ |
|
45 | - public function getCommonName(): ?string; |
|
41 | + /** |
|
42 | + * @return string|null |
|
43 | + * @since 8.0.0 |
|
44 | + */ |
|
45 | + public function getCommonName(): ?string; |
|
46 | 46 | |
47 | - /** |
|
48 | - * @return string|null |
|
49 | - * @since 8.0.0 |
|
50 | - */ |
|
51 | - public function getOrganization(): ?string; |
|
47 | + /** |
|
48 | + * @return string|null |
|
49 | + * @since 8.0.0 |
|
50 | + */ |
|
51 | + public function getOrganization(): ?string; |
|
52 | 52 | |
53 | - /** |
|
54 | - * @return \DateTime |
|
55 | - * @since 8.0.0 |
|
56 | - */ |
|
57 | - public function getIssueDate(): \DateTime; |
|
53 | + /** |
|
54 | + * @return \DateTime |
|
55 | + * @since 8.0.0 |
|
56 | + */ |
|
57 | + public function getIssueDate(): \DateTime; |
|
58 | 58 | |
59 | - /** |
|
60 | - * @return \DateTime |
|
61 | - * @since 8.0.0 |
|
62 | - */ |
|
63 | - public function getExpireDate(): \DateTime; |
|
59 | + /** |
|
60 | + * @return \DateTime |
|
61 | + * @since 8.0.0 |
|
62 | + */ |
|
63 | + public function getExpireDate(): \DateTime; |
|
64 | 64 | |
65 | - /** |
|
66 | - * @return bool |
|
67 | - * @since 8.0.0 |
|
68 | - */ |
|
69 | - public function isExpired(): bool; |
|
65 | + /** |
|
66 | + * @return bool |
|
67 | + * @since 8.0.0 |
|
68 | + */ |
|
69 | + public function isExpired(): bool; |
|
70 | 70 | |
71 | - /** |
|
72 | - * @return string|null |
|
73 | - * @since 8.0.0 |
|
74 | - */ |
|
75 | - public function getIssuerName(): ?string; |
|
71 | + /** |
|
72 | + * @return string|null |
|
73 | + * @since 8.0.0 |
|
74 | + */ |
|
75 | + public function getIssuerName(): ?string; |
|
76 | 76 | |
77 | - /** |
|
78 | - * @return string|null |
|
79 | - * @since 8.0.0 |
|
80 | - */ |
|
81 | - public function getIssuerOrganization(): ?string; |
|
77 | + /** |
|
78 | + * @return string|null |
|
79 | + * @since 8.0.0 |
|
80 | + */ |
|
81 | + public function getIssuerOrganization(): ?string; |
|
82 | 82 | } |