@@ -31,11 +31,11 @@ |
||
31 | 31 | * @since 20.0.0 |
32 | 32 | */ |
33 | 33 | interface IRootMountProvider { |
34 | - /** |
|
35 | - * Get all root mountpoints of this provider |
|
36 | - * |
|
37 | - * @return \OCP\Files\Mount\IMountPoint[] |
|
38 | - * @since 20.0.0 |
|
39 | - */ |
|
40 | - public function getRootMounts(IStorageFactory $loader): array; |
|
34 | + /** |
|
35 | + * Get all root mountpoints of this provider |
|
36 | + * |
|
37 | + * @return \OCP\Files\Mount\IMountPoint[] |
|
38 | + * @since 20.0.0 |
|
39 | + */ |
|
40 | + public function getRootMounts(IStorageFactory $loader): array; |
|
41 | 41 | } |
@@ -38,175 +38,175 @@ |
||
38 | 38 | use Sabre\HTTP\ResponseInterface; |
39 | 39 | |
40 | 40 | class Plugin extends ServerPlugin { |
41 | - public const NS_OWNCLOUD = 'http://owncloud.org/ns'; |
|
42 | - public const NS_NEXTCLOUD = 'http://nextcloud.com/ns'; |
|
43 | - |
|
44 | - /** @var Auth */ |
|
45 | - private $auth; |
|
46 | - |
|
47 | - /** @var IRequest */ |
|
48 | - private $request; |
|
49 | - |
|
50 | - /** @var IConfig */ |
|
51 | - private $config; |
|
52 | - |
|
53 | - /** |
|
54 | - * Plugin constructor. |
|
55 | - * |
|
56 | - * @param Auth $authBackEnd |
|
57 | - * @param IRequest $request |
|
58 | - * @param IConfig $config |
|
59 | - */ |
|
60 | - public function __construct(Auth $authBackEnd, IRequest $request, IConfig $config) { |
|
61 | - $this->auth = $authBackEnd; |
|
62 | - $this->request = $request; |
|
63 | - $this->config = $config; |
|
64 | - } |
|
65 | - |
|
66 | - /** |
|
67 | - * Reference to SabreDAV server object. |
|
68 | - * |
|
69 | - * @var \Sabre\DAV\Server |
|
70 | - */ |
|
71 | - protected $server; |
|
72 | - |
|
73 | - /** |
|
74 | - * This method should return a list of server-features. |
|
75 | - * |
|
76 | - * This is for example 'versioning' and is added to the DAV: header |
|
77 | - * in an OPTIONS response. |
|
78 | - * |
|
79 | - * @return string[] |
|
80 | - */ |
|
81 | - public function getFeatures() { |
|
82 | - return ['oc-resource-sharing']; |
|
83 | - } |
|
84 | - |
|
85 | - /** |
|
86 | - * Returns a plugin name. |
|
87 | - * |
|
88 | - * Using this name other plugins will be able to access other plugins |
|
89 | - * using Sabre\DAV\Server::getPlugin |
|
90 | - * |
|
91 | - * @return string |
|
92 | - */ |
|
93 | - public function getPluginName() { |
|
94 | - return 'oc-resource-sharing'; |
|
95 | - } |
|
96 | - |
|
97 | - /** |
|
98 | - * This initializes the plugin. |
|
99 | - * |
|
100 | - * This function is called by Sabre\DAV\Server, after |
|
101 | - * addPlugin is called. |
|
102 | - * |
|
103 | - * This method should set up the required event subscriptions. |
|
104 | - * |
|
105 | - * @param Server $server |
|
106 | - * @return void |
|
107 | - */ |
|
108 | - public function initialize(Server $server) { |
|
109 | - $this->server = $server; |
|
110 | - $this->server->xml->elementMap['{' . Plugin::NS_OWNCLOUD . '}share'] = ShareRequest::class; |
|
111 | - $this->server->xml->elementMap['{' . Plugin::NS_OWNCLOUD . '}invite'] = Invite::class; |
|
112 | - |
|
113 | - $this->server->on('method:POST', [$this, 'httpPost']); |
|
114 | - $this->server->on('propFind', [$this, 'propFind']); |
|
115 | - } |
|
116 | - |
|
117 | - /** |
|
118 | - * We intercept this to handle POST requests on a dav resource. |
|
119 | - * |
|
120 | - * @param RequestInterface $request |
|
121 | - * @param ResponseInterface $response |
|
122 | - * @return null|false |
|
123 | - */ |
|
124 | - public function httpPost(RequestInterface $request, ResponseInterface $response) { |
|
125 | - $path = $request->getPath(); |
|
126 | - |
|
127 | - // Only handling xml |
|
128 | - $contentType = $request->getHeader('Content-Type'); |
|
129 | - if (strpos($contentType, 'application/xml') === false && strpos($contentType, 'text/xml') === false) { |
|
130 | - return; |
|
131 | - } |
|
132 | - |
|
133 | - // Making sure the node exists |
|
134 | - try { |
|
135 | - $node = $this->server->tree->getNodeForPath($path); |
|
136 | - } catch (NotFound $e) { |
|
137 | - return; |
|
138 | - } |
|
139 | - |
|
140 | - $requestBody = $request->getBodyAsString(); |
|
141 | - |
|
142 | - // If this request handler could not deal with this POST request, it |
|
143 | - // will return 'null' and other plugins get a chance to handle the |
|
144 | - // request. |
|
145 | - // |
|
146 | - // However, we already requested the full body. This is a problem, |
|
147 | - // because a body can only be read once. This is why we preemptively |
|
148 | - // re-populated the request body with the existing data. |
|
149 | - $request->setBody($requestBody); |
|
150 | - |
|
151 | - $message = $this->server->xml->parse($requestBody, $request->getUrl(), $documentType); |
|
152 | - |
|
153 | - switch ($documentType) { |
|
154 | - |
|
155 | - // Dealing with the 'share' document, which modified invitees on a |
|
156 | - // calendar. |
|
157 | - case '{' . self::NS_OWNCLOUD . '}share': |
|
158 | - |
|
159 | - // We can only deal with IShareableCalendar objects |
|
160 | - if (!$node instanceof IShareable) { |
|
161 | - return; |
|
162 | - } |
|
163 | - |
|
164 | - $this->server->transactionType = 'post-oc-resource-share'; |
|
165 | - |
|
166 | - // Getting ACL info |
|
167 | - $acl = $this->server->getPlugin('acl'); |
|
168 | - |
|
169 | - // If there's no ACL support, we allow everything |
|
170 | - if ($acl) { |
|
171 | - /** @var \Sabre\DAVACL\Plugin $acl */ |
|
172 | - $acl->checkPrivileges($path, '{DAV:}write'); |
|
173 | - |
|
174 | - $limitSharingToOwner = $this->config->getAppValue('dav', 'limitAddressBookAndCalendarSharingToOwner', 'no') === 'yes'; |
|
175 | - $isOwner = $acl->getCurrentUserPrincipal() === $node->getOwner(); |
|
176 | - if ($limitSharingToOwner && !$isOwner) { |
|
177 | - return; |
|
178 | - } |
|
179 | - } |
|
180 | - |
|
181 | - $node->updateShares($message->set, $message->remove); |
|
182 | - |
|
183 | - $response->setStatus(200); |
|
184 | - // Adding this because sending a response body may cause issues, |
|
185 | - // and I wanted some type of indicator the response was handled. |
|
186 | - $response->setHeader('X-Sabre-Status', 'everything-went-well'); |
|
187 | - |
|
188 | - // Breaking the event chain |
|
189 | - return false; |
|
190 | - } |
|
191 | - } |
|
192 | - |
|
193 | - /** |
|
194 | - * This event is triggered when properties are requested for a certain |
|
195 | - * node. |
|
196 | - * |
|
197 | - * This allows us to inject any properties early. |
|
198 | - * |
|
199 | - * @param PropFind $propFind |
|
200 | - * @param INode $node |
|
201 | - * @return void |
|
202 | - */ |
|
203 | - public function propFind(PropFind $propFind, INode $node) { |
|
204 | - if ($node instanceof IShareable) { |
|
205 | - $propFind->handle('{' . Plugin::NS_OWNCLOUD . '}invite', function () use ($node) { |
|
206 | - return new Invite( |
|
207 | - $node->getShares() |
|
208 | - ); |
|
209 | - }); |
|
210 | - } |
|
211 | - } |
|
41 | + public const NS_OWNCLOUD = 'http://owncloud.org/ns'; |
|
42 | + public const NS_NEXTCLOUD = 'http://nextcloud.com/ns'; |
|
43 | + |
|
44 | + /** @var Auth */ |
|
45 | + private $auth; |
|
46 | + |
|
47 | + /** @var IRequest */ |
|
48 | + private $request; |
|
49 | + |
|
50 | + /** @var IConfig */ |
|
51 | + private $config; |
|
52 | + |
|
53 | + /** |
|
54 | + * Plugin constructor. |
|
55 | + * |
|
56 | + * @param Auth $authBackEnd |
|
57 | + * @param IRequest $request |
|
58 | + * @param IConfig $config |
|
59 | + */ |
|
60 | + public function __construct(Auth $authBackEnd, IRequest $request, IConfig $config) { |
|
61 | + $this->auth = $authBackEnd; |
|
62 | + $this->request = $request; |
|
63 | + $this->config = $config; |
|
64 | + } |
|
65 | + |
|
66 | + /** |
|
67 | + * Reference to SabreDAV server object. |
|
68 | + * |
|
69 | + * @var \Sabre\DAV\Server |
|
70 | + */ |
|
71 | + protected $server; |
|
72 | + |
|
73 | + /** |
|
74 | + * This method should return a list of server-features. |
|
75 | + * |
|
76 | + * This is for example 'versioning' and is added to the DAV: header |
|
77 | + * in an OPTIONS response. |
|
78 | + * |
|
79 | + * @return string[] |
|
80 | + */ |
|
81 | + public function getFeatures() { |
|
82 | + return ['oc-resource-sharing']; |
|
83 | + } |
|
84 | + |
|
85 | + /** |
|
86 | + * Returns a plugin name. |
|
87 | + * |
|
88 | + * Using this name other plugins will be able to access other plugins |
|
89 | + * using Sabre\DAV\Server::getPlugin |
|
90 | + * |
|
91 | + * @return string |
|
92 | + */ |
|
93 | + public function getPluginName() { |
|
94 | + return 'oc-resource-sharing'; |
|
95 | + } |
|
96 | + |
|
97 | + /** |
|
98 | + * This initializes the plugin. |
|
99 | + * |
|
100 | + * This function is called by Sabre\DAV\Server, after |
|
101 | + * addPlugin is called. |
|
102 | + * |
|
103 | + * This method should set up the required event subscriptions. |
|
104 | + * |
|
105 | + * @param Server $server |
|
106 | + * @return void |
|
107 | + */ |
|
108 | + public function initialize(Server $server) { |
|
109 | + $this->server = $server; |
|
110 | + $this->server->xml->elementMap['{' . Plugin::NS_OWNCLOUD . '}share'] = ShareRequest::class; |
|
111 | + $this->server->xml->elementMap['{' . Plugin::NS_OWNCLOUD . '}invite'] = Invite::class; |
|
112 | + |
|
113 | + $this->server->on('method:POST', [$this, 'httpPost']); |
|
114 | + $this->server->on('propFind', [$this, 'propFind']); |
|
115 | + } |
|
116 | + |
|
117 | + /** |
|
118 | + * We intercept this to handle POST requests on a dav resource. |
|
119 | + * |
|
120 | + * @param RequestInterface $request |
|
121 | + * @param ResponseInterface $response |
|
122 | + * @return null|false |
|
123 | + */ |
|
124 | + public function httpPost(RequestInterface $request, ResponseInterface $response) { |
|
125 | + $path = $request->getPath(); |
|
126 | + |
|
127 | + // Only handling xml |
|
128 | + $contentType = $request->getHeader('Content-Type'); |
|
129 | + if (strpos($contentType, 'application/xml') === false && strpos($contentType, 'text/xml') === false) { |
|
130 | + return; |
|
131 | + } |
|
132 | + |
|
133 | + // Making sure the node exists |
|
134 | + try { |
|
135 | + $node = $this->server->tree->getNodeForPath($path); |
|
136 | + } catch (NotFound $e) { |
|
137 | + return; |
|
138 | + } |
|
139 | + |
|
140 | + $requestBody = $request->getBodyAsString(); |
|
141 | + |
|
142 | + // If this request handler could not deal with this POST request, it |
|
143 | + // will return 'null' and other plugins get a chance to handle the |
|
144 | + // request. |
|
145 | + // |
|
146 | + // However, we already requested the full body. This is a problem, |
|
147 | + // because a body can only be read once. This is why we preemptively |
|
148 | + // re-populated the request body with the existing data. |
|
149 | + $request->setBody($requestBody); |
|
150 | + |
|
151 | + $message = $this->server->xml->parse($requestBody, $request->getUrl(), $documentType); |
|
152 | + |
|
153 | + switch ($documentType) { |
|
154 | + |
|
155 | + // Dealing with the 'share' document, which modified invitees on a |
|
156 | + // calendar. |
|
157 | + case '{' . self::NS_OWNCLOUD . '}share': |
|
158 | + |
|
159 | + // We can only deal with IShareableCalendar objects |
|
160 | + if (!$node instanceof IShareable) { |
|
161 | + return; |
|
162 | + } |
|
163 | + |
|
164 | + $this->server->transactionType = 'post-oc-resource-share'; |
|
165 | + |
|
166 | + // Getting ACL info |
|
167 | + $acl = $this->server->getPlugin('acl'); |
|
168 | + |
|
169 | + // If there's no ACL support, we allow everything |
|
170 | + if ($acl) { |
|
171 | + /** @var \Sabre\DAVACL\Plugin $acl */ |
|
172 | + $acl->checkPrivileges($path, '{DAV:}write'); |
|
173 | + |
|
174 | + $limitSharingToOwner = $this->config->getAppValue('dav', 'limitAddressBookAndCalendarSharingToOwner', 'no') === 'yes'; |
|
175 | + $isOwner = $acl->getCurrentUserPrincipal() === $node->getOwner(); |
|
176 | + if ($limitSharingToOwner && !$isOwner) { |
|
177 | + return; |
|
178 | + } |
|
179 | + } |
|
180 | + |
|
181 | + $node->updateShares($message->set, $message->remove); |
|
182 | + |
|
183 | + $response->setStatus(200); |
|
184 | + // Adding this because sending a response body may cause issues, |
|
185 | + // and I wanted some type of indicator the response was handled. |
|
186 | + $response->setHeader('X-Sabre-Status', 'everything-went-well'); |
|
187 | + |
|
188 | + // Breaking the event chain |
|
189 | + return false; |
|
190 | + } |
|
191 | + } |
|
192 | + |
|
193 | + /** |
|
194 | + * This event is triggered when properties are requested for a certain |
|
195 | + * node. |
|
196 | + * |
|
197 | + * This allows us to inject any properties early. |
|
198 | + * |
|
199 | + * @param PropFind $propFind |
|
200 | + * @param INode $node |
|
201 | + * @return void |
|
202 | + */ |
|
203 | + public function propFind(PropFind $propFind, INode $node) { |
|
204 | + if ($node instanceof IShareable) { |
|
205 | + $propFind->handle('{' . Plugin::NS_OWNCLOUD . '}invite', function () use ($node) { |
|
206 | + return new Invite( |
|
207 | + $node->getShares() |
|
208 | + ); |
|
209 | + }); |
|
210 | + } |
|
211 | + } |
|
212 | 212 | } |
@@ -29,45 +29,45 @@ |
||
29 | 29 | |
30 | 30 | class DummyUserSession implements IUserSession { |
31 | 31 | |
32 | - /** |
|
33 | - * @var IUser |
|
34 | - */ |
|
35 | - private $user; |
|
32 | + /** |
|
33 | + * @var IUser |
|
34 | + */ |
|
35 | + private $user; |
|
36 | 36 | |
37 | - public function login($uid, $password) { |
|
38 | - } |
|
37 | + public function login($uid, $password) { |
|
38 | + } |
|
39 | 39 | |
40 | - public function logout() { |
|
41 | - } |
|
40 | + public function logout() { |
|
41 | + } |
|
42 | 42 | |
43 | - public function setUser($user) { |
|
44 | - $this->user = $user; |
|
45 | - } |
|
43 | + public function setUser($user) { |
|
44 | + $this->user = $user; |
|
45 | + } |
|
46 | 46 | |
47 | - public function getUser() { |
|
48 | - return $this->user; |
|
49 | - } |
|
47 | + public function getUser() { |
|
48 | + return $this->user; |
|
49 | + } |
|
50 | 50 | |
51 | - public function isLoggedIn() { |
|
52 | - return !is_null($this->user); |
|
53 | - } |
|
51 | + public function isLoggedIn() { |
|
52 | + return !is_null($this->user); |
|
53 | + } |
|
54 | 54 | |
55 | - /** |
|
56 | - * get getImpersonatingUserID |
|
57 | - * |
|
58 | - * @return string|null |
|
59 | - * @since 17.0.0 |
|
60 | - */ |
|
61 | - public function getImpersonatingUserID() : ?string { |
|
62 | - return null; |
|
63 | - } |
|
55 | + /** |
|
56 | + * get getImpersonatingUserID |
|
57 | + * |
|
58 | + * @return string|null |
|
59 | + * @since 17.0.0 |
|
60 | + */ |
|
61 | + public function getImpersonatingUserID() : ?string { |
|
62 | + return null; |
|
63 | + } |
|
64 | 64 | |
65 | - /** |
|
66 | - * set setImpersonatingUserID |
|
67 | - * |
|
68 | - * @since 17.0.0 |
|
69 | - */ |
|
70 | - public function setImpersonatingUserID(bool $useCurrentUser = true): void { |
|
71 | - //no OP |
|
72 | - } |
|
65 | + /** |
|
66 | + * set setImpersonatingUserID |
|
67 | + * |
|
68 | + * @since 17.0.0 |
|
69 | + */ |
|
70 | + public function setImpersonatingUserID(bool $useCurrentUser = true): void { |
|
71 | + //no OP |
|
72 | + } |
|
73 | 73 | } |
@@ -38,51 +38,51 @@ |
||
38 | 38 | * User provided Username and Password |
39 | 39 | */ |
40 | 40 | class UserProvided extends AuthMechanism implements IUserProvided { |
41 | - public const CREDENTIALS_IDENTIFIER_PREFIX = 'password::userprovided/'; |
|
41 | + public const CREDENTIALS_IDENTIFIER_PREFIX = 'password::userprovided/'; |
|
42 | 42 | |
43 | - /** @var ICredentialsManager */ |
|
44 | - protected $credentialsManager; |
|
43 | + /** @var ICredentialsManager */ |
|
44 | + protected $credentialsManager; |
|
45 | 45 | |
46 | - public function __construct(IL10N $l, ICredentialsManager $credentialsManager) { |
|
47 | - $this->credentialsManager = $credentialsManager; |
|
46 | + public function __construct(IL10N $l, ICredentialsManager $credentialsManager) { |
|
47 | + $this->credentialsManager = $credentialsManager; |
|
48 | 48 | |
49 | - $this |
|
50 | - ->setIdentifier('password::userprovided') |
|
51 | - ->setVisibility(BackendService::VISIBILITY_ADMIN) |
|
52 | - ->setScheme(self::SCHEME_PASSWORD) |
|
53 | - ->setText($l->t('User entered, store in database')) |
|
54 | - ->addParameters([ |
|
55 | - (new DefinitionParameter('user', $l->t('Username'))) |
|
56 | - ->setFlag(DefinitionParameter::FLAG_USER_PROVIDED), |
|
57 | - (new DefinitionParameter('password', $l->t('Password'))) |
|
58 | - ->setType(DefinitionParameter::VALUE_PASSWORD) |
|
59 | - ->setFlag(DefinitionParameter::FLAG_USER_PROVIDED), |
|
60 | - ]); |
|
61 | - } |
|
49 | + $this |
|
50 | + ->setIdentifier('password::userprovided') |
|
51 | + ->setVisibility(BackendService::VISIBILITY_ADMIN) |
|
52 | + ->setScheme(self::SCHEME_PASSWORD) |
|
53 | + ->setText($l->t('User entered, store in database')) |
|
54 | + ->addParameters([ |
|
55 | + (new DefinitionParameter('user', $l->t('Username'))) |
|
56 | + ->setFlag(DefinitionParameter::FLAG_USER_PROVIDED), |
|
57 | + (new DefinitionParameter('password', $l->t('Password'))) |
|
58 | + ->setType(DefinitionParameter::VALUE_PASSWORD) |
|
59 | + ->setFlag(DefinitionParameter::FLAG_USER_PROVIDED), |
|
60 | + ]); |
|
61 | + } |
|
62 | 62 | |
63 | - private function getCredentialsIdentifier($storageId) { |
|
64 | - return self::CREDENTIALS_IDENTIFIER_PREFIX . $storageId; |
|
65 | - } |
|
63 | + private function getCredentialsIdentifier($storageId) { |
|
64 | + return self::CREDENTIALS_IDENTIFIER_PREFIX . $storageId; |
|
65 | + } |
|
66 | 66 | |
67 | - public function saveBackendOptions(IUser $user, $mountId, array $options) { |
|
68 | - $this->credentialsManager->store($user->getUID(), $this->getCredentialsIdentifier($mountId), [ |
|
69 | - 'user' => $options['user'], // explicitly copy the fields we want instead of just passing the entire $options array |
|
70 | - 'password' => $options['password'] // this way we prevent users from being able to modify any other field |
|
71 | - ]); |
|
72 | - } |
|
67 | + public function saveBackendOptions(IUser $user, $mountId, array $options) { |
|
68 | + $this->credentialsManager->store($user->getUID(), $this->getCredentialsIdentifier($mountId), [ |
|
69 | + 'user' => $options['user'], // explicitly copy the fields we want instead of just passing the entire $options array |
|
70 | + 'password' => $options['password'] // this way we prevent users from being able to modify any other field |
|
71 | + ]); |
|
72 | + } |
|
73 | 73 | |
74 | - public function manipulateStorageConfig(StorageConfig &$storage, IUser $user = null) { |
|
75 | - if (!isset($user)) { |
|
76 | - throw new InsufficientDataForMeaningfulAnswerException('No credentials saved'); |
|
77 | - } |
|
78 | - $uid = $user->getUID(); |
|
79 | - $credentials = $this->credentialsManager->retrieve($uid, $this->getCredentialsIdentifier($storage->getId())); |
|
74 | + public function manipulateStorageConfig(StorageConfig &$storage, IUser $user = null) { |
|
75 | + if (!isset($user)) { |
|
76 | + throw new InsufficientDataForMeaningfulAnswerException('No credentials saved'); |
|
77 | + } |
|
78 | + $uid = $user->getUID(); |
|
79 | + $credentials = $this->credentialsManager->retrieve($uid, $this->getCredentialsIdentifier($storage->getId())); |
|
80 | 80 | |
81 | - if (!isset($credentials)) { |
|
82 | - throw new InsufficientDataForMeaningfulAnswerException('No credentials saved'); |
|
83 | - } |
|
81 | + if (!isset($credentials)) { |
|
82 | + throw new InsufficientDataForMeaningfulAnswerException('No credentials saved'); |
|
83 | + } |
|
84 | 84 | |
85 | - $storage->setBackendOption('user', $credentials['user']); |
|
86 | - $storage->setBackendOption('password', $credentials['password']); |
|
87 | - } |
|
85 | + $storage->setBackendOption('user', $credentials['user']); |
|
86 | + $storage->setBackendOption('password', $credentials['password']); |
|
87 | + } |
|
88 | 88 | } |
@@ -43,61 +43,61 @@ |
||
43 | 43 | * @since 6.0.0 |
44 | 44 | */ |
45 | 45 | interface IUserSession { |
46 | - /** |
|
47 | - * Do a user login |
|
48 | - * |
|
49 | - * @param string $uid the username |
|
50 | - * @param string $password the password |
|
51 | - * @return bool true if successful |
|
52 | - * @since 6.0.0 |
|
53 | - */ |
|
54 | - public function login($uid, $password); |
|
46 | + /** |
|
47 | + * Do a user login |
|
48 | + * |
|
49 | + * @param string $uid the username |
|
50 | + * @param string $password the password |
|
51 | + * @return bool true if successful |
|
52 | + * @since 6.0.0 |
|
53 | + */ |
|
54 | + public function login($uid, $password); |
|
55 | 55 | |
56 | - /** |
|
57 | - * Logs the user out including all the session data |
|
58 | - * Logout, destroys session |
|
59 | - * |
|
60 | - * @return void |
|
61 | - * @since 6.0.0 |
|
62 | - */ |
|
63 | - public function logout(); |
|
56 | + /** |
|
57 | + * Logs the user out including all the session data |
|
58 | + * Logout, destroys session |
|
59 | + * |
|
60 | + * @return void |
|
61 | + * @since 6.0.0 |
|
62 | + */ |
|
63 | + public function logout(); |
|
64 | 64 | |
65 | - /** |
|
66 | - * set the currently active user |
|
67 | - * |
|
68 | - * @param \OCP\IUser|null $user |
|
69 | - * @since 8.0.0 |
|
70 | - */ |
|
71 | - public function setUser($user); |
|
65 | + /** |
|
66 | + * set the currently active user |
|
67 | + * |
|
68 | + * @param \OCP\IUser|null $user |
|
69 | + * @since 8.0.0 |
|
70 | + */ |
|
71 | + public function setUser($user); |
|
72 | 72 | |
73 | - /** |
|
74 | - * get the current active user |
|
75 | - * |
|
76 | - * @return \OCP\IUser|null Current user, otherwise null |
|
77 | - * @since 8.0.0 |
|
78 | - */ |
|
79 | - public function getUser(); |
|
73 | + /** |
|
74 | + * get the current active user |
|
75 | + * |
|
76 | + * @return \OCP\IUser|null Current user, otherwise null |
|
77 | + * @since 8.0.0 |
|
78 | + */ |
|
79 | + public function getUser(); |
|
80 | 80 | |
81 | - /** |
|
82 | - * Checks whether the user is logged in |
|
83 | - * |
|
84 | - * @return bool if logged in |
|
85 | - * @since 8.0.0 |
|
86 | - */ |
|
87 | - public function isLoggedIn(); |
|
81 | + /** |
|
82 | + * Checks whether the user is logged in |
|
83 | + * |
|
84 | + * @return bool if logged in |
|
85 | + * @since 8.0.0 |
|
86 | + */ |
|
87 | + public function isLoggedIn(); |
|
88 | 88 | |
89 | - /** |
|
90 | - * get getImpersonatingUserID |
|
91 | - * |
|
92 | - * @return string|null |
|
93 | - * @since 18.0.0 |
|
94 | - */ |
|
95 | - public function getImpersonatingUserID(): ?string; |
|
89 | + /** |
|
90 | + * get getImpersonatingUserID |
|
91 | + * |
|
92 | + * @return string|null |
|
93 | + * @since 18.0.0 |
|
94 | + */ |
|
95 | + public function getImpersonatingUserID(): ?string; |
|
96 | 96 | |
97 | - /** |
|
98 | - * set setImpersonatingUserID |
|
99 | - * |
|
100 | - * @since 18.0.0 |
|
101 | - */ |
|
102 | - public function setImpersonatingUserID(bool $useCurrentUser = true): void; |
|
97 | + /** |
|
98 | + * set setImpersonatingUserID |
|
99 | + * |
|
100 | + * @since 18.0.0 |
|
101 | + */ |
|
102 | + public function setImpersonatingUserID(bool $useCurrentUser = true): void; |
|
103 | 103 | } |
@@ -34,67 +34,67 @@ |
||
34 | 34 | */ |
35 | 35 | class CardCreatedEvent extends Event { |
36 | 36 | |
37 | - /** @var int */ |
|
38 | - private $addressBookId; |
|
37 | + /** @var int */ |
|
38 | + private $addressBookId; |
|
39 | 39 | |
40 | - /** @var array */ |
|
41 | - private $addressBookData; |
|
40 | + /** @var array */ |
|
41 | + private $addressBookData; |
|
42 | 42 | |
43 | - /** @var array */ |
|
44 | - private $shares; |
|
43 | + /** @var array */ |
|
44 | + private $shares; |
|
45 | 45 | |
46 | - /** @var array */ |
|
47 | - private $cardData; |
|
46 | + /** @var array */ |
|
47 | + private $cardData; |
|
48 | 48 | |
49 | - /** |
|
50 | - * CardCreatedEvent constructor. |
|
51 | - * |
|
52 | - * @param int $addressBookId |
|
53 | - * @param array $addressBookData |
|
54 | - * @param array $shares |
|
55 | - * @param array $cardData |
|
56 | - * @since 20.0.0 |
|
57 | - */ |
|
58 | - public function __construct(int $addressBookId, |
|
59 | - array $addressBookData, |
|
60 | - array $shares, |
|
61 | - array $cardData) { |
|
62 | - parent::__construct(); |
|
63 | - $this->addressBookId = $addressBookId; |
|
64 | - $this->addressBookData = $addressBookData; |
|
65 | - $this->shares = $shares; |
|
66 | - $this->cardData = $cardData; |
|
67 | - } |
|
49 | + /** |
|
50 | + * CardCreatedEvent constructor. |
|
51 | + * |
|
52 | + * @param int $addressBookId |
|
53 | + * @param array $addressBookData |
|
54 | + * @param array $shares |
|
55 | + * @param array $cardData |
|
56 | + * @since 20.0.0 |
|
57 | + */ |
|
58 | + public function __construct(int $addressBookId, |
|
59 | + array $addressBookData, |
|
60 | + array $shares, |
|
61 | + array $cardData) { |
|
62 | + parent::__construct(); |
|
63 | + $this->addressBookId = $addressBookId; |
|
64 | + $this->addressBookData = $addressBookData; |
|
65 | + $this->shares = $shares; |
|
66 | + $this->cardData = $cardData; |
|
67 | + } |
|
68 | 68 | |
69 | - /** |
|
70 | - * @return int |
|
71 | - * @since 20.0.0 |
|
72 | - */ |
|
73 | - public function getAddressBookId(): int { |
|
74 | - return $this->addressBookId; |
|
75 | - } |
|
69 | + /** |
|
70 | + * @return int |
|
71 | + * @since 20.0.0 |
|
72 | + */ |
|
73 | + public function getAddressBookId(): int { |
|
74 | + return $this->addressBookId; |
|
75 | + } |
|
76 | 76 | |
77 | - /** |
|
78 | - * @return array |
|
79 | - * @since 20.0.0 |
|
80 | - */ |
|
81 | - public function getAddressBookData(): array { |
|
82 | - return $this->addressBookData; |
|
83 | - } |
|
77 | + /** |
|
78 | + * @return array |
|
79 | + * @since 20.0.0 |
|
80 | + */ |
|
81 | + public function getAddressBookData(): array { |
|
82 | + return $this->addressBookData; |
|
83 | + } |
|
84 | 84 | |
85 | - /** |
|
86 | - * @return array |
|
87 | - * @since 20.0.0 |
|
88 | - */ |
|
89 | - public function getShares(): array { |
|
90 | - return $this->shares; |
|
91 | - } |
|
85 | + /** |
|
86 | + * @return array |
|
87 | + * @since 20.0.0 |
|
88 | + */ |
|
89 | + public function getShares(): array { |
|
90 | + return $this->shares; |
|
91 | + } |
|
92 | 92 | |
93 | - /** |
|
94 | - * @return array |
|
95 | - * @since 20.0.0 |
|
96 | - */ |
|
97 | - public function getCardData(): array { |
|
98 | - return $this->cardData; |
|
99 | - } |
|
93 | + /** |
|
94 | + * @return array |
|
95 | + * @since 20.0.0 |
|
96 | + */ |
|
97 | + public function getCardData(): array { |
|
98 | + return $this->cardData; |
|
99 | + } |
|
100 | 100 | } |
@@ -34,67 +34,67 @@ |
||
34 | 34 | */ |
35 | 35 | class CalendarObjectUpdatedEvent extends Event { |
36 | 36 | |
37 | - /** @var int */ |
|
38 | - private $calendarId; |
|
37 | + /** @var int */ |
|
38 | + private $calendarId; |
|
39 | 39 | |
40 | - /** @var array */ |
|
41 | - private $calendarData; |
|
40 | + /** @var array */ |
|
41 | + private $calendarData; |
|
42 | 42 | |
43 | - /** @var array */ |
|
44 | - private $shares; |
|
43 | + /** @var array */ |
|
44 | + private $shares; |
|
45 | 45 | |
46 | - /** @var array */ |
|
47 | - private $objectData; |
|
46 | + /** @var array */ |
|
47 | + private $objectData; |
|
48 | 48 | |
49 | - /** |
|
50 | - * CalendarObjectUpdatedEvent constructor. |
|
51 | - * |
|
52 | - * @param int $calendarId |
|
53 | - * @param array $calendarData |
|
54 | - * @param array $shares |
|
55 | - * @param array $objectData |
|
56 | - * @since 20.0.0 |
|
57 | - */ |
|
58 | - public function __construct(int $calendarId, |
|
59 | - array $calendarData, |
|
60 | - array $shares, |
|
61 | - array $objectData) { |
|
62 | - parent::__construct(); |
|
63 | - $this->calendarId = $calendarId; |
|
64 | - $this->calendarData = $calendarData; |
|
65 | - $this->shares = $shares; |
|
66 | - $this->objectData = $objectData; |
|
67 | - } |
|
49 | + /** |
|
50 | + * CalendarObjectUpdatedEvent constructor. |
|
51 | + * |
|
52 | + * @param int $calendarId |
|
53 | + * @param array $calendarData |
|
54 | + * @param array $shares |
|
55 | + * @param array $objectData |
|
56 | + * @since 20.0.0 |
|
57 | + */ |
|
58 | + public function __construct(int $calendarId, |
|
59 | + array $calendarData, |
|
60 | + array $shares, |
|
61 | + array $objectData) { |
|
62 | + parent::__construct(); |
|
63 | + $this->calendarId = $calendarId; |
|
64 | + $this->calendarData = $calendarData; |
|
65 | + $this->shares = $shares; |
|
66 | + $this->objectData = $objectData; |
|
67 | + } |
|
68 | 68 | |
69 | - /** |
|
70 | - * @return int |
|
71 | - * @since 20.0.0 |
|
72 | - */ |
|
73 | - public function getCalendarId(): int { |
|
74 | - return $this->calendarId; |
|
75 | - } |
|
69 | + /** |
|
70 | + * @return int |
|
71 | + * @since 20.0.0 |
|
72 | + */ |
|
73 | + public function getCalendarId(): int { |
|
74 | + return $this->calendarId; |
|
75 | + } |
|
76 | 76 | |
77 | - /** |
|
78 | - * @return array |
|
79 | - * @since 20.0.0 |
|
80 | - */ |
|
81 | - public function getCalendarData(): array { |
|
82 | - return $this->calendarData; |
|
83 | - } |
|
77 | + /** |
|
78 | + * @return array |
|
79 | + * @since 20.0.0 |
|
80 | + */ |
|
81 | + public function getCalendarData(): array { |
|
82 | + return $this->calendarData; |
|
83 | + } |
|
84 | 84 | |
85 | - /** |
|
86 | - * @return array |
|
87 | - * @since 20.0.0 |
|
88 | - */ |
|
89 | - public function getShares(): array { |
|
90 | - return $this->shares; |
|
91 | - } |
|
85 | + /** |
|
86 | + * @return array |
|
87 | + * @since 20.0.0 |
|
88 | + */ |
|
89 | + public function getShares(): array { |
|
90 | + return $this->shares; |
|
91 | + } |
|
92 | 92 | |
93 | - /** |
|
94 | - * @return array |
|
95 | - * @since 20.0.0 |
|
96 | - */ |
|
97 | - public function getObjectData(): array { |
|
98 | - return $this->objectData; |
|
99 | - } |
|
93 | + /** |
|
94 | + * @return array |
|
95 | + * @since 20.0.0 |
|
96 | + */ |
|
97 | + public function getObjectData(): array { |
|
98 | + return $this->objectData; |
|
99 | + } |
|
100 | 100 | } |
@@ -34,53 +34,53 @@ |
||
34 | 34 | */ |
35 | 35 | class AddressBookDeletedEvent extends Event { |
36 | 36 | |
37 | - /** @var int */ |
|
38 | - private $addressBookId; |
|
37 | + /** @var int */ |
|
38 | + private $addressBookId; |
|
39 | 39 | |
40 | - /** @var array */ |
|
41 | - private $addressBookData; |
|
40 | + /** @var array */ |
|
41 | + private $addressBookData; |
|
42 | 42 | |
43 | - /** @var array */ |
|
44 | - private $shares; |
|
43 | + /** @var array */ |
|
44 | + private $shares; |
|
45 | 45 | |
46 | - /** |
|
47 | - * AddressBookDeletedEvent constructor. |
|
48 | - * |
|
49 | - * @param int $addressBookId |
|
50 | - * @param array $addressBookData |
|
51 | - * @param array $shares |
|
52 | - * @since 20.0.0 |
|
53 | - */ |
|
54 | - public function __construct(int $addressBookId, |
|
55 | - array $addressBookData, |
|
56 | - array $shares) { |
|
57 | - parent::__construct(); |
|
58 | - $this->addressBookId = $addressBookId; |
|
59 | - $this->addressBookData = $addressBookData; |
|
60 | - $this->shares = $shares; |
|
61 | - } |
|
46 | + /** |
|
47 | + * AddressBookDeletedEvent constructor. |
|
48 | + * |
|
49 | + * @param int $addressBookId |
|
50 | + * @param array $addressBookData |
|
51 | + * @param array $shares |
|
52 | + * @since 20.0.0 |
|
53 | + */ |
|
54 | + public function __construct(int $addressBookId, |
|
55 | + array $addressBookData, |
|
56 | + array $shares) { |
|
57 | + parent::__construct(); |
|
58 | + $this->addressBookId = $addressBookId; |
|
59 | + $this->addressBookData = $addressBookData; |
|
60 | + $this->shares = $shares; |
|
61 | + } |
|
62 | 62 | |
63 | - /** |
|
64 | - * @return int |
|
65 | - * @since 20.0.0 |
|
66 | - */ |
|
67 | - public function getAddressBookId():int { |
|
68 | - return $this->addressBookId; |
|
69 | - } |
|
63 | + /** |
|
64 | + * @return int |
|
65 | + * @since 20.0.0 |
|
66 | + */ |
|
67 | + public function getAddressBookId():int { |
|
68 | + return $this->addressBookId; |
|
69 | + } |
|
70 | 70 | |
71 | - /** |
|
72 | - * @return array |
|
73 | - * @since 20.0.0 |
|
74 | - */ |
|
75 | - public function getAddressBookData(): array { |
|
76 | - return $this->addressBookData; |
|
77 | - } |
|
71 | + /** |
|
72 | + * @return array |
|
73 | + * @since 20.0.0 |
|
74 | + */ |
|
75 | + public function getAddressBookData(): array { |
|
76 | + return $this->addressBookData; |
|
77 | + } |
|
78 | 78 | |
79 | - /** |
|
80 | - * @return array |
|
81 | - * @since 20.0.0 |
|
82 | - */ |
|
83 | - public function getShares(): array { |
|
84 | - return $this->shares; |
|
85 | - } |
|
79 | + /** |
|
80 | + * @return array |
|
81 | + * @since 20.0.0 |
|
82 | + */ |
|
83 | + public function getShares(): array { |
|
84 | + return $this->shares; |
|
85 | + } |
|
86 | 86 | } |
@@ -34,67 +34,67 @@ |
||
34 | 34 | */ |
35 | 35 | class CalendarObjectDeletedEvent extends Event { |
36 | 36 | |
37 | - /** @var int */ |
|
38 | - private $calendarId; |
|
37 | + /** @var int */ |
|
38 | + private $calendarId; |
|
39 | 39 | |
40 | - /** @var array */ |
|
41 | - private $calendarData; |
|
40 | + /** @var array */ |
|
41 | + private $calendarData; |
|
42 | 42 | |
43 | - /** @var array */ |
|
44 | - private $shares; |
|
43 | + /** @var array */ |
|
44 | + private $shares; |
|
45 | 45 | |
46 | - /** @var array */ |
|
47 | - private $objectData; |
|
46 | + /** @var array */ |
|
47 | + private $objectData; |
|
48 | 48 | |
49 | - /** |
|
50 | - * CalendarObjectDeletedEvent constructor. |
|
51 | - * |
|
52 | - * @param int $calendarId |
|
53 | - * @param array $calendarData |
|
54 | - * @param array $shares |
|
55 | - * @param array $objectData |
|
56 | - * @since 20.0.0 |
|
57 | - */ |
|
58 | - public function __construct(int $calendarId, |
|
59 | - array $calendarData, |
|
60 | - array $shares, |
|
61 | - array $objectData) { |
|
62 | - parent::__construct(); |
|
63 | - $this->calendarId = $calendarId; |
|
64 | - $this->calendarData = $calendarData; |
|
65 | - $this->shares = $shares; |
|
66 | - $this->objectData = $objectData; |
|
67 | - } |
|
49 | + /** |
|
50 | + * CalendarObjectDeletedEvent constructor. |
|
51 | + * |
|
52 | + * @param int $calendarId |
|
53 | + * @param array $calendarData |
|
54 | + * @param array $shares |
|
55 | + * @param array $objectData |
|
56 | + * @since 20.0.0 |
|
57 | + */ |
|
58 | + public function __construct(int $calendarId, |
|
59 | + array $calendarData, |
|
60 | + array $shares, |
|
61 | + array $objectData) { |
|
62 | + parent::__construct(); |
|
63 | + $this->calendarId = $calendarId; |
|
64 | + $this->calendarData = $calendarData; |
|
65 | + $this->shares = $shares; |
|
66 | + $this->objectData = $objectData; |
|
67 | + } |
|
68 | 68 | |
69 | - /** |
|
70 | - * @return int |
|
71 | - * @since 20.0.0 |
|
72 | - */ |
|
73 | - public function getCalendarId(): int { |
|
74 | - return $this->calendarId; |
|
75 | - } |
|
69 | + /** |
|
70 | + * @return int |
|
71 | + * @since 20.0.0 |
|
72 | + */ |
|
73 | + public function getCalendarId(): int { |
|
74 | + return $this->calendarId; |
|
75 | + } |
|
76 | 76 | |
77 | - /** |
|
78 | - * @return array |
|
79 | - * @since 20.0.0 |
|
80 | - */ |
|
81 | - public function getCalendarData(): array { |
|
82 | - return $this->calendarData; |
|
83 | - } |
|
77 | + /** |
|
78 | + * @return array |
|
79 | + * @since 20.0.0 |
|
80 | + */ |
|
81 | + public function getCalendarData(): array { |
|
82 | + return $this->calendarData; |
|
83 | + } |
|
84 | 84 | |
85 | - /** |
|
86 | - * @return array |
|
87 | - * @since 20.0.0 |
|
88 | - */ |
|
89 | - public function getShares(): array { |
|
90 | - return $this->shares; |
|
91 | - } |
|
85 | + /** |
|
86 | + * @return array |
|
87 | + * @since 20.0.0 |
|
88 | + */ |
|
89 | + public function getShares(): array { |
|
90 | + return $this->shares; |
|
91 | + } |
|
92 | 92 | |
93 | - /** |
|
94 | - * @return array |
|
95 | - * @since 20.0.0 |
|
96 | - */ |
|
97 | - public function getObjectData(): array { |
|
98 | - return $this->objectData; |
|
99 | - } |
|
93 | + /** |
|
94 | + * @return array |
|
95 | + * @since 20.0.0 |
|
96 | + */ |
|
97 | + public function getObjectData(): array { |
|
98 | + return $this->objectData; |
|
99 | + } |
|
100 | 100 | } |