@@ -33,74 +33,74 @@ |
||
33 | 33 | |
34 | 34 | class VersionRoot implements ICollection { |
35 | 35 | |
36 | - /** @var IUser */ |
|
37 | - private $user; |
|
36 | + /** @var IUser */ |
|
37 | + private $user; |
|
38 | 38 | |
39 | - /** @var IRootFolder */ |
|
40 | - private $rootFolder; |
|
39 | + /** @var IRootFolder */ |
|
40 | + private $rootFolder; |
|
41 | 41 | |
42 | - /** @var IVersionManager */ |
|
43 | - private $versionManager; |
|
42 | + /** @var IVersionManager */ |
|
43 | + private $versionManager; |
|
44 | 44 | |
45 | - public function __construct(IUser $user, IRootFolder $rootFolder, IVersionManager $versionManager) { |
|
46 | - $this->user = $user; |
|
47 | - $this->rootFolder = $rootFolder; |
|
48 | - $this->versionManager = $versionManager; |
|
49 | - } |
|
45 | + public function __construct(IUser $user, IRootFolder $rootFolder, IVersionManager $versionManager) { |
|
46 | + $this->user = $user; |
|
47 | + $this->rootFolder = $rootFolder; |
|
48 | + $this->versionManager = $versionManager; |
|
49 | + } |
|
50 | 50 | |
51 | - public function delete() { |
|
52 | - throw new Forbidden(); |
|
53 | - } |
|
51 | + public function delete() { |
|
52 | + throw new Forbidden(); |
|
53 | + } |
|
54 | 54 | |
55 | - public function getName(): string { |
|
56 | - return 'versions'; |
|
57 | - } |
|
55 | + public function getName(): string { |
|
56 | + return 'versions'; |
|
57 | + } |
|
58 | 58 | |
59 | - public function setName($name) { |
|
60 | - throw new Forbidden(); |
|
61 | - } |
|
59 | + public function setName($name) { |
|
60 | + throw new Forbidden(); |
|
61 | + } |
|
62 | 62 | |
63 | - public function createFile($name, $data = null) { |
|
64 | - throw new Forbidden(); |
|
65 | - } |
|
63 | + public function createFile($name, $data = null) { |
|
64 | + throw new Forbidden(); |
|
65 | + } |
|
66 | 66 | |
67 | - public function createDirectory($name) { |
|
68 | - throw new Forbidden(); |
|
69 | - } |
|
67 | + public function createDirectory($name) { |
|
68 | + throw new Forbidden(); |
|
69 | + } |
|
70 | 70 | |
71 | - public function getChild($name) { |
|
72 | - $userFolder = $this->rootFolder->getUserFolder($this->user->getUID()); |
|
71 | + public function getChild($name) { |
|
72 | + $userFolder = $this->rootFolder->getUserFolder($this->user->getUID()); |
|
73 | 73 | |
74 | - $fileId = (int)$name; |
|
75 | - $nodes = $userFolder->getById($fileId); |
|
74 | + $fileId = (int)$name; |
|
75 | + $nodes = $userFolder->getById($fileId); |
|
76 | 76 | |
77 | - if ($nodes === []) { |
|
78 | - throw new NotFound(); |
|
79 | - } |
|
77 | + if ($nodes === []) { |
|
78 | + throw new NotFound(); |
|
79 | + } |
|
80 | 80 | |
81 | - $node = array_pop($nodes); |
|
81 | + $node = array_pop($nodes); |
|
82 | 82 | |
83 | - if (!$node instanceof File) { |
|
84 | - throw new NotFound(); |
|
85 | - } |
|
83 | + if (!$node instanceof File) { |
|
84 | + throw new NotFound(); |
|
85 | + } |
|
86 | 86 | |
87 | - return new VersionCollection($userFolder, $node, $this->user, $this->versionManager); |
|
88 | - } |
|
87 | + return new VersionCollection($userFolder, $node, $this->user, $this->versionManager); |
|
88 | + } |
|
89 | 89 | |
90 | - public function getChildren(): array { |
|
91 | - return []; |
|
92 | - } |
|
90 | + public function getChildren(): array { |
|
91 | + return []; |
|
92 | + } |
|
93 | 93 | |
94 | - public function childExists($name): bool { |
|
95 | - try { |
|
96 | - $this->getChild($name); |
|
97 | - return true; |
|
98 | - } catch (NotFound $e) { |
|
99 | - return false; |
|
100 | - } |
|
101 | - } |
|
94 | + public function childExists($name): bool { |
|
95 | + try { |
|
96 | + $this->getChild($name); |
|
97 | + return true; |
|
98 | + } catch (NotFound $e) { |
|
99 | + return false; |
|
100 | + } |
|
101 | + } |
|
102 | 102 | |
103 | - public function getLastModified(): int { |
|
104 | - return 0; |
|
105 | - } |
|
103 | + public function getLastModified(): int { |
|
104 | + return 0; |
|
105 | + } |
|
106 | 106 | } |
@@ -71,7 +71,7 @@ |
||
71 | 71 | public function getChild($name) { |
72 | 72 | $userFolder = $this->rootFolder->getUserFolder($this->user->getUID()); |
73 | 73 | |
74 | - $fileId = (int)$name; |
|
74 | + $fileId = (int) $name; |
|
75 | 75 | $nodes = $userFolder->getById($fileId); |
76 | 76 | |
77 | 77 | if ($nodes === []) { |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | } |
61 | 61 | |
62 | 62 | public function getETag(): string { |
63 | - return (string)$this->version->getRevisionId(); |
|
63 | + return (string) $this->version->getRevisionId(); |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | public function getSize(): int { |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | } |
73 | 73 | |
74 | 74 | public function getName(): string { |
75 | - return (string)$this->version->getRevisionId(); |
|
75 | + return (string) $this->version->getRevisionId(); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | public function setName($name) { |
@@ -32,62 +32,62 @@ |
||
32 | 32 | use Sabre\DAV\IFile; |
33 | 33 | |
34 | 34 | class VersionFile implements IFile { |
35 | - /** @var IVersion */ |
|
36 | - private $version; |
|
37 | - |
|
38 | - /** @var IVersionManager */ |
|
39 | - private $versionManager; |
|
40 | - |
|
41 | - public function __construct(IVersion $version, IVersionManager $versionManager) { |
|
42 | - $this->version = $version; |
|
43 | - $this->versionManager = $versionManager; |
|
44 | - } |
|
45 | - |
|
46 | - public function put($data) { |
|
47 | - throw new Forbidden(); |
|
48 | - } |
|
49 | - |
|
50 | - public function get() { |
|
51 | - try { |
|
52 | - return $this->versionManager->read($this->version); |
|
53 | - } catch (NotFoundException $e) { |
|
54 | - throw new NotFound(); |
|
55 | - } |
|
56 | - } |
|
57 | - |
|
58 | - public function getContentType(): string { |
|
59 | - return $this->version->getMimeType(); |
|
60 | - } |
|
61 | - |
|
62 | - public function getETag(): string { |
|
63 | - return (string)$this->version->getRevisionId(); |
|
64 | - } |
|
65 | - |
|
66 | - public function getSize(): int { |
|
67 | - return $this->version->getSize(); |
|
68 | - } |
|
69 | - |
|
70 | - public function delete() { |
|
71 | - throw new Forbidden(); |
|
72 | - } |
|
73 | - |
|
74 | - public function getName(): string { |
|
75 | - return (string)$this->version->getRevisionId(); |
|
76 | - } |
|
77 | - |
|
78 | - public function setName($name) { |
|
79 | - throw new Forbidden(); |
|
80 | - } |
|
81 | - |
|
82 | - public function getLastModified(): int { |
|
83 | - return $this->version->getTimestamp(); |
|
84 | - } |
|
85 | - |
|
86 | - public function rollBack() { |
|
87 | - $this->versionManager->rollback($this->version); |
|
88 | - } |
|
89 | - |
|
90 | - public function getVersion(): IVersion { |
|
91 | - return $this->version; |
|
92 | - } |
|
35 | + /** @var IVersion */ |
|
36 | + private $version; |
|
37 | + |
|
38 | + /** @var IVersionManager */ |
|
39 | + private $versionManager; |
|
40 | + |
|
41 | + public function __construct(IVersion $version, IVersionManager $versionManager) { |
|
42 | + $this->version = $version; |
|
43 | + $this->versionManager = $versionManager; |
|
44 | + } |
|
45 | + |
|
46 | + public function put($data) { |
|
47 | + throw new Forbidden(); |
|
48 | + } |
|
49 | + |
|
50 | + public function get() { |
|
51 | + try { |
|
52 | + return $this->versionManager->read($this->version); |
|
53 | + } catch (NotFoundException $e) { |
|
54 | + throw new NotFound(); |
|
55 | + } |
|
56 | + } |
|
57 | + |
|
58 | + public function getContentType(): string { |
|
59 | + return $this->version->getMimeType(); |
|
60 | + } |
|
61 | + |
|
62 | + public function getETag(): string { |
|
63 | + return (string)$this->version->getRevisionId(); |
|
64 | + } |
|
65 | + |
|
66 | + public function getSize(): int { |
|
67 | + return $this->version->getSize(); |
|
68 | + } |
|
69 | + |
|
70 | + public function delete() { |
|
71 | + throw new Forbidden(); |
|
72 | + } |
|
73 | + |
|
74 | + public function getName(): string { |
|
75 | + return (string)$this->version->getRevisionId(); |
|
76 | + } |
|
77 | + |
|
78 | + public function setName($name) { |
|
79 | + throw new Forbidden(); |
|
80 | + } |
|
81 | + |
|
82 | + public function getLastModified(): int { |
|
83 | + return $this->version->getTimestamp(); |
|
84 | + } |
|
85 | + |
|
86 | + public function rollBack() { |
|
87 | + $this->versionManager->rollback($this->version); |
|
88 | + } |
|
89 | + |
|
90 | + public function getVersion(): IVersion { |
|
91 | + return $this->version; |
|
92 | + } |
|
93 | 93 | } |
@@ -35,76 +35,76 @@ |
||
35 | 35 | use Sabre\DAV\ICollection; |
36 | 36 | |
37 | 37 | class VersionCollection implements ICollection { |
38 | - /** @var Folder */ |
|
39 | - private $userFolder; |
|
40 | - |
|
41 | - /** @var File */ |
|
42 | - private $file; |
|
43 | - |
|
44 | - /** @var IUser */ |
|
45 | - private $user; |
|
46 | - |
|
47 | - /** @var IVersionManager */ |
|
48 | - private $versionManager; |
|
49 | - |
|
50 | - public function __construct(Folder $userFolder, File $file, IUser $user, IVersionManager $versionManager) { |
|
51 | - $this->userFolder = $userFolder; |
|
52 | - $this->file = $file; |
|
53 | - $this->user = $user; |
|
54 | - $this->versionManager = $versionManager; |
|
55 | - } |
|
56 | - |
|
57 | - public function createFile($name, $data = null) { |
|
58 | - throw new Forbidden(); |
|
59 | - } |
|
60 | - |
|
61 | - public function createDirectory($name) { |
|
62 | - throw new Forbidden(); |
|
63 | - } |
|
64 | - |
|
65 | - public function getChild($name) { |
|
66 | - /** @var VersionFile[] $versions */ |
|
67 | - $versions = $this->getChildren(); |
|
68 | - |
|
69 | - foreach ($versions as $version) { |
|
70 | - if ($version->getName() === $name) { |
|
71 | - return $version; |
|
72 | - } |
|
73 | - } |
|
74 | - |
|
75 | - throw new NotFound(); |
|
76 | - } |
|
77 | - |
|
78 | - public function getChildren(): array { |
|
79 | - $versions = $this->versionManager->getVersionsForFile($this->user, $this->file); |
|
80 | - |
|
81 | - return array_map(function (IVersion $version) { |
|
82 | - return new VersionFile($version, $this->versionManager); |
|
83 | - }, $versions); |
|
84 | - } |
|
85 | - |
|
86 | - public function childExists($name): bool { |
|
87 | - try { |
|
88 | - $this->getChild($name); |
|
89 | - return true; |
|
90 | - } catch (NotFound $e) { |
|
91 | - return false; |
|
92 | - } |
|
93 | - } |
|
94 | - |
|
95 | - public function delete() { |
|
96 | - throw new Forbidden(); |
|
97 | - } |
|
98 | - |
|
99 | - public function getName(): string { |
|
100 | - return (string)$this->file->getId(); |
|
101 | - } |
|
102 | - |
|
103 | - public function setName($name) { |
|
104 | - throw new Forbidden(); |
|
105 | - } |
|
106 | - |
|
107 | - public function getLastModified(): int { |
|
108 | - return 0; |
|
109 | - } |
|
38 | + /** @var Folder */ |
|
39 | + private $userFolder; |
|
40 | + |
|
41 | + /** @var File */ |
|
42 | + private $file; |
|
43 | + |
|
44 | + /** @var IUser */ |
|
45 | + private $user; |
|
46 | + |
|
47 | + /** @var IVersionManager */ |
|
48 | + private $versionManager; |
|
49 | + |
|
50 | + public function __construct(Folder $userFolder, File $file, IUser $user, IVersionManager $versionManager) { |
|
51 | + $this->userFolder = $userFolder; |
|
52 | + $this->file = $file; |
|
53 | + $this->user = $user; |
|
54 | + $this->versionManager = $versionManager; |
|
55 | + } |
|
56 | + |
|
57 | + public function createFile($name, $data = null) { |
|
58 | + throw new Forbidden(); |
|
59 | + } |
|
60 | + |
|
61 | + public function createDirectory($name) { |
|
62 | + throw new Forbidden(); |
|
63 | + } |
|
64 | + |
|
65 | + public function getChild($name) { |
|
66 | + /** @var VersionFile[] $versions */ |
|
67 | + $versions = $this->getChildren(); |
|
68 | + |
|
69 | + foreach ($versions as $version) { |
|
70 | + if ($version->getName() === $name) { |
|
71 | + return $version; |
|
72 | + } |
|
73 | + } |
|
74 | + |
|
75 | + throw new NotFound(); |
|
76 | + } |
|
77 | + |
|
78 | + public function getChildren(): array { |
|
79 | + $versions = $this->versionManager->getVersionsForFile($this->user, $this->file); |
|
80 | + |
|
81 | + return array_map(function (IVersion $version) { |
|
82 | + return new VersionFile($version, $this->versionManager); |
|
83 | + }, $versions); |
|
84 | + } |
|
85 | + |
|
86 | + public function childExists($name): bool { |
|
87 | + try { |
|
88 | + $this->getChild($name); |
|
89 | + return true; |
|
90 | + } catch (NotFound $e) { |
|
91 | + return false; |
|
92 | + } |
|
93 | + } |
|
94 | + |
|
95 | + public function delete() { |
|
96 | + throw new Forbidden(); |
|
97 | + } |
|
98 | + |
|
99 | + public function getName(): string { |
|
100 | + return (string)$this->file->getId(); |
|
101 | + } |
|
102 | + |
|
103 | + public function setName($name) { |
|
104 | + throw new Forbidden(); |
|
105 | + } |
|
106 | + |
|
107 | + public function getLastModified(): int { |
|
108 | + return 0; |
|
109 | + } |
|
110 | 110 | } |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | public function getChildren(): array { |
79 | 79 | $versions = $this->versionManager->getVersionsForFile($this->user, $this->file); |
80 | 80 | |
81 | - return array_map(function (IVersion $version) { |
|
81 | + return array_map(function(IVersion $version) { |
|
82 | 82 | return new VersionFile($version, $this->versionManager); |
83 | 83 | }, $versions); |
84 | 84 | } |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | } |
98 | 98 | |
99 | 99 | public function getName(): string { |
100 | - return (string)$this->file->getId(); |
|
100 | + return (string) $this->file->getId(); |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | public function setName($name) { |
@@ -32,60 +32,60 @@ |
||
32 | 32 | use OCP\User\Backend\IPasswordConfirmationBackend; |
33 | 33 | |
34 | 34 | class PasswordConfirmationMiddleware extends Middleware { |
35 | - /** @var ControllerMethodReflector */ |
|
36 | - private $reflector; |
|
37 | - /** @var ISession */ |
|
38 | - private $session; |
|
39 | - /** @var IUserSession */ |
|
40 | - private $userSession; |
|
41 | - /** @var ITimeFactory */ |
|
42 | - private $timeFactory; |
|
43 | - /** @var array */ |
|
44 | - private $excludedUserBackEnds = ['user_saml' => true, 'user_globalsiteselector' => true]; |
|
35 | + /** @var ControllerMethodReflector */ |
|
36 | + private $reflector; |
|
37 | + /** @var ISession */ |
|
38 | + private $session; |
|
39 | + /** @var IUserSession */ |
|
40 | + private $userSession; |
|
41 | + /** @var ITimeFactory */ |
|
42 | + private $timeFactory; |
|
43 | + /** @var array */ |
|
44 | + private $excludedUserBackEnds = ['user_saml' => true, 'user_globalsiteselector' => true]; |
|
45 | 45 | |
46 | - /** |
|
47 | - * PasswordConfirmationMiddleware constructor. |
|
48 | - * |
|
49 | - * @param ControllerMethodReflector $reflector |
|
50 | - * @param ISession $session |
|
51 | - * @param IUserSession $userSession |
|
52 | - * @param ITimeFactory $timeFactory |
|
53 | - */ |
|
54 | - public function __construct(ControllerMethodReflector $reflector, |
|
55 | - ISession $session, |
|
56 | - IUserSession $userSession, |
|
57 | - ITimeFactory $timeFactory) { |
|
58 | - $this->reflector = $reflector; |
|
59 | - $this->session = $session; |
|
60 | - $this->userSession = $userSession; |
|
61 | - $this->timeFactory = $timeFactory; |
|
62 | - } |
|
46 | + /** |
|
47 | + * PasswordConfirmationMiddleware constructor. |
|
48 | + * |
|
49 | + * @param ControllerMethodReflector $reflector |
|
50 | + * @param ISession $session |
|
51 | + * @param IUserSession $userSession |
|
52 | + * @param ITimeFactory $timeFactory |
|
53 | + */ |
|
54 | + public function __construct(ControllerMethodReflector $reflector, |
|
55 | + ISession $session, |
|
56 | + IUserSession $userSession, |
|
57 | + ITimeFactory $timeFactory) { |
|
58 | + $this->reflector = $reflector; |
|
59 | + $this->session = $session; |
|
60 | + $this->userSession = $userSession; |
|
61 | + $this->timeFactory = $timeFactory; |
|
62 | + } |
|
63 | 63 | |
64 | - /** |
|
65 | - * @param Controller $controller |
|
66 | - * @param string $methodName |
|
67 | - * @throws NotConfirmedException |
|
68 | - */ |
|
69 | - public function beforeController($controller, $methodName) { |
|
70 | - if ($this->reflector->hasAnnotation('PasswordConfirmationRequired')) { |
|
71 | - $user = $this->userSession->getUser(); |
|
72 | - $backendClassName = ''; |
|
73 | - if ($user !== null) { |
|
74 | - $backend = $user->getBackend(); |
|
75 | - if ($backend instanceof IPasswordConfirmationBackend) { |
|
76 | - if (!$backend->canConfirmPassword($user->getUID())) { |
|
77 | - return; |
|
78 | - } |
|
79 | - } |
|
64 | + /** |
|
65 | + * @param Controller $controller |
|
66 | + * @param string $methodName |
|
67 | + * @throws NotConfirmedException |
|
68 | + */ |
|
69 | + public function beforeController($controller, $methodName) { |
|
70 | + if ($this->reflector->hasAnnotation('PasswordConfirmationRequired')) { |
|
71 | + $user = $this->userSession->getUser(); |
|
72 | + $backendClassName = ''; |
|
73 | + if ($user !== null) { |
|
74 | + $backend = $user->getBackend(); |
|
75 | + if ($backend instanceof IPasswordConfirmationBackend) { |
|
76 | + if (!$backend->canConfirmPassword($user->getUID())) { |
|
77 | + return; |
|
78 | + } |
|
79 | + } |
|
80 | 80 | |
81 | - $backendClassName = $user->getBackendClassName(); |
|
82 | - } |
|
81 | + $backendClassName = $user->getBackendClassName(); |
|
82 | + } |
|
83 | 83 | |
84 | - $lastConfirm = (int) $this->session->get('last-password-confirm'); |
|
85 | - // we can't check the password against a SAML backend, so skip password confirmation in this case |
|
86 | - if (!isset($this->excludedUserBackEnds[$backendClassName]) && $lastConfirm < ($this->timeFactory->getTime() - (30 * 60 + 15))) { // allow 15 seconds delay |
|
87 | - throw new NotConfirmedException(); |
|
88 | - } |
|
89 | - } |
|
90 | - } |
|
84 | + $lastConfirm = (int) $this->session->get('last-password-confirm'); |
|
85 | + // we can't check the password against a SAML backend, so skip password confirmation in this case |
|
86 | + if (!isset($this->excludedUserBackEnds[$backendClassName]) && $lastConfirm < ($this->timeFactory->getTime() - (30 * 60 + 15))) { // allow 15 seconds delay |
|
87 | + throw new NotConfirmedException(); |
|
88 | + } |
|
89 | + } |
|
90 | + } |
|
91 | 91 | } |
@@ -29,8 +29,8 @@ |
||
29 | 29 | */ |
30 | 30 | interface IPasswordConfirmationBackend { |
31 | 31 | |
32 | - /** |
|
33 | - * @since 15.0.0 |
|
34 | - */ |
|
35 | - public function canConfirmPassword(string $uid): bool; |
|
32 | + /** |
|
33 | + * @since 15.0.0 |
|
34 | + */ |
|
35 | + public function canConfirmPassword(string $uid): bool; |
|
36 | 36 | } |
@@ -33,32 +33,32 @@ |
||
33 | 33 | */ |
34 | 34 | class CachedSubscriptionObject extends \Sabre\CalDAV\CalendarObject { |
35 | 35 | |
36 | - /** |
|
37 | - * @inheritdoc |
|
38 | - */ |
|
39 | - public function get() { |
|
40 | - // Pre-populating the 'calendardata' is optional, if we don't have it |
|
41 | - // already we fetch it from the backend. |
|
42 | - if (!isset($this->objectData['calendardata'])) { |
|
43 | - $this->objectData = $this->caldavBackend->getCalendarObject($this->calendarInfo['id'], $this->objectData['uri'], CalDavBackend::CALENDAR_TYPE_SUBSCRIPTION); |
|
44 | - } |
|
36 | + /** |
|
37 | + * @inheritdoc |
|
38 | + */ |
|
39 | + public function get() { |
|
40 | + // Pre-populating the 'calendardata' is optional, if we don't have it |
|
41 | + // already we fetch it from the backend. |
|
42 | + if (!isset($this->objectData['calendardata'])) { |
|
43 | + $this->objectData = $this->caldavBackend->getCalendarObject($this->calendarInfo['id'], $this->objectData['uri'], CalDavBackend::CALENDAR_TYPE_SUBSCRIPTION); |
|
44 | + } |
|
45 | 45 | |
46 | - return $this->objectData['calendardata']; |
|
47 | - } |
|
46 | + return $this->objectData['calendardata']; |
|
47 | + } |
|
48 | 48 | |
49 | - /** |
|
50 | - * @param resource|string $calendarData |
|
51 | - * @return string|void |
|
52 | - * @throws MethodNotAllowed |
|
53 | - */ |
|
54 | - public function put($calendarData) { |
|
55 | - throw new MethodNotAllowed('Creating objects in a cached subscription is not allowed'); |
|
56 | - } |
|
49 | + /** |
|
50 | + * @param resource|string $calendarData |
|
51 | + * @return string|void |
|
52 | + * @throws MethodNotAllowed |
|
53 | + */ |
|
54 | + public function put($calendarData) { |
|
55 | + throw new MethodNotAllowed('Creating objects in a cached subscription is not allowed'); |
|
56 | + } |
|
57 | 57 | |
58 | - /** |
|
59 | - * @throws MethodNotAllowed |
|
60 | - */ |
|
61 | - public function delete() { |
|
62 | - throw new MethodNotAllowed('Deleting objects in a cached subscription is not allowed'); |
|
63 | - } |
|
58 | + /** |
|
59 | + * @throws MethodNotAllowed |
|
60 | + */ |
|
61 | + public function delete() { |
|
62 | + throw new MethodNotAllowed('Deleting objects in a cached subscription is not allowed'); |
|
63 | + } |
|
64 | 64 | } |
@@ -36,178 +36,178 @@ |
||
36 | 36 | */ |
37 | 37 | interface IUser { |
38 | 38 | |
39 | - /** |
|
40 | - * get the user id |
|
41 | - * |
|
42 | - * @return string |
|
43 | - * @since 8.0.0 |
|
44 | - */ |
|
45 | - public function getUID(); |
|
46 | - |
|
47 | - /** |
|
48 | - * get the display name for the user, if no specific display name is set it will fallback to the user id |
|
49 | - * |
|
50 | - * @return string |
|
51 | - * @since 8.0.0 |
|
52 | - */ |
|
53 | - public function getDisplayName(); |
|
54 | - |
|
55 | - /** |
|
56 | - * set the display name for the user |
|
57 | - * |
|
58 | - * @param string $displayName |
|
59 | - * @return bool |
|
60 | - * @since 8.0.0 |
|
61 | - */ |
|
62 | - public function setDisplayName($displayName); |
|
63 | - |
|
64 | - /** |
|
65 | - * returns the timestamp of the user's last login or 0 if the user did never |
|
66 | - * login |
|
67 | - * |
|
68 | - * @return int |
|
69 | - * @since 8.0.0 |
|
70 | - */ |
|
71 | - public function getLastLogin(); |
|
72 | - |
|
73 | - /** |
|
74 | - * updates the timestamp of the most recent login of this user |
|
75 | - * @since 8.0.0 |
|
76 | - */ |
|
77 | - public function updateLastLoginTimestamp(); |
|
78 | - |
|
79 | - /** |
|
80 | - * Delete the user |
|
81 | - * |
|
82 | - * @return bool |
|
83 | - * @since 8.0.0 |
|
84 | - */ |
|
85 | - public function delete(); |
|
86 | - |
|
87 | - /** |
|
88 | - * Set the password of the user |
|
89 | - * |
|
90 | - * @param string $password |
|
91 | - * @param string $recoveryPassword for the encryption app to reset encryption keys |
|
92 | - * @return bool |
|
93 | - * @since 8.0.0 |
|
94 | - */ |
|
95 | - public function setPassword($password, $recoveryPassword = null); |
|
96 | - |
|
97 | - /** |
|
98 | - * get the users home folder to mount |
|
99 | - * |
|
100 | - * @return string |
|
101 | - * @since 8.0.0 |
|
102 | - */ |
|
103 | - public function getHome(); |
|
104 | - |
|
105 | - /** |
|
106 | - * Get the name of the backend class the user is connected with |
|
107 | - * |
|
108 | - * @return string |
|
109 | - * @since 8.0.0 |
|
110 | - */ |
|
111 | - public function getBackendClassName(); |
|
112 | - |
|
113 | - /** |
|
114 | - * Get the backend for the current user object |
|
115 | - * |
|
116 | - * @return UserInterface |
|
117 | - * @since 15.0.0 |
|
118 | - */ |
|
119 | - public function getBackend(); |
|
120 | - |
|
121 | - /** |
|
122 | - * check if the backend allows the user to change his avatar on Personal page |
|
123 | - * |
|
124 | - * @return bool |
|
125 | - * @since 8.0.0 |
|
126 | - */ |
|
127 | - public function canChangeAvatar(); |
|
128 | - |
|
129 | - /** |
|
130 | - * check if the backend supports changing passwords |
|
131 | - * |
|
132 | - * @return bool |
|
133 | - * @since 8.0.0 |
|
134 | - */ |
|
135 | - public function canChangePassword(); |
|
136 | - |
|
137 | - /** |
|
138 | - * check if the backend supports changing display names |
|
139 | - * |
|
140 | - * @return bool |
|
141 | - * @since 8.0.0 |
|
142 | - */ |
|
143 | - public function canChangeDisplayName(); |
|
144 | - |
|
145 | - /** |
|
146 | - * check if the user is enabled |
|
147 | - * |
|
148 | - * @return bool |
|
149 | - * @since 8.0.0 |
|
150 | - */ |
|
151 | - public function isEnabled(); |
|
152 | - |
|
153 | - /** |
|
154 | - * set the enabled status for the user |
|
155 | - * |
|
156 | - * @param bool $enabled |
|
157 | - * @since 8.0.0 |
|
158 | - */ |
|
159 | - public function setEnabled(bool $enabled = true); |
|
160 | - |
|
161 | - /** |
|
162 | - * get the users email address |
|
163 | - * |
|
164 | - * @return string|null |
|
165 | - * @since 9.0.0 |
|
166 | - */ |
|
167 | - public function getEMailAddress(); |
|
168 | - |
|
169 | - /** |
|
170 | - * get the avatar image if it exists |
|
171 | - * |
|
172 | - * @param int $size |
|
173 | - * @return IImage|null |
|
174 | - * @since 9.0.0 |
|
175 | - */ |
|
176 | - public function getAvatarImage($size); |
|
177 | - |
|
178 | - /** |
|
179 | - * get the federation cloud id |
|
180 | - * |
|
181 | - * @return string |
|
182 | - * @since 9.0.0 |
|
183 | - */ |
|
184 | - public function getCloudId(); |
|
185 | - |
|
186 | - /** |
|
187 | - * set the email address of the user |
|
188 | - * |
|
189 | - * @param string|null $mailAddress |
|
190 | - * @return void |
|
191 | - * @since 9.0.0 |
|
192 | - */ |
|
193 | - public function setEMailAddress($mailAddress); |
|
194 | - |
|
195 | - /** |
|
196 | - * get the users' quota in human readable form. If a specific quota is not |
|
197 | - * set for the user, the default value is returned. If a default setting |
|
198 | - * was not set otherwise, it is return as 'none', i.e. quota is not limited. |
|
199 | - * |
|
200 | - * @return string |
|
201 | - * @since 9.0.0 |
|
202 | - */ |
|
203 | - public function getQuota(); |
|
204 | - |
|
205 | - /** |
|
206 | - * set the users' quota |
|
207 | - * |
|
208 | - * @param string $quota |
|
209 | - * @return void |
|
210 | - * @since 9.0.0 |
|
211 | - */ |
|
212 | - public function setQuota($quota); |
|
39 | + /** |
|
40 | + * get the user id |
|
41 | + * |
|
42 | + * @return string |
|
43 | + * @since 8.0.0 |
|
44 | + */ |
|
45 | + public function getUID(); |
|
46 | + |
|
47 | + /** |
|
48 | + * get the display name for the user, if no specific display name is set it will fallback to the user id |
|
49 | + * |
|
50 | + * @return string |
|
51 | + * @since 8.0.0 |
|
52 | + */ |
|
53 | + public function getDisplayName(); |
|
54 | + |
|
55 | + /** |
|
56 | + * set the display name for the user |
|
57 | + * |
|
58 | + * @param string $displayName |
|
59 | + * @return bool |
|
60 | + * @since 8.0.0 |
|
61 | + */ |
|
62 | + public function setDisplayName($displayName); |
|
63 | + |
|
64 | + /** |
|
65 | + * returns the timestamp of the user's last login or 0 if the user did never |
|
66 | + * login |
|
67 | + * |
|
68 | + * @return int |
|
69 | + * @since 8.0.0 |
|
70 | + */ |
|
71 | + public function getLastLogin(); |
|
72 | + |
|
73 | + /** |
|
74 | + * updates the timestamp of the most recent login of this user |
|
75 | + * @since 8.0.0 |
|
76 | + */ |
|
77 | + public function updateLastLoginTimestamp(); |
|
78 | + |
|
79 | + /** |
|
80 | + * Delete the user |
|
81 | + * |
|
82 | + * @return bool |
|
83 | + * @since 8.0.0 |
|
84 | + */ |
|
85 | + public function delete(); |
|
86 | + |
|
87 | + /** |
|
88 | + * Set the password of the user |
|
89 | + * |
|
90 | + * @param string $password |
|
91 | + * @param string $recoveryPassword for the encryption app to reset encryption keys |
|
92 | + * @return bool |
|
93 | + * @since 8.0.0 |
|
94 | + */ |
|
95 | + public function setPassword($password, $recoveryPassword = null); |
|
96 | + |
|
97 | + /** |
|
98 | + * get the users home folder to mount |
|
99 | + * |
|
100 | + * @return string |
|
101 | + * @since 8.0.0 |
|
102 | + */ |
|
103 | + public function getHome(); |
|
104 | + |
|
105 | + /** |
|
106 | + * Get the name of the backend class the user is connected with |
|
107 | + * |
|
108 | + * @return string |
|
109 | + * @since 8.0.0 |
|
110 | + */ |
|
111 | + public function getBackendClassName(); |
|
112 | + |
|
113 | + /** |
|
114 | + * Get the backend for the current user object |
|
115 | + * |
|
116 | + * @return UserInterface |
|
117 | + * @since 15.0.0 |
|
118 | + */ |
|
119 | + public function getBackend(); |
|
120 | + |
|
121 | + /** |
|
122 | + * check if the backend allows the user to change his avatar on Personal page |
|
123 | + * |
|
124 | + * @return bool |
|
125 | + * @since 8.0.0 |
|
126 | + */ |
|
127 | + public function canChangeAvatar(); |
|
128 | + |
|
129 | + /** |
|
130 | + * check if the backend supports changing passwords |
|
131 | + * |
|
132 | + * @return bool |
|
133 | + * @since 8.0.0 |
|
134 | + */ |
|
135 | + public function canChangePassword(); |
|
136 | + |
|
137 | + /** |
|
138 | + * check if the backend supports changing display names |
|
139 | + * |
|
140 | + * @return bool |
|
141 | + * @since 8.0.0 |
|
142 | + */ |
|
143 | + public function canChangeDisplayName(); |
|
144 | + |
|
145 | + /** |
|
146 | + * check if the user is enabled |
|
147 | + * |
|
148 | + * @return bool |
|
149 | + * @since 8.0.0 |
|
150 | + */ |
|
151 | + public function isEnabled(); |
|
152 | + |
|
153 | + /** |
|
154 | + * set the enabled status for the user |
|
155 | + * |
|
156 | + * @param bool $enabled |
|
157 | + * @since 8.0.0 |
|
158 | + */ |
|
159 | + public function setEnabled(bool $enabled = true); |
|
160 | + |
|
161 | + /** |
|
162 | + * get the users email address |
|
163 | + * |
|
164 | + * @return string|null |
|
165 | + * @since 9.0.0 |
|
166 | + */ |
|
167 | + public function getEMailAddress(); |
|
168 | + |
|
169 | + /** |
|
170 | + * get the avatar image if it exists |
|
171 | + * |
|
172 | + * @param int $size |
|
173 | + * @return IImage|null |
|
174 | + * @since 9.0.0 |
|
175 | + */ |
|
176 | + public function getAvatarImage($size); |
|
177 | + |
|
178 | + /** |
|
179 | + * get the federation cloud id |
|
180 | + * |
|
181 | + * @return string |
|
182 | + * @since 9.0.0 |
|
183 | + */ |
|
184 | + public function getCloudId(); |
|
185 | + |
|
186 | + /** |
|
187 | + * set the email address of the user |
|
188 | + * |
|
189 | + * @param string|null $mailAddress |
|
190 | + * @return void |
|
191 | + * @since 9.0.0 |
|
192 | + */ |
|
193 | + public function setEMailAddress($mailAddress); |
|
194 | + |
|
195 | + /** |
|
196 | + * get the users' quota in human readable form. If a specific quota is not |
|
197 | + * set for the user, the default value is returned. If a default setting |
|
198 | + * was not set otherwise, it is return as 'none', i.e. quota is not limited. |
|
199 | + * |
|
200 | + * @return string |
|
201 | + * @since 9.0.0 |
|
202 | + */ |
|
203 | + public function getQuota(); |
|
204 | + |
|
205 | + /** |
|
206 | + * set the users' quota |
|
207 | + * |
|
208 | + * @param string $quota |
|
209 | + * @return void |
|
210 | + * @since 9.0.0 |
|
211 | + */ |
|
212 | + public function setQuota($quota); |
|
213 | 213 | } |
@@ -170,7 +170,7 @@ |
||
170 | 170 | )) |
171 | 171 | ->andWhere($update->expr()->like( |
172 | 172 | $update->func()->lower('name'), |
173 | - $update->createNamedParameter('%' . $this->dbConnection->escapeLikeParameter('.' . $ext)) |
|
173 | + $update->createNamedParameter('%'.$this->dbConnection->escapeLikeParameter('.'.$ext)) |
|
174 | 174 | )); |
175 | 175 | return $update->execute(); |
176 | 176 | } |
@@ -35,148 +35,148 @@ |
||
35 | 35 | */ |
36 | 36 | class Loader implements IMimeTypeLoader { |
37 | 37 | |
38 | - /** @var IDBConnection */ |
|
39 | - private $dbConnection; |
|
40 | - |
|
41 | - /** @var array [id => mimetype] */ |
|
42 | - protected $mimetypes; |
|
43 | - |
|
44 | - /** @var array [mimetype => id] */ |
|
45 | - protected $mimetypeIds; |
|
46 | - |
|
47 | - /** |
|
48 | - * @param IDBConnection $dbConnection |
|
49 | - */ |
|
50 | - public function __construct(IDBConnection $dbConnection) { |
|
51 | - $this->dbConnection = $dbConnection; |
|
52 | - $this->mimetypes = []; |
|
53 | - $this->mimetypeIds = []; |
|
54 | - } |
|
55 | - |
|
56 | - /** |
|
57 | - * Get a mimetype from its ID |
|
58 | - * |
|
59 | - * @param int $id |
|
60 | - * @return string|null |
|
61 | - */ |
|
62 | - public function getMimetypeById($id) { |
|
63 | - if (!$this->mimetypes) { |
|
64 | - $this->loadMimetypes(); |
|
65 | - } |
|
66 | - if (isset($this->mimetypes[$id])) { |
|
67 | - return $this->mimetypes[$id]; |
|
68 | - } |
|
69 | - return null; |
|
70 | - } |
|
71 | - |
|
72 | - /** |
|
73 | - * Get a mimetype ID, adding the mimetype to the DB if it does not exist |
|
74 | - * |
|
75 | - * @param string $mimetype |
|
76 | - * @return int |
|
77 | - */ |
|
78 | - public function getId($mimetype) { |
|
79 | - if (!$this->mimetypeIds) { |
|
80 | - $this->loadMimetypes(); |
|
81 | - } |
|
82 | - if (isset($this->mimetypeIds[$mimetype])) { |
|
83 | - return $this->mimetypeIds[$mimetype]; |
|
84 | - } |
|
85 | - return $this->store($mimetype); |
|
86 | - } |
|
87 | - |
|
88 | - /** |
|
89 | - * Test if a mimetype exists in the database |
|
90 | - * |
|
91 | - * @param string $mimetype |
|
92 | - * @return bool |
|
93 | - */ |
|
94 | - public function exists($mimetype) { |
|
95 | - if (!$this->mimetypeIds) { |
|
96 | - $this->loadMimetypes(); |
|
97 | - } |
|
98 | - return isset($this->mimetypeIds[$mimetype]); |
|
99 | - } |
|
100 | - |
|
101 | - /** |
|
102 | - * Clear all loaded mimetypes, allow for re-loading |
|
103 | - */ |
|
104 | - public function reset() { |
|
105 | - $this->mimetypes = []; |
|
106 | - $this->mimetypeIds = []; |
|
107 | - } |
|
108 | - |
|
109 | - /** |
|
110 | - * Store a mimetype in the DB |
|
111 | - * |
|
112 | - * @param string $mimetype |
|
113 | - * @param int inserted ID |
|
114 | - */ |
|
115 | - protected function store($mimetype) { |
|
116 | - $this->dbConnection->insertIfNotExist('*PREFIX*mimetypes', [ |
|
117 | - 'mimetype' => $mimetype |
|
118 | - ]); |
|
119 | - |
|
120 | - $fetch = $this->dbConnection->getQueryBuilder(); |
|
121 | - $fetch->select('id') |
|
122 | - ->from('mimetypes') |
|
123 | - ->where( |
|
124 | - $fetch->expr()->eq('mimetype', $fetch->createNamedParameter($mimetype) |
|
125 | - )); |
|
126 | - |
|
127 | - $result = $fetch->execute(); |
|
128 | - $row = $result->fetch(); |
|
129 | - $result->closeCursor(); |
|
130 | - |
|
131 | - if (!$row) { |
|
132 | - throw new \Exception("Failed to get mimetype id for $mimetype after trying to store it"); |
|
133 | - } |
|
134 | - |
|
135 | - $this->mimetypes[$row['id']] = $mimetype; |
|
136 | - $this->mimetypeIds[$mimetype] = $row['id']; |
|
137 | - return $row['id']; |
|
138 | - } |
|
139 | - |
|
140 | - /** |
|
141 | - * Load all mimetypes from DB |
|
142 | - */ |
|
143 | - private function loadMimetypes() { |
|
144 | - $qb = $this->dbConnection->getQueryBuilder(); |
|
145 | - $qb->select('id', 'mimetype') |
|
146 | - ->from('mimetypes'); |
|
147 | - |
|
148 | - $result = $qb->execute(); |
|
149 | - $results = $result->fetchAll(); |
|
150 | - $result->closeCursor(); |
|
151 | - |
|
152 | - foreach ($results as $row) { |
|
153 | - $this->mimetypes[$row['id']] = $row['mimetype']; |
|
154 | - $this->mimetypeIds[$row['mimetype']] = $row['id']; |
|
155 | - } |
|
156 | - } |
|
157 | - |
|
158 | - /** |
|
159 | - * Update filecache mimetype based on file extension |
|
160 | - * |
|
161 | - * @param string $ext file extension |
|
162 | - * @param int $mimeTypeId |
|
163 | - * @return int number of changed rows |
|
164 | - */ |
|
165 | - public function updateFilecache($ext, $mimeTypeId) { |
|
166 | - $folderMimeTypeId = $this->getId('httpd/unix-directory'); |
|
167 | - $update = $this->dbConnection->getQueryBuilder(); |
|
168 | - $update->update('filecache') |
|
169 | - ->set('mimetype', $update->createNamedParameter($mimeTypeId)) |
|
170 | - ->where($update->expr()->neq( |
|
171 | - 'mimetype', $update->createNamedParameter($mimeTypeId) |
|
172 | - )) |
|
173 | - ->andWhere($update->expr()->neq( |
|
174 | - 'mimetype', $update->createNamedParameter($folderMimeTypeId) |
|
175 | - )) |
|
176 | - ->andWhere($update->expr()->like( |
|
177 | - $update->func()->lower('name'), |
|
178 | - $update->createNamedParameter('%' . $this->dbConnection->escapeLikeParameter('.' . $ext)) |
|
179 | - )); |
|
180 | - return $update->execute(); |
|
181 | - } |
|
38 | + /** @var IDBConnection */ |
|
39 | + private $dbConnection; |
|
40 | + |
|
41 | + /** @var array [id => mimetype] */ |
|
42 | + protected $mimetypes; |
|
43 | + |
|
44 | + /** @var array [mimetype => id] */ |
|
45 | + protected $mimetypeIds; |
|
46 | + |
|
47 | + /** |
|
48 | + * @param IDBConnection $dbConnection |
|
49 | + */ |
|
50 | + public function __construct(IDBConnection $dbConnection) { |
|
51 | + $this->dbConnection = $dbConnection; |
|
52 | + $this->mimetypes = []; |
|
53 | + $this->mimetypeIds = []; |
|
54 | + } |
|
55 | + |
|
56 | + /** |
|
57 | + * Get a mimetype from its ID |
|
58 | + * |
|
59 | + * @param int $id |
|
60 | + * @return string|null |
|
61 | + */ |
|
62 | + public function getMimetypeById($id) { |
|
63 | + if (!$this->mimetypes) { |
|
64 | + $this->loadMimetypes(); |
|
65 | + } |
|
66 | + if (isset($this->mimetypes[$id])) { |
|
67 | + return $this->mimetypes[$id]; |
|
68 | + } |
|
69 | + return null; |
|
70 | + } |
|
71 | + |
|
72 | + /** |
|
73 | + * Get a mimetype ID, adding the mimetype to the DB if it does not exist |
|
74 | + * |
|
75 | + * @param string $mimetype |
|
76 | + * @return int |
|
77 | + */ |
|
78 | + public function getId($mimetype) { |
|
79 | + if (!$this->mimetypeIds) { |
|
80 | + $this->loadMimetypes(); |
|
81 | + } |
|
82 | + if (isset($this->mimetypeIds[$mimetype])) { |
|
83 | + return $this->mimetypeIds[$mimetype]; |
|
84 | + } |
|
85 | + return $this->store($mimetype); |
|
86 | + } |
|
87 | + |
|
88 | + /** |
|
89 | + * Test if a mimetype exists in the database |
|
90 | + * |
|
91 | + * @param string $mimetype |
|
92 | + * @return bool |
|
93 | + */ |
|
94 | + public function exists($mimetype) { |
|
95 | + if (!$this->mimetypeIds) { |
|
96 | + $this->loadMimetypes(); |
|
97 | + } |
|
98 | + return isset($this->mimetypeIds[$mimetype]); |
|
99 | + } |
|
100 | + |
|
101 | + /** |
|
102 | + * Clear all loaded mimetypes, allow for re-loading |
|
103 | + */ |
|
104 | + public function reset() { |
|
105 | + $this->mimetypes = []; |
|
106 | + $this->mimetypeIds = []; |
|
107 | + } |
|
108 | + |
|
109 | + /** |
|
110 | + * Store a mimetype in the DB |
|
111 | + * |
|
112 | + * @param string $mimetype |
|
113 | + * @param int inserted ID |
|
114 | + */ |
|
115 | + protected function store($mimetype) { |
|
116 | + $this->dbConnection->insertIfNotExist('*PREFIX*mimetypes', [ |
|
117 | + 'mimetype' => $mimetype |
|
118 | + ]); |
|
119 | + |
|
120 | + $fetch = $this->dbConnection->getQueryBuilder(); |
|
121 | + $fetch->select('id') |
|
122 | + ->from('mimetypes') |
|
123 | + ->where( |
|
124 | + $fetch->expr()->eq('mimetype', $fetch->createNamedParameter($mimetype) |
|
125 | + )); |
|
126 | + |
|
127 | + $result = $fetch->execute(); |
|
128 | + $row = $result->fetch(); |
|
129 | + $result->closeCursor(); |
|
130 | + |
|
131 | + if (!$row) { |
|
132 | + throw new \Exception("Failed to get mimetype id for $mimetype after trying to store it"); |
|
133 | + } |
|
134 | + |
|
135 | + $this->mimetypes[$row['id']] = $mimetype; |
|
136 | + $this->mimetypeIds[$mimetype] = $row['id']; |
|
137 | + return $row['id']; |
|
138 | + } |
|
139 | + |
|
140 | + /** |
|
141 | + * Load all mimetypes from DB |
|
142 | + */ |
|
143 | + private function loadMimetypes() { |
|
144 | + $qb = $this->dbConnection->getQueryBuilder(); |
|
145 | + $qb->select('id', 'mimetype') |
|
146 | + ->from('mimetypes'); |
|
147 | + |
|
148 | + $result = $qb->execute(); |
|
149 | + $results = $result->fetchAll(); |
|
150 | + $result->closeCursor(); |
|
151 | + |
|
152 | + foreach ($results as $row) { |
|
153 | + $this->mimetypes[$row['id']] = $row['mimetype']; |
|
154 | + $this->mimetypeIds[$row['mimetype']] = $row['id']; |
|
155 | + } |
|
156 | + } |
|
157 | + |
|
158 | + /** |
|
159 | + * Update filecache mimetype based on file extension |
|
160 | + * |
|
161 | + * @param string $ext file extension |
|
162 | + * @param int $mimeTypeId |
|
163 | + * @return int number of changed rows |
|
164 | + */ |
|
165 | + public function updateFilecache($ext, $mimeTypeId) { |
|
166 | + $folderMimeTypeId = $this->getId('httpd/unix-directory'); |
|
167 | + $update = $this->dbConnection->getQueryBuilder(); |
|
168 | + $update->update('filecache') |
|
169 | + ->set('mimetype', $update->createNamedParameter($mimeTypeId)) |
|
170 | + ->where($update->expr()->neq( |
|
171 | + 'mimetype', $update->createNamedParameter($mimeTypeId) |
|
172 | + )) |
|
173 | + ->andWhere($update->expr()->neq( |
|
174 | + 'mimetype', $update->createNamedParameter($folderMimeTypeId) |
|
175 | + )) |
|
176 | + ->andWhere($update->expr()->like( |
|
177 | + $update->func()->lower('name'), |
|
178 | + $update->createNamedParameter('%' . $this->dbConnection->escapeLikeParameter('.' . $ext)) |
|
179 | + )); |
|
180 | + return $update->execute(); |
|
181 | + } |
|
182 | 182 | } |
@@ -32,18 +32,18 @@ |
||
32 | 32 | |
33 | 33 | class Version1008Date20181105112049 extends SimpleMigrationStep { |
34 | 34 | |
35 | - /** |
|
36 | - * @param IOutput $output |
|
37 | - * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
38 | - * @param array $options |
|
39 | - * @return null|ISchemaWrapper |
|
40 | - */ |
|
41 | - public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) { |
|
42 | - /** @var ISchemaWrapper $schema */ |
|
43 | - $schema = $schemaClosure(); |
|
44 | - $table = $schema->getTable('calendarsubscriptions'); |
|
45 | - $table->dropColumn('source_copy'); |
|
35 | + /** |
|
36 | + * @param IOutput $output |
|
37 | + * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
38 | + * @param array $options |
|
39 | + * @return null|ISchemaWrapper |
|
40 | + */ |
|
41 | + public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) { |
|
42 | + /** @var ISchemaWrapper $schema */ |
|
43 | + $schema = $schemaClosure(); |
|
44 | + $table = $schema->getTable('calendarsubscriptions'); |
|
45 | + $table->dropColumn('source_copy'); |
|
46 | 46 | |
47 | - return $schema; |
|
48 | - } |
|
47 | + return $schema; |
|
48 | + } |
|
49 | 49 | } |