@@ -35,118 +35,118 @@ |
||
35 | 35 | */ |
36 | 36 | interface IShareProvider { |
37 | 37 | |
38 | - /** |
|
39 | - * Return the identifier of this provider. |
|
40 | - * |
|
41 | - * @return string Containing only [a-zA-Z0-9] |
|
42 | - * @since 9.0.0 |
|
43 | - */ |
|
44 | - public function identifier(); |
|
38 | + /** |
|
39 | + * Return the identifier of this provider. |
|
40 | + * |
|
41 | + * @return string Containing only [a-zA-Z0-9] |
|
42 | + * @since 9.0.0 |
|
43 | + */ |
|
44 | + public function identifier(); |
|
45 | 45 | |
46 | - /** |
|
47 | - * Create a share |
|
48 | - * |
|
49 | - * @param \OCP\Share\IShare $share |
|
50 | - * @return \OCP\Share\IShare The share object |
|
51 | - * @since 9.0.0 |
|
52 | - */ |
|
53 | - public function create(\OCP\Share\IShare $share); |
|
46 | + /** |
|
47 | + * Create a share |
|
48 | + * |
|
49 | + * @param \OCP\Share\IShare $share |
|
50 | + * @return \OCP\Share\IShare The share object |
|
51 | + * @since 9.0.0 |
|
52 | + */ |
|
53 | + public function create(\OCP\Share\IShare $share); |
|
54 | 54 | |
55 | - /** |
|
56 | - * Update a share |
|
57 | - * |
|
58 | - * @param \OCP\Share\IShare $share |
|
59 | - * @return \OCP\Share\IShare The share object |
|
60 | - * @since 9.0.0 |
|
61 | - */ |
|
62 | - public function update(\OCP\Share\IShare $share); |
|
55 | + /** |
|
56 | + * Update a share |
|
57 | + * |
|
58 | + * @param \OCP\Share\IShare $share |
|
59 | + * @return \OCP\Share\IShare The share object |
|
60 | + * @since 9.0.0 |
|
61 | + */ |
|
62 | + public function update(\OCP\Share\IShare $share); |
|
63 | 63 | |
64 | - /** |
|
65 | - * Delete a share |
|
66 | - * |
|
67 | - * @param \OCP\Share\IShare $share |
|
68 | - * @since 9.0.0 |
|
69 | - */ |
|
70 | - public function delete(\OCP\Share\IShare $share); |
|
64 | + /** |
|
65 | + * Delete a share |
|
66 | + * |
|
67 | + * @param \OCP\Share\IShare $share |
|
68 | + * @since 9.0.0 |
|
69 | + */ |
|
70 | + public function delete(\OCP\Share\IShare $share); |
|
71 | 71 | |
72 | - /** |
|
73 | - * Unshare a file from self as recipient. |
|
74 | - * This may require special handling. If a user unshares a group |
|
75 | - * share from their self then the original group share should still exist. |
|
76 | - * |
|
77 | - * @param \OCP\Share\IShare $share |
|
78 | - * @param string $recipient UserId of the recipient |
|
79 | - * @since 9.0.0 |
|
80 | - */ |
|
81 | - public function deleteFromSelf(\OCP\Share\IShare $share, $recipient); |
|
72 | + /** |
|
73 | + * Unshare a file from self as recipient. |
|
74 | + * This may require special handling. If a user unshares a group |
|
75 | + * share from their self then the original group share should still exist. |
|
76 | + * |
|
77 | + * @param \OCP\Share\IShare $share |
|
78 | + * @param string $recipient UserId of the recipient |
|
79 | + * @since 9.0.0 |
|
80 | + */ |
|
81 | + public function deleteFromSelf(\OCP\Share\IShare $share, $recipient); |
|
82 | 82 | |
83 | - /** |
|
84 | - * Move a share as a recipient. |
|
85 | - * This is updating the share target. Thus the mount point of the recipient. |
|
86 | - * This may require special handling. If a user moves a group share |
|
87 | - * the target should only be changed for them. |
|
88 | - * |
|
89 | - * @param \OCP\Share\IShare $share |
|
90 | - * @param string $recipient userId of recipient |
|
91 | - * @return \OCP\Share\IShare |
|
92 | - * @since 9.0.0 |
|
93 | - */ |
|
94 | - public function move(\OCP\Share\IShare $share, $recipient); |
|
83 | + /** |
|
84 | + * Move a share as a recipient. |
|
85 | + * This is updating the share target. Thus the mount point of the recipient. |
|
86 | + * This may require special handling. If a user moves a group share |
|
87 | + * the target should only be changed for them. |
|
88 | + * |
|
89 | + * @param \OCP\Share\IShare $share |
|
90 | + * @param string $recipient userId of recipient |
|
91 | + * @return \OCP\Share\IShare |
|
92 | + * @since 9.0.0 |
|
93 | + */ |
|
94 | + public function move(\OCP\Share\IShare $share, $recipient); |
|
95 | 95 | |
96 | - /** |
|
97 | - * Get all shares by the given user |
|
98 | - * |
|
99 | - * @param string $userId |
|
100 | - * @param int $shareType |
|
101 | - * @param \OCP\Files\File|\OCP\Files\Folder $node |
|
102 | - * @param bool $reshares Also get the shares where $user is the owner instead of just the shares where $user is the initiator |
|
103 | - * @param int $limit The maximum number of shares to be returned, -1 for all shares |
|
104 | - * @param int $offset |
|
105 | - * @return \OCP\Share\IShare[] |
|
106 | - * @since 9.0.0 |
|
107 | - */ |
|
108 | - public function getSharesBy($userId, $shareType, $node, $reshares, $limit, $offset); |
|
96 | + /** |
|
97 | + * Get all shares by the given user |
|
98 | + * |
|
99 | + * @param string $userId |
|
100 | + * @param int $shareType |
|
101 | + * @param \OCP\Files\File|\OCP\Files\Folder $node |
|
102 | + * @param bool $reshares Also get the shares where $user is the owner instead of just the shares where $user is the initiator |
|
103 | + * @param int $limit The maximum number of shares to be returned, -1 for all shares |
|
104 | + * @param int $offset |
|
105 | + * @return \OCP\Share\IShare[] |
|
106 | + * @since 9.0.0 |
|
107 | + */ |
|
108 | + public function getSharesBy($userId, $shareType, $node, $reshares, $limit, $offset); |
|
109 | 109 | |
110 | - /** |
|
111 | - * Get share by id |
|
112 | - * |
|
113 | - * @param int $id |
|
114 | - * @param string|null $recipientId |
|
115 | - * @return \OCP\Share\IShare |
|
116 | - * @throws ShareNotFound |
|
117 | - * @since 9.0.0 |
|
118 | - */ |
|
119 | - public function getShareById($id, $recipientId = null); |
|
110 | + /** |
|
111 | + * Get share by id |
|
112 | + * |
|
113 | + * @param int $id |
|
114 | + * @param string|null $recipientId |
|
115 | + * @return \OCP\Share\IShare |
|
116 | + * @throws ShareNotFound |
|
117 | + * @since 9.0.0 |
|
118 | + */ |
|
119 | + public function getShareById($id, $recipientId = null); |
|
120 | 120 | |
121 | - /** |
|
122 | - * Get shares for a given path |
|
123 | - * |
|
124 | - * @param \OCP\Files\Node $path |
|
125 | - * @return \OCP\Share\IShare[] |
|
126 | - * @since 9.0.0 |
|
127 | - */ |
|
128 | - public function getSharesByPath(\OCP\Files\Node $path); |
|
121 | + /** |
|
122 | + * Get shares for a given path |
|
123 | + * |
|
124 | + * @param \OCP\Files\Node $path |
|
125 | + * @return \OCP\Share\IShare[] |
|
126 | + * @since 9.0.0 |
|
127 | + */ |
|
128 | + public function getSharesByPath(\OCP\Files\Node $path); |
|
129 | 129 | |
130 | - /** |
|
131 | - * Get shared with the given user |
|
132 | - * |
|
133 | - * @param string $userId get shares where this user is the recipient |
|
134 | - * @param int $shareType |
|
135 | - * @param Node|null $node |
|
136 | - * @param int $limit The max number of entries returned, -1 for all |
|
137 | - * @param int $offset |
|
138 | - * @return \OCP\Share\IShare[] |
|
139 | - * @since 9.0.0 |
|
140 | - */ |
|
141 | - public function getSharedWith($userId, $shareType, $node, $limit, $offset); |
|
130 | + /** |
|
131 | + * Get shared with the given user |
|
132 | + * |
|
133 | + * @param string $userId get shares where this user is the recipient |
|
134 | + * @param int $shareType |
|
135 | + * @param Node|null $node |
|
136 | + * @param int $limit The max number of entries returned, -1 for all |
|
137 | + * @param int $offset |
|
138 | + * @return \OCP\Share\IShare[] |
|
139 | + * @since 9.0.0 |
|
140 | + */ |
|
141 | + public function getSharedWith($userId, $shareType, $node, $limit, $offset); |
|
142 | 142 | |
143 | - /** |
|
144 | - * Get a share by token |
|
145 | - * |
|
146 | - * @param string $token |
|
147 | - * @return \OCP\Share\IShare |
|
148 | - * @throws ShareNotFound |
|
149 | - * @since 9.0.0 |
|
150 | - */ |
|
151 | - public function getShareByToken($token); |
|
143 | + /** |
|
144 | + * Get a share by token |
|
145 | + * |
|
146 | + * @param string $token |
|
147 | + * @return \OCP\Share\IShare |
|
148 | + * @throws ShareNotFound |
|
149 | + * @since 9.0.0 |
|
150 | + */ |
|
151 | + public function getShareByToken($token); |
|
152 | 152 | } |
@@ -38,59 +38,59 @@ |
||
38 | 38 | * @since 6.0.0 |
39 | 39 | */ |
40 | 40 | interface IPreview { |
41 | - /** |
|
42 | - * In order to improve lazy loading a closure can be registered which will be |
|
43 | - * called in case preview providers are actually requested |
|
44 | - * |
|
45 | - * $callable has to return an instance of \OCP\Preview\IProvider |
|
46 | - * |
|
47 | - * @param string $mimeTypeRegex Regex with the mime types that are supported by this provider |
|
48 | - * @param \Closure $callable |
|
49 | - * @return void |
|
50 | - * @since 8.1.0 |
|
51 | - */ |
|
52 | - public function registerProvider($mimeTypeRegex, \Closure $callable); |
|
41 | + /** |
|
42 | + * In order to improve lazy loading a closure can be registered which will be |
|
43 | + * called in case preview providers are actually requested |
|
44 | + * |
|
45 | + * $callable has to return an instance of \OCP\Preview\IProvider |
|
46 | + * |
|
47 | + * @param string $mimeTypeRegex Regex with the mime types that are supported by this provider |
|
48 | + * @param \Closure $callable |
|
49 | + * @return void |
|
50 | + * @since 8.1.0 |
|
51 | + */ |
|
52 | + public function registerProvider($mimeTypeRegex, \Closure $callable); |
|
53 | 53 | |
54 | - /** |
|
55 | - * Get all providers |
|
56 | - * @return array |
|
57 | - * @since 8.1.0 |
|
58 | - */ |
|
59 | - public function getProviders(); |
|
54 | + /** |
|
55 | + * Get all providers |
|
56 | + * @return array |
|
57 | + * @since 8.1.0 |
|
58 | + */ |
|
59 | + public function getProviders(); |
|
60 | 60 | |
61 | - /** |
|
62 | - * Does the manager have any providers |
|
63 | - * @return bool |
|
64 | - * @since 8.1.0 |
|
65 | - */ |
|
66 | - public function hasProviders(); |
|
61 | + /** |
|
62 | + * Does the manager have any providers |
|
63 | + * @return bool |
|
64 | + * @since 8.1.0 |
|
65 | + */ |
|
66 | + public function hasProviders(); |
|
67 | 67 | |
68 | - /** |
|
69 | - * Return a preview of a file |
|
70 | - * @param string $file The path to the file where you want a thumbnail from |
|
71 | - * @param int $maxX The maximum X size of the thumbnail. It can be smaller depending on the shape of the image |
|
72 | - * @param int $maxY The maximum Y size of the thumbnail. It can be smaller depending on the shape of the image |
|
73 | - * @param boolean $scaleUp Scale smaller images up to the thumbnail size or not. Might look ugly |
|
74 | - * @return \OCP\IImage |
|
75 | - * @since 6.0.0 |
|
76 | - */ |
|
77 | - public function createPreview($file, $maxX = 100, $maxY = 75, $scaleUp = false); |
|
68 | + /** |
|
69 | + * Return a preview of a file |
|
70 | + * @param string $file The path to the file where you want a thumbnail from |
|
71 | + * @param int $maxX The maximum X size of the thumbnail. It can be smaller depending on the shape of the image |
|
72 | + * @param int $maxY The maximum Y size of the thumbnail. It can be smaller depending on the shape of the image |
|
73 | + * @param boolean $scaleUp Scale smaller images up to the thumbnail size or not. Might look ugly |
|
74 | + * @return \OCP\IImage |
|
75 | + * @since 6.0.0 |
|
76 | + */ |
|
77 | + public function createPreview($file, $maxX = 100, $maxY = 75, $scaleUp = false); |
|
78 | 78 | |
79 | 79 | |
80 | - /** |
|
81 | - * Returns true if the passed mime type is supported |
|
82 | - * @param string $mimeType |
|
83 | - * @return boolean |
|
84 | - * @since 6.0.0 |
|
85 | - */ |
|
86 | - public function isMimeSupported($mimeType = '*'); |
|
80 | + /** |
|
81 | + * Returns true if the passed mime type is supported |
|
82 | + * @param string $mimeType |
|
83 | + * @return boolean |
|
84 | + * @since 6.0.0 |
|
85 | + */ |
|
86 | + public function isMimeSupported($mimeType = '*'); |
|
87 | 87 | |
88 | - /** |
|
89 | - * Check if a preview can be generated for a file |
|
90 | - * |
|
91 | - * @param \OCP\Files\FileInfo $file |
|
92 | - * @return bool |
|
93 | - * @since 8.0.0 |
|
94 | - */ |
|
95 | - public function isAvailable(\OCP\Files\FileInfo $file); |
|
88 | + /** |
|
89 | + * Check if a preview can be generated for a file |
|
90 | + * |
|
91 | + * @param \OCP\Files\FileInfo $file |
|
92 | + * @return bool |
|
93 | + * @since 8.0.0 |
|
94 | + */ |
|
95 | + public function isAvailable(\OCP\Files\FileInfo $file); |
|
96 | 96 | } |
@@ -33,65 +33,65 @@ |
||
33 | 33 | */ |
34 | 34 | interface Share_Backend { |
35 | 35 | |
36 | - /** |
|
37 | - * Check if this $itemSource exist for the user |
|
38 | - * @param string $itemSource |
|
39 | - * @param string $uidOwner Owner of the item |
|
40 | - * @return boolean|null Source |
|
41 | - * |
|
42 | - * Return false if the item does not exist for the user |
|
43 | - * @since 5.0.0 |
|
44 | - */ |
|
45 | - public function isValidSource($itemSource, $uidOwner); |
|
36 | + /** |
|
37 | + * Check if this $itemSource exist for the user |
|
38 | + * @param string $itemSource |
|
39 | + * @param string $uidOwner Owner of the item |
|
40 | + * @return boolean|null Source |
|
41 | + * |
|
42 | + * Return false if the item does not exist for the user |
|
43 | + * @since 5.0.0 |
|
44 | + */ |
|
45 | + public function isValidSource($itemSource, $uidOwner); |
|
46 | 46 | |
47 | - /** |
|
48 | - * Get a unique name of the item for the specified user |
|
49 | - * @param string $itemSource |
|
50 | - * @param string|false $shareWith User the item is being shared with |
|
51 | - * @param array|null $exclude List of similar item names already existing as shared items @deprecated since version OC7 |
|
52 | - * @return string Target name |
|
53 | - * |
|
54 | - * This function needs to verify that the user does not already have an item with this name. |
|
55 | - * If it does generate a new name e.g. name_# |
|
56 | - * @since 5.0.0 |
|
57 | - */ |
|
58 | - public function generateTarget($itemSource, $shareWith, $exclude = null); |
|
47 | + /** |
|
48 | + * Get a unique name of the item for the specified user |
|
49 | + * @param string $itemSource |
|
50 | + * @param string|false $shareWith User the item is being shared with |
|
51 | + * @param array|null $exclude List of similar item names already existing as shared items @deprecated since version OC7 |
|
52 | + * @return string Target name |
|
53 | + * |
|
54 | + * This function needs to verify that the user does not already have an item with this name. |
|
55 | + * If it does generate a new name e.g. name_# |
|
56 | + * @since 5.0.0 |
|
57 | + */ |
|
58 | + public function generateTarget($itemSource, $shareWith, $exclude = null); |
|
59 | 59 | |
60 | - /** |
|
61 | - * Converts the shared item sources back into the item in the specified format |
|
62 | - * @param array $items Shared items |
|
63 | - * @param int $format |
|
64 | - * @return array |
|
65 | - * |
|
66 | - * The items array is a 3-dimensional array with the item_source as the |
|
67 | - * first key and the share id as the second key to an array with the share |
|
68 | - * info. |
|
69 | - * |
|
70 | - * The key/value pairs included in the share info depend on the function originally called: |
|
71 | - * If called by getItem(s)Shared: id, item_type, item, item_source, |
|
72 | - * share_type, share_with, permissions, stime, file_source |
|
73 | - * |
|
74 | - * If called by getItem(s)SharedWith: id, item_type, item, item_source, |
|
75 | - * item_target, share_type, share_with, permissions, stime, file_source, |
|
76 | - * file_target |
|
77 | - * |
|
78 | - * This function allows the backend to control the output of shared items with custom formats. |
|
79 | - * It is only called through calls to the public getItem(s)Shared(With) functions. |
|
80 | - * @since 5.0.0 |
|
81 | - */ |
|
82 | - public function formatItems($items, $format, $parameters = null); |
|
60 | + /** |
|
61 | + * Converts the shared item sources back into the item in the specified format |
|
62 | + * @param array $items Shared items |
|
63 | + * @param int $format |
|
64 | + * @return array |
|
65 | + * |
|
66 | + * The items array is a 3-dimensional array with the item_source as the |
|
67 | + * first key and the share id as the second key to an array with the share |
|
68 | + * info. |
|
69 | + * |
|
70 | + * The key/value pairs included in the share info depend on the function originally called: |
|
71 | + * If called by getItem(s)Shared: id, item_type, item, item_source, |
|
72 | + * share_type, share_with, permissions, stime, file_source |
|
73 | + * |
|
74 | + * If called by getItem(s)SharedWith: id, item_type, item, item_source, |
|
75 | + * item_target, share_type, share_with, permissions, stime, file_source, |
|
76 | + * file_target |
|
77 | + * |
|
78 | + * This function allows the backend to control the output of shared items with custom formats. |
|
79 | + * It is only called through calls to the public getItem(s)Shared(With) functions. |
|
80 | + * @since 5.0.0 |
|
81 | + */ |
|
82 | + public function formatItems($items, $format, $parameters = null); |
|
83 | 83 | |
84 | - /** |
|
85 | - * Check if a given share type is allowd by the back-end |
|
86 | - * |
|
87 | - * @param int $shareType share type |
|
88 | - * @return boolean |
|
89 | - * |
|
90 | - * The back-end can enable/disable specific share types. Just return true if |
|
91 | - * the back-end doesn't provide any specific settings for it and want to allow |
|
92 | - * all share types defined by the share API |
|
93 | - * @since 8.0.0 |
|
94 | - */ |
|
95 | - public function isShareTypeAllowed($shareType); |
|
84 | + /** |
|
85 | + * Check if a given share type is allowd by the back-end |
|
86 | + * |
|
87 | + * @param int $shareType share type |
|
88 | + * @return boolean |
|
89 | + * |
|
90 | + * The back-end can enable/disable specific share types. Just return true if |
|
91 | + * the back-end doesn't provide any specific settings for it and want to allow |
|
92 | + * all share types defined by the share API |
|
93 | + * @since 8.0.0 |
|
94 | + */ |
|
95 | + public function isShareTypeAllowed($shareType); |
|
96 | 96 | |
97 | 97 | } |
@@ -33,170 +33,170 @@ |
||
33 | 33 | * @since 8.0.0 |
34 | 34 | */ |
35 | 35 | interface IUser { |
36 | - /** |
|
37 | - * get the user id |
|
38 | - * |
|
39 | - * @return string |
|
40 | - * @since 8.0.0 |
|
41 | - */ |
|
42 | - public function getUID(); |
|
43 | - |
|
44 | - /** |
|
45 | - * get the display name for the user, if no specific display name is set it will fallback to the user id |
|
46 | - * |
|
47 | - * @return string |
|
48 | - * @since 8.0.0 |
|
49 | - */ |
|
50 | - public function getDisplayName(); |
|
51 | - |
|
52 | - /** |
|
53 | - * set the display name for the user |
|
54 | - * |
|
55 | - * @param string $displayName |
|
56 | - * @return bool |
|
57 | - * @since 8.0.0 |
|
58 | - */ |
|
59 | - public function setDisplayName($displayName); |
|
60 | - |
|
61 | - /** |
|
62 | - * returns the timestamp of the user's last login or 0 if the user did never |
|
63 | - * login |
|
64 | - * |
|
65 | - * @return int |
|
66 | - * @since 8.0.0 |
|
67 | - */ |
|
68 | - public function getLastLogin(); |
|
69 | - |
|
70 | - /** |
|
71 | - * updates the timestamp of the most recent login of this user |
|
72 | - * @since 8.0.0 |
|
73 | - */ |
|
74 | - public function updateLastLoginTimestamp(); |
|
75 | - |
|
76 | - /** |
|
77 | - * Delete the user |
|
78 | - * |
|
79 | - * @return bool |
|
80 | - * @since 8.0.0 |
|
81 | - */ |
|
82 | - public function delete(); |
|
83 | - |
|
84 | - /** |
|
85 | - * Set the password of the user |
|
86 | - * |
|
87 | - * @param string $password |
|
88 | - * @param string $recoveryPassword for the encryption app to reset encryption keys |
|
89 | - * @return bool |
|
90 | - * @since 8.0.0 |
|
91 | - */ |
|
92 | - public function setPassword($password, $recoveryPassword = null); |
|
93 | - |
|
94 | - /** |
|
95 | - * get the users home folder to mount |
|
96 | - * |
|
97 | - * @return string |
|
98 | - * @since 8.0.0 |
|
99 | - */ |
|
100 | - public function getHome(); |
|
101 | - |
|
102 | - /** |
|
103 | - * Get the name of the backend class the user is connected with |
|
104 | - * |
|
105 | - * @return string |
|
106 | - * @since 8.0.0 |
|
107 | - */ |
|
108 | - public function getBackendClassName(); |
|
109 | - |
|
110 | - /** |
|
111 | - * check if the backend allows the user to change his avatar on Personal page |
|
112 | - * |
|
113 | - * @return bool |
|
114 | - * @since 8.0.0 |
|
115 | - */ |
|
116 | - public function canChangeAvatar(); |
|
117 | - |
|
118 | - /** |
|
119 | - * check if the backend supports changing passwords |
|
120 | - * |
|
121 | - * @return bool |
|
122 | - * @since 8.0.0 |
|
123 | - */ |
|
124 | - public function canChangePassword(); |
|
125 | - |
|
126 | - /** |
|
127 | - * check if the backend supports changing display names |
|
128 | - * |
|
129 | - * @return bool |
|
130 | - * @since 8.0.0 |
|
131 | - */ |
|
132 | - public function canChangeDisplayName(); |
|
133 | - |
|
134 | - /** |
|
135 | - * check if the user is enabled |
|
136 | - * |
|
137 | - * @return bool |
|
138 | - * @since 8.0.0 |
|
139 | - */ |
|
140 | - public function isEnabled(); |
|
141 | - |
|
142 | - /** |
|
143 | - * set the enabled status for the user |
|
144 | - * |
|
145 | - * @param bool $enabled |
|
146 | - * @since 8.0.0 |
|
147 | - */ |
|
148 | - public function setEnabled($enabled); |
|
149 | - |
|
150 | - /** |
|
151 | - * get the users email address |
|
152 | - * |
|
153 | - * @return string|null |
|
154 | - * @since 9.0.0 |
|
155 | - */ |
|
156 | - public function getEMailAddress(); |
|
157 | - |
|
158 | - /** |
|
159 | - * get the avatar image if it exists |
|
160 | - * |
|
161 | - * @param int $size |
|
162 | - * @return IImage|null |
|
163 | - * @since 9.0.0 |
|
164 | - */ |
|
165 | - public function getAvatarImage($size); |
|
166 | - |
|
167 | - /** |
|
168 | - * get the federation cloud id |
|
169 | - * |
|
170 | - * @return string |
|
171 | - * @since 9.0.0 |
|
172 | - */ |
|
173 | - public function getCloudId(); |
|
174 | - |
|
175 | - /** |
|
176 | - * set the email address of the user |
|
177 | - * |
|
178 | - * @param string|null $mailAddress |
|
179 | - * @return void |
|
180 | - * @since 9.0.0 |
|
181 | - */ |
|
182 | - public function setEMailAddress($mailAddress); |
|
183 | - |
|
184 | - /** |
|
185 | - * get the users' quota in human readable form. If a specific quota is not |
|
186 | - * set for the user, the default value is returned. If a default setting |
|
187 | - * was not set otherwise, it is return as 'none', i.e. quota is not limited. |
|
188 | - * |
|
189 | - * @return string |
|
190 | - * @since 9.0.0 |
|
191 | - */ |
|
192 | - public function getQuota(); |
|
193 | - |
|
194 | - /** |
|
195 | - * set the users' quota |
|
196 | - * |
|
197 | - * @param string $quota |
|
198 | - * @return void |
|
199 | - * @since 9.0.0 |
|
200 | - */ |
|
201 | - public function setQuota($quota); |
|
36 | + /** |
|
37 | + * get the user id |
|
38 | + * |
|
39 | + * @return string |
|
40 | + * @since 8.0.0 |
|
41 | + */ |
|
42 | + public function getUID(); |
|
43 | + |
|
44 | + /** |
|
45 | + * get the display name for the user, if no specific display name is set it will fallback to the user id |
|
46 | + * |
|
47 | + * @return string |
|
48 | + * @since 8.0.0 |
|
49 | + */ |
|
50 | + public function getDisplayName(); |
|
51 | + |
|
52 | + /** |
|
53 | + * set the display name for the user |
|
54 | + * |
|
55 | + * @param string $displayName |
|
56 | + * @return bool |
|
57 | + * @since 8.0.0 |
|
58 | + */ |
|
59 | + public function setDisplayName($displayName); |
|
60 | + |
|
61 | + /** |
|
62 | + * returns the timestamp of the user's last login or 0 if the user did never |
|
63 | + * login |
|
64 | + * |
|
65 | + * @return int |
|
66 | + * @since 8.0.0 |
|
67 | + */ |
|
68 | + public function getLastLogin(); |
|
69 | + |
|
70 | + /** |
|
71 | + * updates the timestamp of the most recent login of this user |
|
72 | + * @since 8.0.0 |
|
73 | + */ |
|
74 | + public function updateLastLoginTimestamp(); |
|
75 | + |
|
76 | + /** |
|
77 | + * Delete the user |
|
78 | + * |
|
79 | + * @return bool |
|
80 | + * @since 8.0.0 |
|
81 | + */ |
|
82 | + public function delete(); |
|
83 | + |
|
84 | + /** |
|
85 | + * Set the password of the user |
|
86 | + * |
|
87 | + * @param string $password |
|
88 | + * @param string $recoveryPassword for the encryption app to reset encryption keys |
|
89 | + * @return bool |
|
90 | + * @since 8.0.0 |
|
91 | + */ |
|
92 | + public function setPassword($password, $recoveryPassword = null); |
|
93 | + |
|
94 | + /** |
|
95 | + * get the users home folder to mount |
|
96 | + * |
|
97 | + * @return string |
|
98 | + * @since 8.0.0 |
|
99 | + */ |
|
100 | + public function getHome(); |
|
101 | + |
|
102 | + /** |
|
103 | + * Get the name of the backend class the user is connected with |
|
104 | + * |
|
105 | + * @return string |
|
106 | + * @since 8.0.0 |
|
107 | + */ |
|
108 | + public function getBackendClassName(); |
|
109 | + |
|
110 | + /** |
|
111 | + * check if the backend allows the user to change his avatar on Personal page |
|
112 | + * |
|
113 | + * @return bool |
|
114 | + * @since 8.0.0 |
|
115 | + */ |
|
116 | + public function canChangeAvatar(); |
|
117 | + |
|
118 | + /** |
|
119 | + * check if the backend supports changing passwords |
|
120 | + * |
|
121 | + * @return bool |
|
122 | + * @since 8.0.0 |
|
123 | + */ |
|
124 | + public function canChangePassword(); |
|
125 | + |
|
126 | + /** |
|
127 | + * check if the backend supports changing display names |
|
128 | + * |
|
129 | + * @return bool |
|
130 | + * @since 8.0.0 |
|
131 | + */ |
|
132 | + public function canChangeDisplayName(); |
|
133 | + |
|
134 | + /** |
|
135 | + * check if the user is enabled |
|
136 | + * |
|
137 | + * @return bool |
|
138 | + * @since 8.0.0 |
|
139 | + */ |
|
140 | + public function isEnabled(); |
|
141 | + |
|
142 | + /** |
|
143 | + * set the enabled status for the user |
|
144 | + * |
|
145 | + * @param bool $enabled |
|
146 | + * @since 8.0.0 |
|
147 | + */ |
|
148 | + public function setEnabled($enabled); |
|
149 | + |
|
150 | + /** |
|
151 | + * get the users email address |
|
152 | + * |
|
153 | + * @return string|null |
|
154 | + * @since 9.0.0 |
|
155 | + */ |
|
156 | + public function getEMailAddress(); |
|
157 | + |
|
158 | + /** |
|
159 | + * get the avatar image if it exists |
|
160 | + * |
|
161 | + * @param int $size |
|
162 | + * @return IImage|null |
|
163 | + * @since 9.0.0 |
|
164 | + */ |
|
165 | + public function getAvatarImage($size); |
|
166 | + |
|
167 | + /** |
|
168 | + * get the federation cloud id |
|
169 | + * |
|
170 | + * @return string |
|
171 | + * @since 9.0.0 |
|
172 | + */ |
|
173 | + public function getCloudId(); |
|
174 | + |
|
175 | + /** |
|
176 | + * set the email address of the user |
|
177 | + * |
|
178 | + * @param string|null $mailAddress |
|
179 | + * @return void |
|
180 | + * @since 9.0.0 |
|
181 | + */ |
|
182 | + public function setEMailAddress($mailAddress); |
|
183 | + |
|
184 | + /** |
|
185 | + * get the users' quota in human readable form. If a specific quota is not |
|
186 | + * set for the user, the default value is returned. If a default setting |
|
187 | + * was not set otherwise, it is return as 'none', i.e. quota is not limited. |
|
188 | + * |
|
189 | + * @return string |
|
190 | + * @since 9.0.0 |
|
191 | + */ |
|
192 | + public function getQuota(); |
|
193 | + |
|
194 | + /** |
|
195 | + * set the users' quota |
|
196 | + * |
|
197 | + * @param string $quota |
|
198 | + * @return void |
|
199 | + * @since 9.0.0 |
|
200 | + */ |
|
201 | + public function setQuota($quota); |
|
202 | 202 | } |
@@ -30,22 +30,22 @@ |
||
30 | 30 | * @since 9.0.0 |
31 | 31 | */ |
32 | 32 | interface IContentSecurityPolicyManager { |
33 | - /** |
|
34 | - * Allows to inject something into the default content policy. This is for |
|
35 | - * example useful when you're injecting Javascript code into a view belonging |
|
36 | - * to another controller and cannot modify its Content-Security-Policy itself. |
|
37 | - * Note that the adjustment is only applied to applications that use AppFramework |
|
38 | - * controllers. |
|
39 | - * |
|
40 | - * To use this from your `app.php` use `\OC::$server->getContentSecurityPolicyManager()->addDefaultPolicy($policy)`, |
|
41 | - * $policy has to be of type `\OCP\AppFramework\Http\ContentSecurityPolicy`. |
|
42 | - * |
|
43 | - * WARNING: Using this API incorrectly may make the instance more insecure. |
|
44 | - * Do think twice before adding whitelisting resources. Please do also note |
|
45 | - * that it is not possible to use the `disallowXYZ` functions. |
|
46 | - * |
|
47 | - * @param EmptyContentSecurityPolicy $policy |
|
48 | - * @since 9.0.0 |
|
49 | - */ |
|
50 | - public function addDefaultPolicy(EmptyContentSecurityPolicy $policy); |
|
33 | + /** |
|
34 | + * Allows to inject something into the default content policy. This is for |
|
35 | + * example useful when you're injecting Javascript code into a view belonging |
|
36 | + * to another controller and cannot modify its Content-Security-Policy itself. |
|
37 | + * Note that the adjustment is only applied to applications that use AppFramework |
|
38 | + * controllers. |
|
39 | + * |
|
40 | + * To use this from your `app.php` use `\OC::$server->getContentSecurityPolicyManager()->addDefaultPolicy($policy)`, |
|
41 | + * $policy has to be of type `\OCP\AppFramework\Http\ContentSecurityPolicy`. |
|
42 | + * |
|
43 | + * WARNING: Using this API incorrectly may make the instance more insecure. |
|
44 | + * Do think twice before adding whitelisting resources. Please do also note |
|
45 | + * that it is not possible to use the `disallowXYZ` functions. |
|
46 | + * |
|
47 | + * @param EmptyContentSecurityPolicy $policy |
|
48 | + * @since 9.0.0 |
|
49 | + */ |
|
50 | + public function addDefaultPolicy(EmptyContentSecurityPolicy $policy); |
|
51 | 51 | } |
@@ -44,23 +44,23 @@ |
||
44 | 44 | * @since 8.0.0 |
45 | 45 | */ |
46 | 46 | interface IHasher { |
47 | - /** |
|
48 | - * Hashes a message using PHP's `password_hash` functionality. |
|
49 | - * Please note that the size of the returned string is not guaranteed |
|
50 | - * and can be up to 255 characters. |
|
51 | - * |
|
52 | - * @param string $message Message to generate hash from |
|
53 | - * @return string Hash of the message with appended version parameter |
|
54 | - * @since 8.0.0 |
|
55 | - */ |
|
56 | - public function hash($message); |
|
47 | + /** |
|
48 | + * Hashes a message using PHP's `password_hash` functionality. |
|
49 | + * Please note that the size of the returned string is not guaranteed |
|
50 | + * and can be up to 255 characters. |
|
51 | + * |
|
52 | + * @param string $message Message to generate hash from |
|
53 | + * @return string Hash of the message with appended version parameter |
|
54 | + * @since 8.0.0 |
|
55 | + */ |
|
56 | + public function hash($message); |
|
57 | 57 | |
58 | - /** |
|
59 | - * @param string $message Message to verify |
|
60 | - * @param string $hash Assumed hash of the message |
|
61 | - * @param null|string &$newHash Reference will contain the updated hash if necessary. Update the existing hash with this one. |
|
62 | - * @return bool Whether $hash is a valid hash of $message |
|
63 | - * @since 8.0.0 |
|
64 | - */ |
|
65 | - public function verify($message, $hash, &$newHash = null); |
|
58 | + /** |
|
59 | + * @param string $message Message to verify |
|
60 | + * @param string $hash Assumed hash of the message |
|
61 | + * @param null|string &$newHash Reference will contain the updated hash if necessary. Update the existing hash with this one. |
|
62 | + * @return bool Whether $hash is a valid hash of $message |
|
63 | + * @since 8.0.0 |
|
64 | + */ |
|
65 | + public function verify($message, $hash, &$newHash = null); |
|
66 | 66 | } |
@@ -36,30 +36,30 @@ |
||
36 | 36 | */ |
37 | 37 | interface ICrypto { |
38 | 38 | |
39 | - /** |
|
40 | - * @param string $message The message to authenticate |
|
41 | - * @param string $password Password to use (defaults to `secret` in config.php) |
|
42 | - * @return string Calculated HMAC |
|
43 | - * @since 8.0.0 |
|
44 | - */ |
|
45 | - public function calculateHMAC($message, $password = ''); |
|
39 | + /** |
|
40 | + * @param string $message The message to authenticate |
|
41 | + * @param string $password Password to use (defaults to `secret` in config.php) |
|
42 | + * @return string Calculated HMAC |
|
43 | + * @since 8.0.0 |
|
44 | + */ |
|
45 | + public function calculateHMAC($message, $password = ''); |
|
46 | 46 | |
47 | - /** |
|
48 | - * Encrypts a value and adds an HMAC (Encrypt-Then-MAC) |
|
49 | - * @param string $plaintext |
|
50 | - * @param string $password Password to encrypt, if not specified the secret from config.php will be taken |
|
51 | - * @return string Authenticated ciphertext |
|
52 | - * @since 8.0.0 |
|
53 | - */ |
|
54 | - public function encrypt($plaintext, $password = ''); |
|
47 | + /** |
|
48 | + * Encrypts a value and adds an HMAC (Encrypt-Then-MAC) |
|
49 | + * @param string $plaintext |
|
50 | + * @param string $password Password to encrypt, if not specified the secret from config.php will be taken |
|
51 | + * @return string Authenticated ciphertext |
|
52 | + * @since 8.0.0 |
|
53 | + */ |
|
54 | + public function encrypt($plaintext, $password = ''); |
|
55 | 55 | |
56 | - /** |
|
57 | - * Decrypts a value and verifies the HMAC (Encrypt-Then-Mac) |
|
58 | - * @param string $authenticatedCiphertext |
|
59 | - * @param string $password Password to encrypt, if not specified the secret from config.php will be taken |
|
60 | - * @return string plaintext |
|
61 | - * @throws \Exception If the HMAC does not match |
|
62 | - * @since 8.0.0 |
|
63 | - */ |
|
64 | - public function decrypt($authenticatedCiphertext, $password = ''); |
|
56 | + /** |
|
57 | + * Decrypts a value and verifies the HMAC (Encrypt-Then-Mac) |
|
58 | + * @param string $authenticatedCiphertext |
|
59 | + * @param string $password Password to encrypt, if not specified the secret from config.php will be taken |
|
60 | + * @return string plaintext |
|
61 | + * @throws \Exception If the HMAC does not match |
|
62 | + * @since 8.0.0 |
|
63 | + */ |
|
64 | + public function decrypt($authenticatedCiphertext, $password = ''); |
|
65 | 65 | } |
@@ -31,18 +31,18 @@ |
||
31 | 31 | * @since 8.0.0 |
32 | 32 | */ |
33 | 33 | class StringUtils { |
34 | - /** |
|
35 | - * Compares whether two strings are equal. To prevent guessing of the string |
|
36 | - * length this is done by comparing two hashes against each other and afterwards |
|
37 | - * a comparison of the real string to prevent against the unlikely chance of |
|
38 | - * collisions. |
|
39 | - * @param string $expected The expected value |
|
40 | - * @param string $input The input to compare against |
|
41 | - * @return bool True if the two strings are equal, otherwise false. |
|
42 | - * @since 8.0.0 |
|
43 | - * @deprecated 9.0.0 Use hash_equals |
|
44 | - */ |
|
45 | - public static function equals($expected, $input) { |
|
46 | - return hash_equals($expected, $input); |
|
47 | - } |
|
34 | + /** |
|
35 | + * Compares whether two strings are equal. To prevent guessing of the string |
|
36 | + * length this is done by comparing two hashes against each other and afterwards |
|
37 | + * a comparison of the real string to prevent against the unlikely chance of |
|
38 | + * collisions. |
|
39 | + * @param string $expected The expected value |
|
40 | + * @param string $input The input to compare against |
|
41 | + * @return bool True if the two strings are equal, otherwise false. |
|
42 | + * @since 8.0.0 |
|
43 | + * @deprecated 9.0.0 Use hash_equals |
|
44 | + */ |
|
45 | + public static function equals($expected, $input) { |
|
46 | + return hash_equals($expected, $input); |
|
47 | + } |
|
48 | 48 | } |
@@ -30,43 +30,43 @@ |
||
30 | 30 | */ |
31 | 31 | interface ICredentialsManager { |
32 | 32 | |
33 | - /** |
|
34 | - * Store a set of credentials |
|
35 | - * |
|
36 | - * @param string|null $userId Null for system-wide credentials |
|
37 | - * @param string $identifier |
|
38 | - * @param mixed $credentials |
|
39 | - * @since 8.2.0 |
|
40 | - */ |
|
41 | - public function store($userId, $identifier, $credentials); |
|
33 | + /** |
|
34 | + * Store a set of credentials |
|
35 | + * |
|
36 | + * @param string|null $userId Null for system-wide credentials |
|
37 | + * @param string $identifier |
|
38 | + * @param mixed $credentials |
|
39 | + * @since 8.2.0 |
|
40 | + */ |
|
41 | + public function store($userId, $identifier, $credentials); |
|
42 | 42 | |
43 | - /** |
|
44 | - * Retrieve a set of credentials |
|
45 | - * |
|
46 | - * @param string|null $userId Null for system-wide credentials |
|
47 | - * @param string $identifier |
|
48 | - * @return mixed |
|
49 | - * @since 8.2.0 |
|
50 | - */ |
|
51 | - public function retrieve($userId, $identifier); |
|
43 | + /** |
|
44 | + * Retrieve a set of credentials |
|
45 | + * |
|
46 | + * @param string|null $userId Null for system-wide credentials |
|
47 | + * @param string $identifier |
|
48 | + * @return mixed |
|
49 | + * @since 8.2.0 |
|
50 | + */ |
|
51 | + public function retrieve($userId, $identifier); |
|
52 | 52 | |
53 | - /** |
|
54 | - * Delete a set of credentials |
|
55 | - * |
|
56 | - * @param string|null $userId Null for system-wide credentials |
|
57 | - * @param string $identifier |
|
58 | - * @return int rows removed |
|
59 | - * @since 8.2.0 |
|
60 | - */ |
|
61 | - public function delete($userId, $identifier); |
|
53 | + /** |
|
54 | + * Delete a set of credentials |
|
55 | + * |
|
56 | + * @param string|null $userId Null for system-wide credentials |
|
57 | + * @param string $identifier |
|
58 | + * @return int rows removed |
|
59 | + * @since 8.2.0 |
|
60 | + */ |
|
61 | + public function delete($userId, $identifier); |
|
62 | 62 | |
63 | - /** |
|
64 | - * Erase all credentials stored for a user |
|
65 | - * |
|
66 | - * @param string $userId |
|
67 | - * @return int rows removed |
|
68 | - * @since 8.2.0 |
|
69 | - */ |
|
70 | - public function erase($userId); |
|
63 | + /** |
|
64 | + * Erase all credentials stored for a user |
|
65 | + * |
|
66 | + * @param string $userId |
|
67 | + * @return int rows removed |
|
68 | + * @since 8.2.0 |
|
69 | + */ |
|
70 | + public function erase($userId); |
|
71 | 71 | |
72 | 72 | } |