Completed
Pull Request — stable9 (#4226)
by Lukas
11:11
created
lib/public/share.php 1 patch
Indentation   +348 added lines, -348 removed lines patch added patch discarded remove patch
@@ -51,352 +51,352 @@
 block discarded – undo
51 51
  */
52 52
 class Share extends \OC\Share\Constants {
53 53
 
54
-	/**
55
-	 * Register a sharing backend class that implements OCP\Share_Backend for an item type
56
-	 * @param string $itemType Item type
57
-	 * @param string $class Backend class
58
-	 * @param string $collectionOf (optional) Depends on item type
59
-	 * @param array $supportedFileExtensions (optional) List of supported file extensions if this item type depends on files
60
-	 * @return boolean true if backend is registered or false if error
61
-	 * @since 5.0.0
62
-	 */
63
-	public static function registerBackend($itemType, $class, $collectionOf = null, $supportedFileExtensions = null) {
64
-		return \OC\Share\Share::registerBackend($itemType, $class, $collectionOf, $supportedFileExtensions);
65
-	}
66
-
67
-	/**
68
-	 * Check if the Share API is enabled
69
-	 * @return boolean true if enabled or false
70
-	 *
71
-	 * The Share API is enabled by default if not configured
72
-	 * @since 5.0.0
73
-	 */
74
-	public static function isEnabled() {
75
-		return \OC\Share\Share::isEnabled();
76
-	}
77
-
78
-	/**
79
-	 * Find which users can access a shared item
80
-	 * @param string $path to the file
81
-	 * @param string $ownerUser owner of the file
82
-	 * @param bool $includeOwner include owner to the list of users with access to the file
83
-	 * @param bool $returnUserPaths Return an array with the user => path map
84
-	 * @param bool $recursive take parent folders into account
85
-	 * @return array
86
-	 * @note $path needs to be relative to user data dir, e.g. 'file.txt'
87
-	 *       not '/admin/files/file.txt'
88
-	 * @since 5.0.0 - $recursive was added in 9.0.0
89
-	 */
90
-	public static function getUsersSharingFile($path, $ownerUser, $includeOwner = false, $returnUserPaths = false, $recursive = true) {
91
-		return \OC\Share\Share::getUsersSharingFile($path, $ownerUser, $includeOwner, $returnUserPaths, $recursive);
92
-	}
93
-
94
-	/**
95
-	 * Get the items of item type shared with the current user
96
-	 * @param string $itemType
97
-	 * @param int $format (optional) Format type must be defined by the backend
98
-	 * @param mixed $parameters (optional)
99
-	 * @param int $limit Number of items to return (optional) Returns all by default
100
-	 * @param bool $includeCollections (optional)
101
-	 * @return mixed Return depends on format
102
-	 * @since 5.0.0
103
-	 */
104
-	public static function getItemsSharedWith($itemType, $format = self::FORMAT_NONE,
105
-		$parameters = null, $limit = -1, $includeCollections = false) {
106
-
107
-		return \OC\Share\Share::getItemsSharedWith($itemType, $format, $parameters, $limit, $includeCollections);
108
-	}
109
-
110
-	/**
111
-	 * Get the items of item type shared with a user
112
-	 * @param string $itemType
113
-	 * @param string $user for which user we want the shares
114
-	 * @param int $format (optional) Format type must be defined by the backend
115
-	 * @param mixed $parameters (optional)
116
-	 * @param int $limit Number of items to return (optional) Returns all by default
117
-	 * @param bool $includeCollections (optional)
118
-	 * @return mixed Return depends on format
119
-	 * @since 7.0.0
120
-	 */
121
-	public static function getItemsSharedWithUser($itemType, $user, $format = self::FORMAT_NONE,
122
-		$parameters = null, $limit = -1, $includeCollections = false) {
123
-
124
-		return \OC\Share\Share::getItemsSharedWithUser($itemType, $user, $format, $parameters, $limit, $includeCollections);
125
-	}
126
-
127
-	/**
128
-	 * Get the item of item type shared with the current user
129
-	 * @param string $itemType
130
-	 * @param string $itemTarget
131
-	 * @param int $format (optional) Format type must be defined by the backend
132
-	 * @param mixed $parameters (optional)
133
-	 * @param bool $includeCollections (optional)
134
-	 * @return mixed Return depends on format
135
-	 * @since 5.0.0
136
-	 */
137
-	public static function getItemSharedWith($itemType, $itemTarget, $format = self::FORMAT_NONE,
138
-		$parameters = null, $includeCollections = false) {
139
-
140
-		return \OC\Share\Share::getItemSharedWith($itemType, $itemTarget, $format, $parameters, $includeCollections);
141
-	}
142
-
143
-	/**
144
-	 * Get the item of item type shared with a given user by source
145
-	 * @param string $itemType
146
-	 * @param string $itemSource
147
-	 * @param string $user User to whom the item was shared
148
-	 * @param string $owner Owner of the share
149
-	 * @return array Return list of items with file_target, permissions and expiration
150
-	 * @since 6.0.0 - parameter $owner was added in 8.0.0
151
-	 */
152
-	public static function getItemSharedWithUser($itemType, $itemSource, $user, $owner = null) {
153
-		return \OC\Share\Share::getItemSharedWithUser($itemType, $itemSource, $user, $owner);
154
-	}
155
-
156
-	/**
157
-	 * Get the item of item type shared with the current user by source
158
-	 * @param string $itemType
159
-	 * @param string $itemSource
160
-	 * @param int $format (optional) Format type must be defined by the backend
161
-	 * @param mixed $parameters
162
-	 * @param bool $includeCollections
163
-	 * @return array
164
-	 * @since 5.0.0
165
-	 */
166
-	public static function getItemSharedWithBySource($itemType, $itemSource, $format = self::FORMAT_NONE,
167
-		$parameters = null, $includeCollections = false) {
168
-		return \OC\Share\Share::getItemSharedWithBySource($itemType, $itemSource, $format, $parameters, $includeCollections);
169
-	}
170
-
171
-	/**
172
-	 * Get the item of item type shared by a link
173
-	 * @param string $itemType
174
-	 * @param string $itemSource
175
-	 * @param string $uidOwner Owner of link
176
-	 * @return array
177
-	 * @since 5.0.0
178
-	 */
179
-	public static function getItemSharedWithByLink($itemType, $itemSource, $uidOwner) {
180
-		return \OC\Share\Share::getItemSharedWithByLink($itemType, $itemSource, $uidOwner);
181
-	}
182
-
183
-	/**
184
-	 * Based on the given token the share information will be returned - password protected shares will be verified
185
-	 * @param string $token
186
-	 * @param bool $checkPasswordProtection
187
-	 * @return array|bool false will be returned in case the token is unknown or unauthorized
188
-	 * @since 5.0.0 - parameter $checkPasswordProtection was added in 7.0.0
189
-	 */
190
-	public static function getShareByToken($token, $checkPasswordProtection = true) {
191
-		return \OC\Share\Share::getShareByToken($token, $checkPasswordProtection);
192
-	}
193
-
194
-	/**
195
-	 * resolves reshares down to the last real share
196
-	 * @param array $linkItem
197
-	 * @return array file owner
198
-	 * @since 6.0.0
199
-	 */
200
-	public static function resolveReShare($linkItem) {
201
-		return \OC\Share\Share::resolveReShare($linkItem);
202
-	}
203
-
204
-
205
-	/**
206
-	 * Get the shared items of item type owned by the current user
207
-	 * @param string $itemType
208
-	 * @param int $format (optional) Format type must be defined by the backend
209
-	 * @param mixed $parameters
210
-	 * @param int $limit Number of items to return (optional) Returns all by default
211
-	 * @param bool $includeCollections
212
-	 * @return mixed Return depends on format
213
-	 * @since 5.0.0
214
-	 */
215
-	public static function getItemsShared($itemType, $format = self::FORMAT_NONE, $parameters = null,
216
-		$limit = -1, $includeCollections = false) {
217
-
218
-		return \OC\Share\Share::getItemsShared($itemType, $format, $parameters, $limit, $includeCollections);
219
-	}
220
-
221
-	/**
222
-	 * Get the shared item of item type owned by the current user
223
-	 * @param string $itemType
224
-	 * @param string $itemSource
225
-	 * @param int $format (optional) Format type must be defined by the backend
226
-	 * @param mixed $parameters
227
-	 * @param bool $includeCollections
228
-	 * @return mixed Return depends on format
229
-	 * @since 5.0.0
230
-	 */
231
-	public static function getItemShared($itemType, $itemSource, $format = self::FORMAT_NONE,
232
-	                                     $parameters = null, $includeCollections = false) {
233
-
234
-		return \OC\Share\Share::getItemShared($itemType, $itemSource, $format, $parameters, $includeCollections);
235
-	}
236
-
237
-	/**
238
-	 * Get all users an item is shared with
239
-	 * @param string $itemType
240
-	 * @param string $itemSource
241
-	 * @param string $uidOwner
242
-	 * @param bool $includeCollections
243
-	 * @param bool $checkExpireDate
244
-	 * @return array Return array of users
245
-	 * @since 5.0.0 - parameter $checkExpireDate was added in 7.0.0
246
-	 */
247
-	public static function getUsersItemShared($itemType, $itemSource, $uidOwner, $includeCollections = false, $checkExpireDate = true) {
248
-		return \OC\Share\Share::getUsersItemShared($itemType, $itemSource, $uidOwner, $includeCollections, $checkExpireDate);
249
-	}
250
-
251
-	/**
252
-	 * Share an item with a user, group, or via private link
253
-	 * @param string $itemType
254
-	 * @param string $itemSource
255
-	 * @param int $shareType SHARE_TYPE_USER, SHARE_TYPE_GROUP, or SHARE_TYPE_LINK
256
-	 * @param string $shareWith User or group the item is being shared with
257
-	 * @param int $permissions CRUDS
258
-	 * @param string $itemSourceName
259
-	 * @param \DateTime $expirationDate
260
-	 * @param bool $passwordChanged
261
-	 * @return bool|string Returns true on success or false on failure, Returns token on success for links
262
-	 * @throws \OC\HintException when the share type is remote and the shareWith is invalid
263
-	 * @throws \Exception
264
-	 * @since 5.0.0 - parameter $itemSourceName was added in 6.0.0, parameter $expirationDate was added in 7.0.0, paramter $passwordChanged added in 9.0.0
265
-	 */
266
-	public static function shareItem($itemType, $itemSource, $shareType, $shareWith, $permissions, $itemSourceName = null, \DateTime $expirationDate = null, $passwordChanged = null) {
267
-		return \OC\Share\Share::shareItem($itemType, $itemSource, $shareType, $shareWith, $permissions, $itemSourceName, $expirationDate, $passwordChanged);
268
-	}
269
-
270
-	/**
271
-	 * Unshare an item from a user, group, or delete a private link
272
-	 * @param string $itemType
273
-	 * @param string $itemSource
274
-	 * @param int $shareType SHARE_TYPE_USER, SHARE_TYPE_GROUP, or SHARE_TYPE_LINK
275
-	 * @param string $shareWith User or group the item is being shared with
276
-	 * @param string $owner owner of the share, if null the current user is used
277
-	 * @return boolean true on success or false on failure
278
-	 * @since 5.0.0 - parameter $owner was added in 8.0.0
279
-	 */
280
-	public static function unshare($itemType, $itemSource, $shareType, $shareWith, $owner = null) {
281
-		return \OC\Share\Share::unshare($itemType, $itemSource, $shareType, $shareWith, $owner);
282
-	}
283
-
284
-	/**
285
-	 * Unshare an item from all users, groups, and remove all links
286
-	 * @param string $itemType
287
-	 * @param string $itemSource
288
-	 * @return boolean true on success or false on failure
289
-	 * @since 5.0.0
290
-	 */
291
-	public static function unshareAll($itemType, $itemSource) {
292
-		return \OC\Share\Share::unshareAll($itemType, $itemSource);
293
-	}
294
-
295
-	/**
296
-	 * Unshare an item shared with the current user
297
-	 * @param string $itemType
298
-	 * @param string $itemOrigin Item target or source
299
-	 * @param boolean $originIsSource true if $itemOrigin is the source, false if $itemOrigin is the target (optional)
300
-	 * @return boolean true on success or false on failure
301
-	 *
302
-	 * Unsharing from self is not allowed for items inside collections
303
-	 * @since 5.0.0 - parameter $originIsSource was added in 8.0.0
304
-	 */
305
-	public static function unshareFromSelf($itemType, $itemOrigin, $originIsSource = false) {
306
-		return \OC\Share\Share::unshareFromSelf($itemType, $itemOrigin, $originIsSource);
307
-	}
308
-
309
-	/**
310
-	 * sent status if users got informed by mail about share
311
-	 * @param string $itemType
312
-	 * @param string $itemSource
313
-	 * @param int $shareType SHARE_TYPE_USER, SHARE_TYPE_GROUP, or SHARE_TYPE_LINK
314
-	 * @param string $recipient with whom was the item shared
315
-	 * @param bool $status
316
-	 * @since 6.0.0 - parameter $originIsSource was added in 8.0.0
317
-	 */
318
-	public static function setSendMailStatus($itemType, $itemSource, $shareType, $recipient, $status) {
319
-		return \OC\Share\Share::setSendMailStatus($itemType, $itemSource, $shareType, $recipient, $status);
320
-	}
321
-
322
-	/**
323
-	 * Set the permissions of an item for a specific user or group
324
-	 * @param string $itemType
325
-	 * @param string $itemSource
326
-	 * @param int $shareType SHARE_TYPE_USER, SHARE_TYPE_GROUP, or SHARE_TYPE_LINK
327
-	 * @param string $shareWith User or group the item is being shared with
328
-	 * @param int $permissions CRUDS permissions
329
-	 * @return boolean true on success or false on failure
330
-	 * @since 5.0.0
331
-	 */
332
-	public static function setPermissions($itemType, $itemSource, $shareType, $shareWith, $permissions) {
333
-		return \OC\Share\Share::setPermissions($itemType, $itemSource, $shareType, $shareWith, $permissions);
334
-	}
335
-
336
-	/**
337
-	 * Set expiration date for a share
338
-	 * @param string $itemType
339
-	 * @param string $itemSource
340
-	 * @param string $date expiration date
341
-	 * @param int $shareTime timestamp from when the file was shared
342
-	 * @return boolean
343
-	 * @since 5.0.0 - parameter $shareTime was added in 8.0.0
344
-	 */
345
-	public static function setExpirationDate($itemType, $itemSource, $date, $shareTime = null) {
346
-		return \OC\Share\Share::setExpirationDate($itemType, $itemSource, $date, $shareTime);
347
-	}
348
-
349
-	/**
350
-	 * Set password for a public link share
351
-	 * @param int $shareId
352
-	 * @param string $password
353
-	 * @return boolean
354
-	 * @since 8.1.0
355
-	 */
356
-	public static function setPassword($shareId, $password) {
357
-		$userSession = \OC::$server->getUserSession();
358
-		$connection = \OC::$server->getDatabaseConnection();
359
-		$config = \OC::$server->getConfig();
360
-		return \OC\Share\Share::setPassword($userSession, $connection, $config, $shareId, $password);
361
-	}
362
-
363
-
364
-	/**
365
-	 * Get the backend class for the specified item type
366
-	 * @param string $itemType
367
-	 * @return Share_Backend
368
-	 * @since 5.0.0
369
-	 */
370
-	public static function getBackend($itemType) {
371
-		return \OC\Share\Share::getBackend($itemType);
372
-	}
373
-
374
-	/**
375
-	 * Delete all shares with type SHARE_TYPE_LINK
376
-	 * @since 6.0.0
377
-	 */
378
-	public static function removeAllLinkShares() {
379
-		return \OC\Share\Share::removeAllLinkShares();
380
-	}
381
-
382
-	/**
383
-	 * In case a password protected link is not yet authenticated this function will return false
384
-	 *
385
-	 * @param array $linkItem
386
-	 * @return bool
387
-	 * @since 7.0.0
388
-	 */
389
-	public static function checkPasswordProtectedShare(array $linkItem) {
390
-		return \OC\Share\Share::checkPasswordProtectedShare($linkItem);
391
-	}
392
-
393
-	/**
394
-	 * Check if resharing is allowed
395
-	 *
396
-	 * @return boolean true if allowed or false
397
-	 * @since 5.0.0
398
-	 */
399
-	public static function isResharingAllowed() {
400
-		return \OC\Share\Share::isResharingAllowed();
401
-	}
54
+    /**
55
+     * Register a sharing backend class that implements OCP\Share_Backend for an item type
56
+     * @param string $itemType Item type
57
+     * @param string $class Backend class
58
+     * @param string $collectionOf (optional) Depends on item type
59
+     * @param array $supportedFileExtensions (optional) List of supported file extensions if this item type depends on files
60
+     * @return boolean true if backend is registered or false if error
61
+     * @since 5.0.0
62
+     */
63
+    public static function registerBackend($itemType, $class, $collectionOf = null, $supportedFileExtensions = null) {
64
+        return \OC\Share\Share::registerBackend($itemType, $class, $collectionOf, $supportedFileExtensions);
65
+    }
66
+
67
+    /**
68
+     * Check if the Share API is enabled
69
+     * @return boolean true if enabled or false
70
+     *
71
+     * The Share API is enabled by default if not configured
72
+     * @since 5.0.0
73
+     */
74
+    public static function isEnabled() {
75
+        return \OC\Share\Share::isEnabled();
76
+    }
77
+
78
+    /**
79
+     * Find which users can access a shared item
80
+     * @param string $path to the file
81
+     * @param string $ownerUser owner of the file
82
+     * @param bool $includeOwner include owner to the list of users with access to the file
83
+     * @param bool $returnUserPaths Return an array with the user => path map
84
+     * @param bool $recursive take parent folders into account
85
+     * @return array
86
+     * @note $path needs to be relative to user data dir, e.g. 'file.txt'
87
+     *       not '/admin/files/file.txt'
88
+     * @since 5.0.0 - $recursive was added in 9.0.0
89
+     */
90
+    public static function getUsersSharingFile($path, $ownerUser, $includeOwner = false, $returnUserPaths = false, $recursive = true) {
91
+        return \OC\Share\Share::getUsersSharingFile($path, $ownerUser, $includeOwner, $returnUserPaths, $recursive);
92
+    }
93
+
94
+    /**
95
+     * Get the items of item type shared with the current user
96
+     * @param string $itemType
97
+     * @param int $format (optional) Format type must be defined by the backend
98
+     * @param mixed $parameters (optional)
99
+     * @param int $limit Number of items to return (optional) Returns all by default
100
+     * @param bool $includeCollections (optional)
101
+     * @return mixed Return depends on format
102
+     * @since 5.0.0
103
+     */
104
+    public static function getItemsSharedWith($itemType, $format = self::FORMAT_NONE,
105
+        $parameters = null, $limit = -1, $includeCollections = false) {
106
+
107
+        return \OC\Share\Share::getItemsSharedWith($itemType, $format, $parameters, $limit, $includeCollections);
108
+    }
109
+
110
+    /**
111
+     * Get the items of item type shared with a user
112
+     * @param string $itemType
113
+     * @param string $user for which user we want the shares
114
+     * @param int $format (optional) Format type must be defined by the backend
115
+     * @param mixed $parameters (optional)
116
+     * @param int $limit Number of items to return (optional) Returns all by default
117
+     * @param bool $includeCollections (optional)
118
+     * @return mixed Return depends on format
119
+     * @since 7.0.0
120
+     */
121
+    public static function getItemsSharedWithUser($itemType, $user, $format = self::FORMAT_NONE,
122
+        $parameters = null, $limit = -1, $includeCollections = false) {
123
+
124
+        return \OC\Share\Share::getItemsSharedWithUser($itemType, $user, $format, $parameters, $limit, $includeCollections);
125
+    }
126
+
127
+    /**
128
+     * Get the item of item type shared with the current user
129
+     * @param string $itemType
130
+     * @param string $itemTarget
131
+     * @param int $format (optional) Format type must be defined by the backend
132
+     * @param mixed $parameters (optional)
133
+     * @param bool $includeCollections (optional)
134
+     * @return mixed Return depends on format
135
+     * @since 5.0.0
136
+     */
137
+    public static function getItemSharedWith($itemType, $itemTarget, $format = self::FORMAT_NONE,
138
+        $parameters = null, $includeCollections = false) {
139
+
140
+        return \OC\Share\Share::getItemSharedWith($itemType, $itemTarget, $format, $parameters, $includeCollections);
141
+    }
142
+
143
+    /**
144
+     * Get the item of item type shared with a given user by source
145
+     * @param string $itemType
146
+     * @param string $itemSource
147
+     * @param string $user User to whom the item was shared
148
+     * @param string $owner Owner of the share
149
+     * @return array Return list of items with file_target, permissions and expiration
150
+     * @since 6.0.0 - parameter $owner was added in 8.0.0
151
+     */
152
+    public static function getItemSharedWithUser($itemType, $itemSource, $user, $owner = null) {
153
+        return \OC\Share\Share::getItemSharedWithUser($itemType, $itemSource, $user, $owner);
154
+    }
155
+
156
+    /**
157
+     * Get the item of item type shared with the current user by source
158
+     * @param string $itemType
159
+     * @param string $itemSource
160
+     * @param int $format (optional) Format type must be defined by the backend
161
+     * @param mixed $parameters
162
+     * @param bool $includeCollections
163
+     * @return array
164
+     * @since 5.0.0
165
+     */
166
+    public static function getItemSharedWithBySource($itemType, $itemSource, $format = self::FORMAT_NONE,
167
+        $parameters = null, $includeCollections = false) {
168
+        return \OC\Share\Share::getItemSharedWithBySource($itemType, $itemSource, $format, $parameters, $includeCollections);
169
+    }
170
+
171
+    /**
172
+     * Get the item of item type shared by a link
173
+     * @param string $itemType
174
+     * @param string $itemSource
175
+     * @param string $uidOwner Owner of link
176
+     * @return array
177
+     * @since 5.0.0
178
+     */
179
+    public static function getItemSharedWithByLink($itemType, $itemSource, $uidOwner) {
180
+        return \OC\Share\Share::getItemSharedWithByLink($itemType, $itemSource, $uidOwner);
181
+    }
182
+
183
+    /**
184
+     * Based on the given token the share information will be returned - password protected shares will be verified
185
+     * @param string $token
186
+     * @param bool $checkPasswordProtection
187
+     * @return array|bool false will be returned in case the token is unknown or unauthorized
188
+     * @since 5.0.0 - parameter $checkPasswordProtection was added in 7.0.0
189
+     */
190
+    public static function getShareByToken($token, $checkPasswordProtection = true) {
191
+        return \OC\Share\Share::getShareByToken($token, $checkPasswordProtection);
192
+    }
193
+
194
+    /**
195
+     * resolves reshares down to the last real share
196
+     * @param array $linkItem
197
+     * @return array file owner
198
+     * @since 6.0.0
199
+     */
200
+    public static function resolveReShare($linkItem) {
201
+        return \OC\Share\Share::resolveReShare($linkItem);
202
+    }
203
+
204
+
205
+    /**
206
+     * Get the shared items of item type owned by the current user
207
+     * @param string $itemType
208
+     * @param int $format (optional) Format type must be defined by the backend
209
+     * @param mixed $parameters
210
+     * @param int $limit Number of items to return (optional) Returns all by default
211
+     * @param bool $includeCollections
212
+     * @return mixed Return depends on format
213
+     * @since 5.0.0
214
+     */
215
+    public static function getItemsShared($itemType, $format = self::FORMAT_NONE, $parameters = null,
216
+        $limit = -1, $includeCollections = false) {
217
+
218
+        return \OC\Share\Share::getItemsShared($itemType, $format, $parameters, $limit, $includeCollections);
219
+    }
220
+
221
+    /**
222
+     * Get the shared item of item type owned by the current user
223
+     * @param string $itemType
224
+     * @param string $itemSource
225
+     * @param int $format (optional) Format type must be defined by the backend
226
+     * @param mixed $parameters
227
+     * @param bool $includeCollections
228
+     * @return mixed Return depends on format
229
+     * @since 5.0.0
230
+     */
231
+    public static function getItemShared($itemType, $itemSource, $format = self::FORMAT_NONE,
232
+                                            $parameters = null, $includeCollections = false) {
233
+
234
+        return \OC\Share\Share::getItemShared($itemType, $itemSource, $format, $parameters, $includeCollections);
235
+    }
236
+
237
+    /**
238
+     * Get all users an item is shared with
239
+     * @param string $itemType
240
+     * @param string $itemSource
241
+     * @param string $uidOwner
242
+     * @param bool $includeCollections
243
+     * @param bool $checkExpireDate
244
+     * @return array Return array of users
245
+     * @since 5.0.0 - parameter $checkExpireDate was added in 7.0.0
246
+     */
247
+    public static function getUsersItemShared($itemType, $itemSource, $uidOwner, $includeCollections = false, $checkExpireDate = true) {
248
+        return \OC\Share\Share::getUsersItemShared($itemType, $itemSource, $uidOwner, $includeCollections, $checkExpireDate);
249
+    }
250
+
251
+    /**
252
+     * Share an item with a user, group, or via private link
253
+     * @param string $itemType
254
+     * @param string $itemSource
255
+     * @param int $shareType SHARE_TYPE_USER, SHARE_TYPE_GROUP, or SHARE_TYPE_LINK
256
+     * @param string $shareWith User or group the item is being shared with
257
+     * @param int $permissions CRUDS
258
+     * @param string $itemSourceName
259
+     * @param \DateTime $expirationDate
260
+     * @param bool $passwordChanged
261
+     * @return bool|string Returns true on success or false on failure, Returns token on success for links
262
+     * @throws \OC\HintException when the share type is remote and the shareWith is invalid
263
+     * @throws \Exception
264
+     * @since 5.0.0 - parameter $itemSourceName was added in 6.0.0, parameter $expirationDate was added in 7.0.0, paramter $passwordChanged added in 9.0.0
265
+     */
266
+    public static function shareItem($itemType, $itemSource, $shareType, $shareWith, $permissions, $itemSourceName = null, \DateTime $expirationDate = null, $passwordChanged = null) {
267
+        return \OC\Share\Share::shareItem($itemType, $itemSource, $shareType, $shareWith, $permissions, $itemSourceName, $expirationDate, $passwordChanged);
268
+    }
269
+
270
+    /**
271
+     * Unshare an item from a user, group, or delete a private link
272
+     * @param string $itemType
273
+     * @param string $itemSource
274
+     * @param int $shareType SHARE_TYPE_USER, SHARE_TYPE_GROUP, or SHARE_TYPE_LINK
275
+     * @param string $shareWith User or group the item is being shared with
276
+     * @param string $owner owner of the share, if null the current user is used
277
+     * @return boolean true on success or false on failure
278
+     * @since 5.0.0 - parameter $owner was added in 8.0.0
279
+     */
280
+    public static function unshare($itemType, $itemSource, $shareType, $shareWith, $owner = null) {
281
+        return \OC\Share\Share::unshare($itemType, $itemSource, $shareType, $shareWith, $owner);
282
+    }
283
+
284
+    /**
285
+     * Unshare an item from all users, groups, and remove all links
286
+     * @param string $itemType
287
+     * @param string $itemSource
288
+     * @return boolean true on success or false on failure
289
+     * @since 5.0.0
290
+     */
291
+    public static function unshareAll($itemType, $itemSource) {
292
+        return \OC\Share\Share::unshareAll($itemType, $itemSource);
293
+    }
294
+
295
+    /**
296
+     * Unshare an item shared with the current user
297
+     * @param string $itemType
298
+     * @param string $itemOrigin Item target or source
299
+     * @param boolean $originIsSource true if $itemOrigin is the source, false if $itemOrigin is the target (optional)
300
+     * @return boolean true on success or false on failure
301
+     *
302
+     * Unsharing from self is not allowed for items inside collections
303
+     * @since 5.0.0 - parameter $originIsSource was added in 8.0.0
304
+     */
305
+    public static function unshareFromSelf($itemType, $itemOrigin, $originIsSource = false) {
306
+        return \OC\Share\Share::unshareFromSelf($itemType, $itemOrigin, $originIsSource);
307
+    }
308
+
309
+    /**
310
+     * sent status if users got informed by mail about share
311
+     * @param string $itemType
312
+     * @param string $itemSource
313
+     * @param int $shareType SHARE_TYPE_USER, SHARE_TYPE_GROUP, or SHARE_TYPE_LINK
314
+     * @param string $recipient with whom was the item shared
315
+     * @param bool $status
316
+     * @since 6.0.0 - parameter $originIsSource was added in 8.0.0
317
+     */
318
+    public static function setSendMailStatus($itemType, $itemSource, $shareType, $recipient, $status) {
319
+        return \OC\Share\Share::setSendMailStatus($itemType, $itemSource, $shareType, $recipient, $status);
320
+    }
321
+
322
+    /**
323
+     * Set the permissions of an item for a specific user or group
324
+     * @param string $itemType
325
+     * @param string $itemSource
326
+     * @param int $shareType SHARE_TYPE_USER, SHARE_TYPE_GROUP, or SHARE_TYPE_LINK
327
+     * @param string $shareWith User or group the item is being shared with
328
+     * @param int $permissions CRUDS permissions
329
+     * @return boolean true on success or false on failure
330
+     * @since 5.0.0
331
+     */
332
+    public static function setPermissions($itemType, $itemSource, $shareType, $shareWith, $permissions) {
333
+        return \OC\Share\Share::setPermissions($itemType, $itemSource, $shareType, $shareWith, $permissions);
334
+    }
335
+
336
+    /**
337
+     * Set expiration date for a share
338
+     * @param string $itemType
339
+     * @param string $itemSource
340
+     * @param string $date expiration date
341
+     * @param int $shareTime timestamp from when the file was shared
342
+     * @return boolean
343
+     * @since 5.0.0 - parameter $shareTime was added in 8.0.0
344
+     */
345
+    public static function setExpirationDate($itemType, $itemSource, $date, $shareTime = null) {
346
+        return \OC\Share\Share::setExpirationDate($itemType, $itemSource, $date, $shareTime);
347
+    }
348
+
349
+    /**
350
+     * Set password for a public link share
351
+     * @param int $shareId
352
+     * @param string $password
353
+     * @return boolean
354
+     * @since 8.1.0
355
+     */
356
+    public static function setPassword($shareId, $password) {
357
+        $userSession = \OC::$server->getUserSession();
358
+        $connection = \OC::$server->getDatabaseConnection();
359
+        $config = \OC::$server->getConfig();
360
+        return \OC\Share\Share::setPassword($userSession, $connection, $config, $shareId, $password);
361
+    }
362
+
363
+
364
+    /**
365
+     * Get the backend class for the specified item type
366
+     * @param string $itemType
367
+     * @return Share_Backend
368
+     * @since 5.0.0
369
+     */
370
+    public static function getBackend($itemType) {
371
+        return \OC\Share\Share::getBackend($itemType);
372
+    }
373
+
374
+    /**
375
+     * Delete all shares with type SHARE_TYPE_LINK
376
+     * @since 6.0.0
377
+     */
378
+    public static function removeAllLinkShares() {
379
+        return \OC\Share\Share::removeAllLinkShares();
380
+    }
381
+
382
+    /**
383
+     * In case a password protected link is not yet authenticated this function will return false
384
+     *
385
+     * @param array $linkItem
386
+     * @return bool
387
+     * @since 7.0.0
388
+     */
389
+    public static function checkPasswordProtectedShare(array $linkItem) {
390
+        return \OC\Share\Share::checkPasswordProtectedShare($linkItem);
391
+    }
392
+
393
+    /**
394
+     * Check if resharing is allowed
395
+     *
396
+     * @return boolean true if allowed or false
397
+     * @since 5.0.0
398
+     */
399
+    public static function isResharingAllowed() {
400
+        return \OC\Share\Share::isResharingAllowed();
401
+    }
402 402
 }
Please login to merge, or discard this patch.
lib/public/diagnostics/ieventlogger.php 1 patch
Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -30,35 +30,35 @@
 block discarded – undo
30 30
  * @since 8.0.0
31 31
  */
32 32
 interface IEventLogger {
33
-	/**
34
-	 * Mark the start of an event
35
-	 *
36
-	 * @param string $id
37
-	 * @param string $description
38
-	 * @since 8.0.0
39
-	 */
40
-	public function start($id, $description);
33
+    /**
34
+     * Mark the start of an event
35
+     *
36
+     * @param string $id
37
+     * @param string $description
38
+     * @since 8.0.0
39
+     */
40
+    public function start($id, $description);
41 41
 
42
-	/**
43
-	 * Mark the end of an event
44
-	 *
45
-	 * @param string $id
46
-	 * @since 8.0.0
47
-	 */
48
-	public function end($id);
42
+    /**
43
+     * Mark the end of an event
44
+     *
45
+     * @param string $id
46
+     * @since 8.0.0
47
+     */
48
+    public function end($id);
49 49
 
50
-	/**
51
-	 * @param string $id
52
-	 * @param string $description
53
-	 * @param float $start
54
-	 * @param float $end
55
-	 * @since 8.0.0
56
-	 */
57
-	public function log($id, $description, $start, $end);
50
+    /**
51
+     * @param string $id
52
+     * @param string $description
53
+     * @param float $start
54
+     * @param float $end
55
+     * @since 8.0.0
56
+     */
57
+    public function log($id, $description, $start, $end);
58 58
 
59
-	/**
60
-	 * @return \OCP\Diagnostics\IEvent[]
61
-	 * @since 8.0.0
62
-	 */
63
-	public function getEvents();
59
+    /**
60
+     * @return \OCP\Diagnostics\IEvent[]
61
+     * @since 8.0.0
62
+     */
63
+    public function getEvents();
64 64
 }
Please login to merge, or discard this patch.
lib/public/diagnostics/iquerylogger.php 1 patch
Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -32,23 +32,23 @@
 block discarded – undo
32 32
  * @since 8.0.0
33 33
  */
34 34
 interface IQueryLogger extends SQLLogger {
35
-	/**
36
-	 * @param string $sql
37
-	 * @param array $params
38
-	 * @param array $types
39
-	 * @since 8.0.0
40
-	 */
41
-	public function startQuery($sql, array $params = null, array $types = null);
35
+    /**
36
+     * @param string $sql
37
+     * @param array $params
38
+     * @param array $types
39
+     * @since 8.0.0
40
+     */
41
+    public function startQuery($sql, array $params = null, array $types = null);
42 42
 
43
-	/**
44
-	 * @return mixed
45
-	 * @since 8.0.0
46
-	 */
47
-	public function stopQuery();
43
+    /**
44
+     * @return mixed
45
+     * @since 8.0.0
46
+     */
47
+    public function stopQuery();
48 48
 
49
-	/**
50
-	 * @return \OCP\Diagnostics\IQuery[]
51
-	 * @since 8.0.0
52
-	 */
53
-	public function getQueries();
49
+    /**
50
+     * @return \OCP\Diagnostics\IQuery[]
51
+     * @since 8.0.0
52
+     */
53
+    public function getQueries();
54 54
 }
Please login to merge, or discard this patch.
lib/public/diagnostics/iquery.php 1 patch
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -30,21 +30,21 @@
 block discarded – undo
30 30
  * @since 8.0.0
31 31
  */
32 32
 interface IQuery {
33
-	/**
34
-	 * @return string
35
-	 * @since 8.0.0
36
-	 */
37
-	public function getSql();
33
+    /**
34
+     * @return string
35
+     * @since 8.0.0
36
+     */
37
+    public function getSql();
38 38
 
39
-	/**
40
-	 * @return array
41
-	 * @since 8.0.0
42
-	 */
43
-	public function getParams();
39
+    /**
40
+     * @return array
41
+     * @since 8.0.0
42
+     */
43
+    public function getParams();
44 44
 
45
-	/**
46
-	 * @return float
47
-	 * @since 8.0.0
48
-	 */
49
-	public function getDuration();
45
+    /**
46
+     * @return float
47
+     * @since 8.0.0
48
+     */
49
+    public function getDuration();
50 50
 }
Please login to merge, or discard this patch.
lib/public/diagnostics/ievent.php 1 patch
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -30,33 +30,33 @@
 block discarded – undo
30 30
  * @since 8.0.0
31 31
  */
32 32
 interface IEvent {
33
-	/**
34
-	 * @return string
35
-	 * @since 8.0.0
36
-	 */
37
-	public function getId();
33
+    /**
34
+     * @return string
35
+     * @since 8.0.0
36
+     */
37
+    public function getId();
38 38
 
39
-	/**
40
-	 * @return string
41
-	 * @since 8.0.0
42
-	 */
43
-	public function getDescription();
39
+    /**
40
+     * @return string
41
+     * @since 8.0.0
42
+     */
43
+    public function getDescription();
44 44
 
45
-	/**
46
-	 * @return float
47
-	 * @since 8.0.0
48
-	 */
49
-	public function getStart();
45
+    /**
46
+     * @return float
47
+     * @since 8.0.0
48
+     */
49
+    public function getStart();
50 50
 
51
-	/**
52
-	 * @return float
53
-	 * @since 8.0.0
54
-	 */
55
-	public function getEnd();
51
+    /**
52
+     * @return float
53
+     * @since 8.0.0
54
+     */
55
+    public function getEnd();
56 56
 
57
-	/**
58
-	 * @return float
59
-	 * @since 8.0.0
60
-	 */
61
-	public function getDuration();
57
+    /**
58
+     * @return float
59
+     * @since 8.0.0
60
+     */
61
+    public function getDuration();
62 62
 }
Please login to merge, or discard this patch.
lib/public/user.php 2 patches
Indentation   +100 added lines, -100 removed lines patch added patch discarded remove patch
@@ -45,112 +45,112 @@
 block discarded – undo
45 45
  * @since 5.0.0
46 46
  */
47 47
 class User {
48
-	/**
49
-	 * Get the user id of the user currently logged in.
50
-	 * @return string uid or false
51
-	 * @deprecated 8.0.0 Use \OC::$server->getUserSession()->getUser()->getUID()
52
-	 * @since 5.0.0
53
-	 */
54
-	public static function getUser() {
55
-		return \OC_User::getUser();
56
-	}
48
+    /**
49
+     * Get the user id of the user currently logged in.
50
+     * @return string uid or false
51
+     * @deprecated 8.0.0 Use \OC::$server->getUserSession()->getUser()->getUID()
52
+     * @since 5.0.0
53
+     */
54
+    public static function getUser() {
55
+        return \OC_User::getUser();
56
+    }
57 57
 
58
-	/**
59
-	 * Get a list of all users
60
-	 * @param string $search search pattern
61
-	 * @param int|null $limit
62
-	 * @param int|null $offset
63
-	 * @return array an array of all uids
64
-	 * @deprecated 8.1.0 use method search() of \OCP\IUserManager - \OC::$server->getUserManager()
65
-	 * @since 5.0.0
66
-	 */
67
-	public static function getUsers( $search = '', $limit = null, $offset = null ) {
68
-		return \OC_User::getUsers( $search, $limit, $offset );
69
-	}
58
+    /**
59
+     * Get a list of all users
60
+     * @param string $search search pattern
61
+     * @param int|null $limit
62
+     * @param int|null $offset
63
+     * @return array an array of all uids
64
+     * @deprecated 8.1.0 use method search() of \OCP\IUserManager - \OC::$server->getUserManager()
65
+     * @since 5.0.0
66
+     */
67
+    public static function getUsers( $search = '', $limit = null, $offset = null ) {
68
+        return \OC_User::getUsers( $search, $limit, $offset );
69
+    }
70 70
 
71
-	/**
72
-	 * Get the user display name of the user currently logged in.
73
-	 * @param string|null $user user id or null for current user
74
-	 * @return string display name
75
-	 * @deprecated 8.1.0 fetch \OCP\IUser (has getDisplayName()) by using method
76
-	 *                   get() of \OCP\IUserManager - \OC::$server->getUserManager()
77
-	 * @since 5.0.0
78
-	 */
79
-	public static function getDisplayName( $user = null ) {
80
-		return \OC_User::getDisplayName( $user );
81
-	}
71
+    /**
72
+     * Get the user display name of the user currently logged in.
73
+     * @param string|null $user user id or null for current user
74
+     * @return string display name
75
+     * @deprecated 8.1.0 fetch \OCP\IUser (has getDisplayName()) by using method
76
+     *                   get() of \OCP\IUserManager - \OC::$server->getUserManager()
77
+     * @since 5.0.0
78
+     */
79
+    public static function getDisplayName( $user = null ) {
80
+        return \OC_User::getDisplayName( $user );
81
+    }
82 82
 
83
-	/**
84
-	 * Get a list of all display names and user ids.
85
-	 * @param string $search search pattern
86
-	 * @param int|null $limit
87
-	 * @param int|null $offset
88
-	 * @return array an array of all display names (value) and the correspondig uids (key)
89
-	 * @deprecated 8.1.0 use method searchDisplayName() of \OCP\IUserManager - \OC::$server->getUserManager()
90
-	 * @since 5.0.0
91
-	 */
92
-	public static function getDisplayNames( $search = '', $limit = null, $offset = null ) {
93
-		return \OC_User::getDisplayNames( $search, $limit, $offset );
94
-	}
83
+    /**
84
+     * Get a list of all display names and user ids.
85
+     * @param string $search search pattern
86
+     * @param int|null $limit
87
+     * @param int|null $offset
88
+     * @return array an array of all display names (value) and the correspondig uids (key)
89
+     * @deprecated 8.1.0 use method searchDisplayName() of \OCP\IUserManager - \OC::$server->getUserManager()
90
+     * @since 5.0.0
91
+     */
92
+    public static function getDisplayNames( $search = '', $limit = null, $offset = null ) {
93
+        return \OC_User::getDisplayNames( $search, $limit, $offset );
94
+    }
95 95
 
96
-	/**
97
-	 * Check if the user is logged in
98
-	 * @return boolean
99
-	 * @since 5.0.0
100
-	 */
101
-	public static function isLoggedIn() {
102
-		return \OC_User::isLoggedIn();
103
-	}
96
+    /**
97
+     * Check if the user is logged in
98
+     * @return boolean
99
+     * @since 5.0.0
100
+     */
101
+    public static function isLoggedIn() {
102
+        return \OC_User::isLoggedIn();
103
+    }
104 104
 
105
-	/**
106
-	 * Check if a user exists
107
-	 * @param string $uid the username
108
-	 * @param string $excludingBackend (default none)
109
-	 * @return boolean
110
-	 * @deprecated 8.1.0 use method userExists() of \OCP\IUserManager - \OC::$server->getUserManager()
111
-	 * @since 5.0.0
112
-	 */
113
-	public static function userExists( $uid, $excludingBackend = null ) {
114
-		return \OC_User::userExists( $uid, $excludingBackend );
115
-	}
116
-	/**
117
-	 * Logs the user out including all the session data
118
-	 * Logout, destroys session
119
-	 * @deprecated 8.0.0 Use \OC::$server->getUserSession()->logout();
120
-	 * @since 5.0.0
121
-	 */
122
-	public static function logout() {
123
-		\OC_User::logout();
124
-	}
105
+    /**
106
+     * Check if a user exists
107
+     * @param string $uid the username
108
+     * @param string $excludingBackend (default none)
109
+     * @return boolean
110
+     * @deprecated 8.1.0 use method userExists() of \OCP\IUserManager - \OC::$server->getUserManager()
111
+     * @since 5.0.0
112
+     */
113
+    public static function userExists( $uid, $excludingBackend = null ) {
114
+        return \OC_User::userExists( $uid, $excludingBackend );
115
+    }
116
+    /**
117
+     * Logs the user out including all the session data
118
+     * Logout, destroys session
119
+     * @deprecated 8.0.0 Use \OC::$server->getUserSession()->logout();
120
+     * @since 5.0.0
121
+     */
122
+    public static function logout() {
123
+        \OC_User::logout();
124
+    }
125 125
 
126
-	/**
127
-	 * Check if the password is correct
128
-	 * @param string $uid The username
129
-	 * @param string $password The password
130
-	 * @return string|false username on success, false otherwise
131
-	 *
132
-	 * Check if the password is correct without logging in the user
133
-	 * @deprecated 8.0.0 Use \OC::$server->getUserManager()->checkPassword();
134
-	 * @since 5.0.0
135
-	 */
136
-	public static function checkPassword( $uid, $password ) {
137
-		return \OC_User::checkPassword( $uid, $password );
138
-	}
126
+    /**
127
+     * Check if the password is correct
128
+     * @param string $uid The username
129
+     * @param string $password The password
130
+     * @return string|false username on success, false otherwise
131
+     *
132
+     * Check if the password is correct without logging in the user
133
+     * @deprecated 8.0.0 Use \OC::$server->getUserManager()->checkPassword();
134
+     * @since 5.0.0
135
+     */
136
+    public static function checkPassword( $uid, $password ) {
137
+        return \OC_User::checkPassword( $uid, $password );
138
+    }
139 139
 
140
-	/**
141
-	 * Check if the user is a admin, redirects to home if not
142
-	 * @since 5.0.0
143
-	 */
144
-	public static function checkAdminUser() {
145
-		\OC_Util::checkAdminUser();
146
-	}
140
+    /**
141
+     * Check if the user is a admin, redirects to home if not
142
+     * @since 5.0.0
143
+     */
144
+    public static function checkAdminUser() {
145
+        \OC_Util::checkAdminUser();
146
+    }
147 147
 
148
-	/**
149
-	 * Check if the user is logged in, redirects to home if not. With
150
-	 * redirect URL parameter to the request URI.
151
-	 * @since 5.0.0
152
-	 */
153
-	public static function checkLoggedIn() {
154
-		\OC_Util::checkLoggedIn();
155
-	}
148
+    /**
149
+     * Check if the user is logged in, redirects to home if not. With
150
+     * redirect URL parameter to the request URI.
151
+     * @since 5.0.0
152
+     */
153
+    public static function checkLoggedIn() {
154
+        \OC_Util::checkLoggedIn();
155
+    }
156 156
 }
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -65,8 +65,8 @@  discard block
 block discarded – undo
65 65
 	 * @deprecated 8.1.0 use method search() of \OCP\IUserManager - \OC::$server->getUserManager()
66 66
 	 * @since 5.0.0
67 67
 	 */
68
-	public static function getUsers( $search = '', $limit = null, $offset = null ) {
69
-		return \OC_User::getUsers( $search, $limit, $offset );
68
+	public static function getUsers($search = '', $limit = null, $offset = null) {
69
+		return \OC_User::getUsers($search, $limit, $offset);
70 70
 	}
71 71
 
72 72
 	/**
@@ -77,8 +77,8 @@  discard block
 block discarded – undo
77 77
 	 *                   get() of \OCP\IUserManager - \OC::$server->getUserManager()
78 78
 	 * @since 5.0.0
79 79
 	 */
80
-	public static function getDisplayName( $user = null ) {
81
-		return \OC_User::getDisplayName( $user );
80
+	public static function getDisplayName($user = null) {
81
+		return \OC_User::getDisplayName($user);
82 82
 	}
83 83
 
84 84
 	/**
@@ -90,8 +90,8 @@  discard block
 block discarded – undo
90 90
 	 * @deprecated 8.1.0 use method searchDisplayName() of \OCP\IUserManager - \OC::$server->getUserManager()
91 91
 	 * @since 5.0.0
92 92
 	 */
93
-	public static function getDisplayNames( $search = '', $limit = null, $offset = null ) {
94
-		return \OC_User::getDisplayNames( $search, $limit, $offset );
93
+	public static function getDisplayNames($search = '', $limit = null, $offset = null) {
94
+		return \OC_User::getDisplayNames($search, $limit, $offset);
95 95
 	}
96 96
 
97 97
 	/**
@@ -111,8 +111,8 @@  discard block
 block discarded – undo
111 111
 	 * @deprecated 8.1.0 use method userExists() of \OCP\IUserManager - \OC::$server->getUserManager()
112 112
 	 * @since 5.0.0
113 113
 	 */
114
-	public static function userExists( $uid, $excludingBackend = null ) {
115
-		return \OC_User::userExists( $uid, $excludingBackend );
114
+	public static function userExists($uid, $excludingBackend = null) {
115
+		return \OC_User::userExists($uid, $excludingBackend);
116 116
 	}
117 117
 	/**
118 118
 	 * Logs the user out including all the session data
@@ -134,8 +134,8 @@  discard block
 block discarded – undo
134 134
 	 * @deprecated 8.0.0 Use \OC::$server->getUserManager()->checkPassword();
135 135
 	 * @since 5.0.0
136 136
 	 */
137
-	public static function checkPassword( $uid, $password ) {
138
-		return \OC_User::checkPassword( $uid, $password );
137
+	public static function checkPassword($uid, $password) {
138
+		return \OC_User::checkPassword($uid, $password);
139 139
 	}
140 140
 
141 141
 	/**
Please login to merge, or discard this patch.
lib/public/irequest.php 1 patch
Indentation   +174 added lines, -174 removed lines patch added patch discarded remove patch
@@ -63,202 +63,202 @@
 block discarded – undo
63 63
  */
64 64
 interface IRequest {
65 65
 
66
-	/**
67
-	 * @param string $name
68
-	 *
69
-	 * @return string
70
-	 * @since 6.0.0
71
-	 */
72
-	public function getHeader($name);
66
+    /**
67
+     * @param string $name
68
+     *
69
+     * @return string
70
+     * @since 6.0.0
71
+     */
72
+    public function getHeader($name);
73 73
 
74
-	/**
75
-	 * Lets you access post and get parameters by the index
76
-	 * In case of json requests the encoded json body is accessed
77
-	 *
78
-	 * @param string $key the key which you want to access in the URL Parameter
79
-	 *                     placeholder, $_POST or $_GET array.
80
-	 *                     The priority how they're returned is the following:
81
-	 *                     1. URL parameters
82
-	 *                     2. POST parameters
83
-	 *                     3. GET parameters
84
-	 * @param mixed $default If the key is not found, this value will be returned
85
-	 * @return mixed the content of the array
86
-	 * @since 6.0.0
87
-	 */
88
-	public function getParam($key, $default = null);
74
+    /**
75
+     * Lets you access post and get parameters by the index
76
+     * In case of json requests the encoded json body is accessed
77
+     *
78
+     * @param string $key the key which you want to access in the URL Parameter
79
+     *                     placeholder, $_POST or $_GET array.
80
+     *                     The priority how they're returned is the following:
81
+     *                     1. URL parameters
82
+     *                     2. POST parameters
83
+     *                     3. GET parameters
84
+     * @param mixed $default If the key is not found, this value will be returned
85
+     * @return mixed the content of the array
86
+     * @since 6.0.0
87
+     */
88
+    public function getParam($key, $default = null);
89 89
 
90 90
 
91
-	/**
92
-	 * Returns all params that were received, be it from the request
93
-	 *
94
-	 * (as GET or POST) or through the URL by the route
95
-	 *
96
-	 * @return array the array with all parameters
97
-	 * @since 6.0.0
98
-	 */
99
-	public function getParams();
91
+    /**
92
+     * Returns all params that were received, be it from the request
93
+     *
94
+     * (as GET or POST) or through the URL by the route
95
+     *
96
+     * @return array the array with all parameters
97
+     * @since 6.0.0
98
+     */
99
+    public function getParams();
100 100
 
101
-	/**
102
-	 * Returns the method of the request
103
-	 *
104
-	 * @return string the method of the request (POST, GET, etc)
105
-	 * @since 6.0.0
106
-	 */
107
-	public function getMethod();
101
+    /**
102
+     * Returns the method of the request
103
+     *
104
+     * @return string the method of the request (POST, GET, etc)
105
+     * @since 6.0.0
106
+     */
107
+    public function getMethod();
108 108
 
109
-	/**
110
-	 * Shortcut for accessing an uploaded file through the $_FILES array
111
-	 *
112
-	 * @param string $key the key that will be taken from the $_FILES array
113
-	 * @return array the file in the $_FILES element
114
-	 * @since 6.0.0
115
-	 */
116
-	public function getUploadedFile($key);
109
+    /**
110
+     * Shortcut for accessing an uploaded file through the $_FILES array
111
+     *
112
+     * @param string $key the key that will be taken from the $_FILES array
113
+     * @return array the file in the $_FILES element
114
+     * @since 6.0.0
115
+     */
116
+    public function getUploadedFile($key);
117 117
 
118 118
 
119
-	/**
120
-	 * Shortcut for getting env variables
121
-	 *
122
-	 * @param string $key the key that will be taken from the $_ENV array
123
-	 * @return array the value in the $_ENV element
124
-	 * @since 6.0.0
125
-	 */
126
-	public function getEnv($key);
119
+    /**
120
+     * Shortcut for getting env variables
121
+     *
122
+     * @param string $key the key that will be taken from the $_ENV array
123
+     * @return array the value in the $_ENV element
124
+     * @since 6.0.0
125
+     */
126
+    public function getEnv($key);
127 127
 
128 128
 
129
-	/**
130
-	 * Shortcut for getting cookie variables
131
-	 *
132
-	 * @param string $key the key that will be taken from the $_COOKIE array
133
-	 * @return array the value in the $_COOKIE element
134
-	 * @since 6.0.0
135
-	 */
136
-	public function getCookie($key);
129
+    /**
130
+     * Shortcut for getting cookie variables
131
+     *
132
+     * @param string $key the key that will be taken from the $_COOKIE array
133
+     * @return array the value in the $_COOKIE element
134
+     * @since 6.0.0
135
+     */
136
+    public function getCookie($key);
137 137
 
138 138
 
139
-	/**
140
-	 * Checks if the CSRF check was correct
141
-	 *
142
-	 * @return bool true if CSRF check passed
143
-	 * @since 6.0.0
144
-	 */
145
-	public function passesCSRFCheck();
139
+    /**
140
+     * Checks if the CSRF check was correct
141
+     *
142
+     * @return bool true if CSRF check passed
143
+     * @since 6.0.0
144
+     */
145
+    public function passesCSRFCheck();
146 146
 
147
-	/**
148
-	 * Checks if the strict cookie has been sent with the request if the request
149
-	 * is including any cookies.
150
-	 *
151
-	 * @return bool
152
-	 * @since 9.0.0
153
-	 */
154
-	public function passesStrictCookieCheck();
147
+    /**
148
+     * Checks if the strict cookie has been sent with the request if the request
149
+     * is including any cookies.
150
+     *
151
+     * @return bool
152
+     * @since 9.0.0
153
+     */
154
+    public function passesStrictCookieCheck();
155 155
 
156
-	/**
157
-	 * Checks if the lax cookie has been sent with the request if the request
158
-	 * is including any cookies.
159
-	 *
160
-	 * @return bool
161
-	 * @since 9.0.0
162
-	 */
163
-	public function passesLaxCookieCheck();
156
+    /**
157
+     * Checks if the lax cookie has been sent with the request if the request
158
+     * is including any cookies.
159
+     *
160
+     * @return bool
161
+     * @since 9.0.0
162
+     */
163
+    public function passesLaxCookieCheck();
164 164
 
165
-	/**
166
-	 * Returns an ID for the request, value is not guaranteed to be unique and is mostly meant for logging
167
-	 * If `mod_unique_id` is installed this value will be taken.
168
-	 *
169
-	 * @return string
170
-	 * @since 8.1.0
171
-	 */
172
-	public function getId();
165
+    /**
166
+     * Returns an ID for the request, value is not guaranteed to be unique and is mostly meant for logging
167
+     * If `mod_unique_id` is installed this value will be taken.
168
+     *
169
+     * @return string
170
+     * @since 8.1.0
171
+     */
172
+    public function getId();
173 173
 
174
-	/**
175
-	 * Returns the remote address, if the connection came from a trusted proxy
176
-	 * and `forwarded_for_headers` has been configured then the IP address
177
-	 * specified in this header will be returned instead.
178
-	 * Do always use this instead of $_SERVER['REMOTE_ADDR']
179
-	 *
180
-	 * @return string IP address
181
-	 * @since 8.1.0
182
-	 */
183
-	public function getRemoteAddress();
174
+    /**
175
+     * Returns the remote address, if the connection came from a trusted proxy
176
+     * and `forwarded_for_headers` has been configured then the IP address
177
+     * specified in this header will be returned instead.
178
+     * Do always use this instead of $_SERVER['REMOTE_ADDR']
179
+     *
180
+     * @return string IP address
181
+     * @since 8.1.0
182
+     */
183
+    public function getRemoteAddress();
184 184
 
185
-	/**
186
-	 * Returns the server protocol. It respects reverse proxy servers and load
187
-	 * balancers.
188
-	 *
189
-	 * @return string Server protocol (http or https)
190
-	 * @since 8.1.0
191
-	 */
192
-	public function getServerProtocol();
185
+    /**
186
+     * Returns the server protocol. It respects reverse proxy servers and load
187
+     * balancers.
188
+     *
189
+     * @return string Server protocol (http or https)
190
+     * @since 8.1.0
191
+     */
192
+    public function getServerProtocol();
193 193
 
194
-	/**
195
-	 * Returns the used HTTP protocol.
196
-	 *
197
-	 * @return string HTTP protocol. HTTP/2, HTTP/1.1 or HTTP/1.0.
198
-	 * @since 8.2.0
199
-	 */
200
-	public function getHttpProtocol();
194
+    /**
195
+     * Returns the used HTTP protocol.
196
+     *
197
+     * @return string HTTP protocol. HTTP/2, HTTP/1.1 or HTTP/1.0.
198
+     * @since 8.2.0
199
+     */
200
+    public function getHttpProtocol();
201 201
 
202
-	/**
203
-	 * Returns the request uri, even if the website uses one or more
204
-	 * reverse proxies
205
-	 *
206
-	 * @return string
207
-	 * @since 8.1.0
208
-	 */
209
-	public function getRequestUri();
202
+    /**
203
+     * Returns the request uri, even if the website uses one or more
204
+     * reverse proxies
205
+     *
206
+     * @return string
207
+     * @since 8.1.0
208
+     */
209
+    public function getRequestUri();
210 210
 
211
-	/**
212
-	 * Get raw PathInfo from request (not urldecoded)
213
-	 *
214
-	 * @throws \Exception
215
-	 * @return string Path info
216
-	 * @since 8.1.0
217
-	 */
218
-	public function getRawPathInfo();
211
+    /**
212
+     * Get raw PathInfo from request (not urldecoded)
213
+     *
214
+     * @throws \Exception
215
+     * @return string Path info
216
+     * @since 8.1.0
217
+     */
218
+    public function getRawPathInfo();
219 219
 
220
-	/**
221
-	 * Get PathInfo from request
222
-	 *
223
-	 * @throws \Exception
224
-	 * @return string|false Path info or false when not found
225
-	 * @since 8.1.0
226
-	 */
227
-	public function getPathInfo();
220
+    /**
221
+     * Get PathInfo from request
222
+     *
223
+     * @throws \Exception
224
+     * @return string|false Path info or false when not found
225
+     * @since 8.1.0
226
+     */
227
+    public function getPathInfo();
228 228
 
229
-	/**
230
-	 * Returns the script name, even if the website uses one or more
231
-	 * reverse proxies
232
-	 *
233
-	 * @return string the script name
234
-	 * @since 8.1.0
235
-	 */
236
-	public function getScriptName();
229
+    /**
230
+     * Returns the script name, even if the website uses one or more
231
+     * reverse proxies
232
+     *
233
+     * @return string the script name
234
+     * @since 8.1.0
235
+     */
236
+    public function getScriptName();
237 237
 
238
-	/**
239
-	 * Checks whether the user agent matches a given regex
240
-	 *
241
-	 * @param array $agent array of agent names
242
-	 * @return bool true if at least one of the given agent matches, false otherwise
243
-	 * @since 8.1.0
244
-	 */
245
-	public function isUserAgent(array $agent);
238
+    /**
239
+     * Checks whether the user agent matches a given regex
240
+     *
241
+     * @param array $agent array of agent names
242
+     * @return bool true if at least one of the given agent matches, false otherwise
243
+     * @since 8.1.0
244
+     */
245
+    public function isUserAgent(array $agent);
246 246
 
247
-	/**
248
-	 * Returns the unverified server host from the headers without checking
249
-	 * whether it is a trusted domain
250
-	 *
251
-	 * @return string Server host
252
-	 * @since 8.1.0
253
-	 */
254
-	public function getInsecureServerHost();
247
+    /**
248
+     * Returns the unverified server host from the headers without checking
249
+     * whether it is a trusted domain
250
+     *
251
+     * @return string Server host
252
+     * @since 8.1.0
253
+     */
254
+    public function getInsecureServerHost();
255 255
 
256
-	/**
257
-	 * Returns the server host from the headers, or the first configured
258
-	 * trusted domain if the host isn't in the trusted list
259
-	 *
260
-	 * @return string Server host
261
-	 * @since 8.1.0
262
-	 */
263
-	public function getServerHost();
256
+    /**
257
+     * Returns the server host from the headers, or the first configured
258
+     * trusted domain if the host isn't in the trusted list
259
+     *
260
+     * @return string Server host
261
+     * @since 8.1.0
262
+     */
263
+    public function getServerHost();
264 264
 }
Please login to merge, or discard this patch.
lib/public/inavigationmanager.php 1 patch
Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -39,22 +39,22 @@
 block discarded – undo
39 39
  * @since 6.0.0
40 40
  */
41 41
 interface INavigationManager {
42
-	/**
43
-	 * Creates a new navigation entry
44
-	 *
45
-	 * @param array|\Closure $entry Array containing: id, name, order, icon and href key
46
-	 *					The use of a closure is preferred, because it will avoid
47
-	 * 					loading the routing of your app, unless required.
48
-	 * @return void
49
-	 * @since 6.0.0
50
-	 */
51
-	public function add($entry);
42
+    /**
43
+     * Creates a new navigation entry
44
+     *
45
+     * @param array|\Closure $entry Array containing: id, name, order, icon and href key
46
+     *					The use of a closure is preferred, because it will avoid
47
+     * 					loading the routing of your app, unless required.
48
+     * @return void
49
+     * @since 6.0.0
50
+     */
51
+    public function add($entry);
52 52
 
53
-	/**
54
-	 * Sets the current navigation entry of the currently running app
55
-	 * @param string $appId id of the app entry to activate (from added $entry)
56
-	 * @return void
57
-	 * @since 6.0.0
58
-	 */
59
-	public function setActiveEntry($appId);
53
+    /**
54
+     * Sets the current navigation entry of the currently running app
55
+     * @param string $appId id of the app entry to activate (from added $entry)
56
+     * @return void
57
+     * @since 6.0.0
58
+     */
59
+    public function setActiveEntry($appId);
60 60
 }
Please login to merge, or discard this patch.
lib/public/iurlgenerator.php 1 patch
Indentation   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -38,57 +38,57 @@
 block discarded – undo
38 38
  * @since 6.0.0
39 39
  */
40 40
 interface IURLGenerator {
41
-	/**
42
-	 * Returns the URL for a route
43
-	 * @param string $routeName the name of the route
44
-	 * @param array $arguments an array with arguments which will be filled into the url
45
-	 * @return string the url
46
-	 * @since 6.0.0
47
-	 */
48
-	public function linkToRoute($routeName, $arguments = array());
41
+    /**
42
+     * Returns the URL for a route
43
+     * @param string $routeName the name of the route
44
+     * @param array $arguments an array with arguments which will be filled into the url
45
+     * @return string the url
46
+     * @since 6.0.0
47
+     */
48
+    public function linkToRoute($routeName, $arguments = array());
49 49
 
50
-	/**
51
-	 * Returns the absolute URL for a route
52
-	 * @param string $routeName the name of the route
53
-	 * @param array $arguments an array with arguments which will be filled into the url
54
-	 * @return string the absolute url
55
-	 * @since 8.0.0
56
-	 */
57
-	public function linkToRouteAbsolute($routeName, $arguments = array());
50
+    /**
51
+     * Returns the absolute URL for a route
52
+     * @param string $routeName the name of the route
53
+     * @param array $arguments an array with arguments which will be filled into the url
54
+     * @return string the absolute url
55
+     * @since 8.0.0
56
+     */
57
+    public function linkToRouteAbsolute($routeName, $arguments = array());
58 58
 
59
-	/**
60
-	 * Returns an URL for an image or file
61
-	 * @param string $appName the name of the app
62
-	 * @param string $file the name of the file
63
-	 * @param array $args array with param=>value, will be appended to the returned url
64
-	 *    The value of $args will be urlencoded
65
-	 * @return string the url
66
-	 * @since 6.0.0
67
-	 */
68
-	public function linkTo($appName, $file, $args = array());
59
+    /**
60
+     * Returns an URL for an image or file
61
+     * @param string $appName the name of the app
62
+     * @param string $file the name of the file
63
+     * @param array $args array with param=>value, will be appended to the returned url
64
+     *    The value of $args will be urlencoded
65
+     * @return string the url
66
+     * @since 6.0.0
67
+     */
68
+    public function linkTo($appName, $file, $args = array());
69 69
 
70
-	/**
71
-	 * Returns the link to an image, like linkTo but only with prepending img/
72
-	 * @param string $appName the name of the app
73
-	 * @param string $file the name of the file
74
-	 * @return string the url
75
-	 * @since 6.0.0
76
-	 */
77
-	public function imagePath($appName, $file);
70
+    /**
71
+     * Returns the link to an image, like linkTo but only with prepending img/
72
+     * @param string $appName the name of the app
73
+     * @param string $file the name of the file
74
+     * @return string the url
75
+     * @since 6.0.0
76
+     */
77
+    public function imagePath($appName, $file);
78 78
 
79 79
 
80
-	/**
81
-	 * Makes an URL absolute
82
-	 * @param string $url the url in the ownCloud host
83
-	 * @return string the absolute version of the url
84
-	 * @since 6.0.0
85
-	 */
86
-	public function getAbsoluteURL($url);
80
+    /**
81
+     * Makes an URL absolute
82
+     * @param string $url the url in the ownCloud host
83
+     * @return string the absolute version of the url
84
+     * @since 6.0.0
85
+     */
86
+    public function getAbsoluteURL($url);
87 87
 
88
-	/**
89
-	 * @param string $key
90
-	 * @return string url to the online documentation
91
-	 * @since 8.0.0
92
-	 */
93
-	public function linkToDocs($key);
88
+    /**
89
+     * @param string $key
90
+     * @return string url to the online documentation
91
+     * @since 8.0.0
92
+     */
93
+    public function linkToDocs($key);
94 94
 }
Please login to merge, or discard this patch.