@@ -30,20 +30,20 @@ |
||
30 | 30 | use OCP\IDBConnection; |
31 | 31 | |
32 | 32 | class TransferOwnershipMapper extends QBMapper { |
33 | - public function __construct(IDBConnection $db) { |
|
34 | - parent::__construct($db, 'user_transfer_owner', TransferOwnership::class); |
|
35 | - } |
|
33 | + public function __construct(IDBConnection $db) { |
|
34 | + parent::__construct($db, 'user_transfer_owner', TransferOwnership::class); |
|
35 | + } |
|
36 | 36 | |
37 | - public function getById(int $id): TransferOwnership { |
|
38 | - $qb = $this->db->getQueryBuilder(); |
|
37 | + public function getById(int $id): TransferOwnership { |
|
38 | + $qb = $this->db->getQueryBuilder(); |
|
39 | 39 | |
40 | - $qb->select('*') |
|
41 | - ->from($this->getTableName()) |
|
42 | - ->where( |
|
43 | - $qb->expr()->eq('id', $qb->createNamedParameter($id)) |
|
44 | - ); |
|
40 | + $qb->select('*') |
|
41 | + ->from($this->getTableName()) |
|
42 | + ->where( |
|
43 | + $qb->expr()->eq('id', $qb->createNamedParameter($id)) |
|
44 | + ); |
|
45 | 45 | |
46 | - return $this->findEntity($qb); |
|
47 | - } |
|
46 | + return $this->findEntity($qb); |
|
47 | + } |
|
48 | 48 | |
49 | 49 | } |
@@ -31,47 +31,47 @@ |
||
31 | 31 | |
32 | 32 | class Version11301Date20191205150729 extends SimpleMigrationStep { |
33 | 33 | |
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) { |
|
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) { |
|
41 | + /** @var ISchemaWrapper $schema */ |
|
42 | + $schema = $schemaClosure(); |
|
43 | 43 | |
44 | - $table = $schema->createTable('user_transfer_owner'); |
|
45 | - $table->addColumn('id', 'bigint', [ |
|
46 | - 'autoincrement' => true, |
|
47 | - 'notnull' => true, |
|
48 | - 'length' => 20, |
|
49 | - 'unsigned' => true, |
|
50 | - ]); |
|
51 | - $table->addColumn('source_user', 'string', [ |
|
52 | - 'notnull' => true, |
|
53 | - 'length' => 64, |
|
54 | - ]); |
|
55 | - $table->addColumn('target_user', 'string', [ |
|
56 | - 'notnull' => true, |
|
57 | - 'length' => 64, |
|
58 | - ]); |
|
59 | - $table->addColumn('file_id', 'bigint', [ |
|
60 | - 'notnull' => true, |
|
61 | - 'length' => 20, |
|
62 | - ]); |
|
63 | - $table->addColumn('node_name', 'string', [ |
|
64 | - 'notnull' => true, |
|
65 | - 'length' => 255, |
|
66 | - ]); |
|
67 | - $table->setPrimaryKey(['id']); |
|
44 | + $table = $schema->createTable('user_transfer_owner'); |
|
45 | + $table->addColumn('id', 'bigint', [ |
|
46 | + 'autoincrement' => true, |
|
47 | + 'notnull' => true, |
|
48 | + 'length' => 20, |
|
49 | + 'unsigned' => true, |
|
50 | + ]); |
|
51 | + $table->addColumn('source_user', 'string', [ |
|
52 | + 'notnull' => true, |
|
53 | + 'length' => 64, |
|
54 | + ]); |
|
55 | + $table->addColumn('target_user', 'string', [ |
|
56 | + 'notnull' => true, |
|
57 | + 'length' => 64, |
|
58 | + ]); |
|
59 | + $table->addColumn('file_id', 'bigint', [ |
|
60 | + 'notnull' => true, |
|
61 | + 'length' => 20, |
|
62 | + ]); |
|
63 | + $table->addColumn('node_name', 'string', [ |
|
64 | + 'notnull' => true, |
|
65 | + 'length' => 255, |
|
66 | + ]); |
|
67 | + $table->setPrimaryKey(['id']); |
|
68 | 68 | |
69 | - // Quite radical, we just assume no one updates cross beta with a pending request. |
|
70 | - // Do not try this at home |
|
71 | - if ($schema->hasTable('user_transfer_ownership')) { |
|
72 | - $schema->dropTable('user_transfer_ownership'); |
|
73 | - } |
|
69 | + // Quite radical, we just assume no one updates cross beta with a pending request. |
|
70 | + // Do not try this at home |
|
71 | + if ($schema->hasTable('user_transfer_ownership')) { |
|
72 | + $schema->dropTable('user_transfer_ownership'); |
|
73 | + } |
|
74 | 74 | |
75 | - return $schema; |
|
76 | - } |
|
75 | + return $schema; |
|
76 | + } |
|
77 | 77 | } |
@@ -27,5 +27,5 @@ |
||
27 | 27 | * @deprecated 18.0.0 use \OCP\EventDispatcher\IEventDispatcher |
28 | 28 | */ |
29 | 29 | abstract class BasicEmitter implements Emitter { |
30 | - use EmitterTrait; |
|
30 | + use EmitterTrait; |
|
31 | 31 | } |
@@ -36,12 +36,12 @@ |
||
36 | 36 | * @since 18.0.0 |
37 | 37 | */ |
38 | 38 | interface IFileCheck extends IEntityCheck { |
39 | - /** |
|
40 | - * @param IStorage $storage |
|
41 | - * @param string $path |
|
42 | - * @param bool $isDir |
|
43 | - * @since 18.0.0 |
|
44 | - */ |
|
45 | - public function setFileInfo(IStorage $storage, string $path, bool $isDir = false): void; |
|
39 | + /** |
|
40 | + * @param IStorage $storage |
|
41 | + * @param string $path |
|
42 | + * @param bool $isDir |
|
43 | + * @since 18.0.0 |
|
44 | + */ |
|
45 | + public function setFileInfo(IStorage $storage, string $path, bool $isDir = false): void; |
|
46 | 46 | |
47 | 47 | } |
@@ -31,40 +31,40 @@ |
||
31 | 31 | use OCP\WorkflowEngine\IEntity; |
32 | 32 | |
33 | 33 | trait TFileCheck { |
34 | - /** @var IStorage */ |
|
35 | - protected $storage; |
|
34 | + /** @var IStorage */ |
|
35 | + protected $storage; |
|
36 | 36 | |
37 | - /** @var string */ |
|
38 | - protected $path; |
|
37 | + /** @var string */ |
|
38 | + protected $path; |
|
39 | 39 | |
40 | - /** @var bool */ |
|
41 | - protected $isDir; |
|
40 | + /** @var bool */ |
|
41 | + protected $isDir; |
|
42 | 42 | |
43 | - /** |
|
44 | - * @param IStorage $storage |
|
45 | - * @param string $path |
|
46 | - * @param bool $isDir |
|
47 | - * @since 18.0.0 |
|
48 | - */ |
|
49 | - public function setFileInfo(IStorage $storage, string $path, bool $isDir = false): void { |
|
50 | - $this->storage = $storage; |
|
51 | - $this->path = $path; |
|
52 | - $this->isDir = $isDir; |
|
53 | - } |
|
43 | + /** |
|
44 | + * @param IStorage $storage |
|
45 | + * @param string $path |
|
46 | + * @param bool $isDir |
|
47 | + * @since 18.0.0 |
|
48 | + */ |
|
49 | + public function setFileInfo(IStorage $storage, string $path, bool $isDir = false): void { |
|
50 | + $this->storage = $storage; |
|
51 | + $this->path = $path; |
|
52 | + $this->isDir = $isDir; |
|
53 | + } |
|
54 | 54 | |
55 | - /** |
|
56 | - * @throws \OCP\Files\NotFoundException |
|
57 | - */ |
|
58 | - public function setEntitySubject(IEntity $entity, $subject): void { |
|
59 | - if ($entity instanceof File) { |
|
60 | - if (!$subject instanceof Node) { |
|
61 | - throw new \UnexpectedValueException( |
|
62 | - 'Expected Node subject for File entity, got {class}', |
|
63 | - ['app' => Application::APP_ID, 'class' => get_class($subject)] |
|
64 | - ); |
|
65 | - } |
|
66 | - $this->storage = $subject->getStorage(); |
|
67 | - $this->path = $subject->getPath(); |
|
68 | - } |
|
69 | - } |
|
55 | + /** |
|
56 | + * @throws \OCP\Files\NotFoundException |
|
57 | + */ |
|
58 | + public function setEntitySubject(IEntity $entity, $subject): void { |
|
59 | + if ($entity instanceof File) { |
|
60 | + if (!$subject instanceof Node) { |
|
61 | + throw new \UnexpectedValueException( |
|
62 | + 'Expected Node subject for File entity, got {class}', |
|
63 | + ['app' => Application::APP_ID, 'class' => get_class($subject)] |
|
64 | + ); |
|
65 | + } |
|
66 | + $this->storage = $subject->getStorage(); |
|
67 | + $this->path = $subject->getPath(); |
|
68 | + } |
|
69 | + } |
|
70 | 70 | } |
@@ -37,47 +37,47 @@ |
||
37 | 37 | |
38 | 38 | class AcceptController extends Controller { |
39 | 39 | |
40 | - /** @var ShareManager */ |
|
41 | - private $shareManager; |
|
40 | + /** @var ShareManager */ |
|
41 | + private $shareManager; |
|
42 | 42 | |
43 | - /** @var IUserSession */ |
|
44 | - private $userSession; |
|
43 | + /** @var IUserSession */ |
|
44 | + private $userSession; |
|
45 | 45 | |
46 | - /** @var IURLGenerator */ |
|
47 | - private $urlGenerator; |
|
46 | + /** @var IURLGenerator */ |
|
47 | + private $urlGenerator; |
|
48 | 48 | |
49 | - public function __construct(IRequest $request, ShareManager $shareManager, IUserSession $userSession, IURLGenerator $urlGenerator) { |
|
50 | - parent::__construct(Application::APP_ID, $request); |
|
49 | + public function __construct(IRequest $request, ShareManager $shareManager, IUserSession $userSession, IURLGenerator $urlGenerator) { |
|
50 | + parent::__construct(Application::APP_ID, $request); |
|
51 | 51 | |
52 | - $this->shareManager = $shareManager; |
|
53 | - $this->userSession = $userSession; |
|
54 | - $this->urlGenerator = $urlGenerator; |
|
55 | - } |
|
52 | + $this->shareManager = $shareManager; |
|
53 | + $this->userSession = $userSession; |
|
54 | + $this->urlGenerator = $urlGenerator; |
|
55 | + } |
|
56 | 56 | |
57 | - /** |
|
58 | - * @NoAdminRequired |
|
59 | - * @NoCSRFRequired |
|
60 | - */ |
|
61 | - public function accept(string $shareId): Response { |
|
62 | - try { |
|
63 | - $share = $this->shareManager->getShareById($shareId); |
|
64 | - } catch (ShareNotFound $e) { |
|
65 | - return new NotFoundResponse(); |
|
66 | - } |
|
57 | + /** |
|
58 | + * @NoAdminRequired |
|
59 | + * @NoCSRFRequired |
|
60 | + */ |
|
61 | + public function accept(string $shareId): Response { |
|
62 | + try { |
|
63 | + $share = $this->shareManager->getShareById($shareId); |
|
64 | + } catch (ShareNotFound $e) { |
|
65 | + return new NotFoundResponse(); |
|
66 | + } |
|
67 | 67 | |
68 | - $user = $this->userSession->getUser(); |
|
69 | - if ($user === null) { |
|
70 | - return new NotFoundResponse(); |
|
71 | - } |
|
68 | + $user = $this->userSession->getUser(); |
|
69 | + if ($user === null) { |
|
70 | + return new NotFoundResponse(); |
|
71 | + } |
|
72 | 72 | |
73 | - try { |
|
74 | - $share = $this->shareManager->acceptShare($share, $user->getUID()); |
|
75 | - } catch (\Exception $e) { |
|
76 | - // Just ignore |
|
77 | - } |
|
73 | + try { |
|
74 | + $share = $this->shareManager->acceptShare($share, $user->getUID()); |
|
75 | + } catch (\Exception $e) { |
|
76 | + // Just ignore |
|
77 | + } |
|
78 | 78 | |
79 | - $url = $this->urlGenerator->linkToRouteAbsolute('files.viewcontroller.showFile', ['fileid' => $share->getNode()->getId()]); |
|
79 | + $url = $this->urlGenerator->linkToRouteAbsolute('files.viewcontroller.showFile', ['fileid' => $share->getNode()->getId()]); |
|
80 | 80 | |
81 | - return new RedirectResponse($url); |
|
82 | - } |
|
81 | + return new RedirectResponse($url); |
|
82 | + } |
|
83 | 83 | } |
@@ -30,30 +30,30 @@ |
||
30 | 30 | |
31 | 31 | class Groupware implements IIconSection { |
32 | 32 | |
33 | - /** @var IL10N */ |
|
34 | - private $l; |
|
33 | + /** @var IL10N */ |
|
34 | + private $l; |
|
35 | 35 | |
36 | - /** @var IURLGenerator */ |
|
37 | - private $urlGenerator; |
|
36 | + /** @var IURLGenerator */ |
|
37 | + private $urlGenerator; |
|
38 | 38 | |
39 | - public function __construct(IL10N $l, IURLGenerator $urlGenerator) { |
|
40 | - $this->l = $l; |
|
41 | - $this->urlGenerator = $urlGenerator; |
|
42 | - } |
|
39 | + public function __construct(IL10N $l, IURLGenerator $urlGenerator) { |
|
40 | + $this->l = $l; |
|
41 | + $this->urlGenerator = $urlGenerator; |
|
42 | + } |
|
43 | 43 | |
44 | - public function getIcon(): string { |
|
45 | - return $this->urlGenerator->imagePath('core', 'places/contacts.svg'); |
|
46 | - } |
|
44 | + public function getIcon(): string { |
|
45 | + return $this->urlGenerator->imagePath('core', 'places/contacts.svg'); |
|
46 | + } |
|
47 | 47 | |
48 | - public function getID(): string { |
|
49 | - return 'groupware'; |
|
50 | - } |
|
48 | + public function getID(): string { |
|
49 | + return 'groupware'; |
|
50 | + } |
|
51 | 51 | |
52 | - public function getName(): string { |
|
53 | - return $this->l->t('Groupware'); |
|
54 | - } |
|
52 | + public function getName(): string { |
|
53 | + return $this->l->t('Groupware'); |
|
54 | + } |
|
55 | 55 | |
56 | - public function getPriority(): int { |
|
57 | - return 50; |
|
58 | - } |
|
56 | + public function getPriority(): int { |
|
57 | + return 50; |
|
58 | + } |
|
59 | 59 | } |
@@ -30,30 +30,30 @@ |
||
30 | 30 | |
31 | 31 | class Additional implements IIconSection { |
32 | 32 | |
33 | - /** @var IL10N */ |
|
34 | - private $l; |
|
33 | + /** @var IL10N */ |
|
34 | + private $l; |
|
35 | 35 | |
36 | - /** @var IURLGenerator */ |
|
37 | - private $urlGenerator; |
|
36 | + /** @var IURLGenerator */ |
|
37 | + private $urlGenerator; |
|
38 | 38 | |
39 | - public function __construct(IL10N $l, IURLGenerator $urlGenerator) { |
|
40 | - $this->l = $l; |
|
41 | - $this->urlGenerator = $urlGenerator; |
|
42 | - } |
|
39 | + public function __construct(IL10N $l, IURLGenerator $urlGenerator) { |
|
40 | + $this->l = $l; |
|
41 | + $this->urlGenerator = $urlGenerator; |
|
42 | + } |
|
43 | 43 | |
44 | - public function getIcon(): string { |
|
45 | - return $this->urlGenerator->imagePath('core', 'actions/settings-dark.svg'); |
|
46 | - } |
|
44 | + public function getIcon(): string { |
|
45 | + return $this->urlGenerator->imagePath('core', 'actions/settings-dark.svg'); |
|
46 | + } |
|
47 | 47 | |
48 | - public function getID(): string { |
|
49 | - return 'additional'; |
|
50 | - } |
|
48 | + public function getID(): string { |
|
49 | + return 'additional'; |
|
50 | + } |
|
51 | 51 | |
52 | - public function getName(): string { |
|
53 | - return $this->l->t('Additional settings'); |
|
54 | - } |
|
52 | + public function getName(): string { |
|
53 | + return $this->l->t('Additional settings'); |
|
54 | + } |
|
55 | 55 | |
56 | - public function getPriority(): int { |
|
57 | - return 98; |
|
58 | - } |
|
56 | + public function getPriority(): int { |
|
57 | + return 98; |
|
58 | + } |
|
59 | 59 | } |
@@ -30,30 +30,30 @@ |
||
30 | 30 | |
31 | 31 | class Sharing implements IIconSection { |
32 | 32 | |
33 | - /** @var IL10N */ |
|
34 | - private $l; |
|
33 | + /** @var IL10N */ |
|
34 | + private $l; |
|
35 | 35 | |
36 | - /** @var IURLGenerator */ |
|
37 | - private $urlGenerator; |
|
36 | + /** @var IURLGenerator */ |
|
37 | + private $urlGenerator; |
|
38 | 38 | |
39 | - public function __construct(IL10N $l, IURLGenerator $urlGenerator) { |
|
40 | - $this->l = $l; |
|
41 | - $this->urlGenerator = $urlGenerator; |
|
42 | - } |
|
39 | + public function __construct(IL10N $l, IURLGenerator $urlGenerator) { |
|
40 | + $this->l = $l; |
|
41 | + $this->urlGenerator = $urlGenerator; |
|
42 | + } |
|
43 | 43 | |
44 | - public function getIcon(): string { |
|
45 | - return $this->urlGenerator->imagePath('core', 'actions/share.svg'); |
|
46 | - } |
|
44 | + public function getIcon(): string { |
|
45 | + return $this->urlGenerator->imagePath('core', 'actions/share.svg'); |
|
46 | + } |
|
47 | 47 | |
48 | - public function getID(): string { |
|
49 | - return 'sharing'; |
|
50 | - } |
|
48 | + public function getID(): string { |
|
49 | + return 'sharing'; |
|
50 | + } |
|
51 | 51 | |
52 | - public function getName(): string { |
|
53 | - return $this->l->t('Sharing'); |
|
54 | - } |
|
52 | + public function getName(): string { |
|
53 | + return $this->l->t('Sharing'); |
|
54 | + } |
|
55 | 55 | |
56 | - public function getPriority(): int { |
|
57 | - return 5; |
|
58 | - } |
|
56 | + public function getPriority(): int { |
|
57 | + return 5; |
|
58 | + } |
|
59 | 59 | } |