@@ -34,213 +34,213 @@ |
||
| 34 | 34 | * @package OCA\AdminAudit\Actions |
| 35 | 35 | */ |
| 36 | 36 | class Sharing extends Action { |
| 37 | - /** |
|
| 38 | - * Logs sharing of data |
|
| 39 | - * |
|
| 40 | - * @param array $params |
|
| 41 | - */ |
|
| 42 | - public function shared(array $params) { |
|
| 43 | - if($params['shareType'] === Share::SHARE_TYPE_LINK) { |
|
| 44 | - $this->log( |
|
| 45 | - 'The %s "%s" with ID "%s" has been shared via link with permissions "%s" (Share ID: %s)', |
|
| 46 | - $params, |
|
| 47 | - [ |
|
| 48 | - 'itemType', |
|
| 49 | - 'itemTarget', |
|
| 50 | - 'itemSource', |
|
| 51 | - 'permissions', |
|
| 52 | - 'id', |
|
| 53 | - ] |
|
| 54 | - ); |
|
| 55 | - } elseif($params['shareType'] === Share::SHARE_TYPE_USER) { |
|
| 56 | - $this->log( |
|
| 57 | - 'The %s "%s" with ID "%s" has been shared to the user "%s" with permissions "%s" (Share ID: %s)', |
|
| 58 | - $params, |
|
| 59 | - [ |
|
| 60 | - 'itemType', |
|
| 61 | - 'itemTarget', |
|
| 62 | - 'itemSource', |
|
| 63 | - 'shareWith', |
|
| 64 | - 'permissions', |
|
| 65 | - 'id', |
|
| 66 | - ] |
|
| 67 | - ); |
|
| 68 | - } elseif($params['shareType'] === Share::SHARE_TYPE_GROUP) { |
|
| 69 | - $this->log( |
|
| 70 | - 'The %s "%s" with ID "%s" has been shared to the group "%s" with permissions "%s" (Share ID: %s)', |
|
| 71 | - $params, |
|
| 72 | - [ |
|
| 73 | - 'itemType', |
|
| 74 | - 'itemTarget', |
|
| 75 | - 'itemSource', |
|
| 76 | - 'shareWith', |
|
| 77 | - 'permissions', |
|
| 78 | - 'id', |
|
| 79 | - ] |
|
| 80 | - ); |
|
| 81 | - } elseif($params['shareType'] === Share::SHARE_TYPE_ROOM) { |
|
| 82 | - $this->log( |
|
| 83 | - 'The %s "%s" with ID "%s" has been shared to the room "%s" with permissions "%s" (Share ID: %s)', |
|
| 84 | - $params, |
|
| 85 | - [ |
|
| 86 | - 'itemType', |
|
| 87 | - 'itemTarget', |
|
| 88 | - 'itemSource', |
|
| 89 | - 'shareWith', |
|
| 90 | - 'permissions', |
|
| 91 | - 'id', |
|
| 92 | - ] |
|
| 93 | - ); |
|
| 94 | - } elseif($params['shareType'] === Share::SHARE_TYPE_EMAIL) { |
|
| 95 | - $this->log( |
|
| 96 | - 'The %s "%s" with ID "%s" has been shared to the email recipient "%s" with permissions "%s" (Share ID: %s)', |
|
| 97 | - $params, |
|
| 98 | - [ |
|
| 99 | - 'itemType', |
|
| 100 | - 'itemTarget', |
|
| 101 | - 'itemSource', |
|
| 102 | - 'shareWith', |
|
| 103 | - 'permissions', |
|
| 104 | - 'id', |
|
| 105 | - ] |
|
| 106 | - ); |
|
| 107 | - } |
|
| 108 | - } |
|
| 37 | + /** |
|
| 38 | + * Logs sharing of data |
|
| 39 | + * |
|
| 40 | + * @param array $params |
|
| 41 | + */ |
|
| 42 | + public function shared(array $params) { |
|
| 43 | + if($params['shareType'] === Share::SHARE_TYPE_LINK) { |
|
| 44 | + $this->log( |
|
| 45 | + 'The %s "%s" with ID "%s" has been shared via link with permissions "%s" (Share ID: %s)', |
|
| 46 | + $params, |
|
| 47 | + [ |
|
| 48 | + 'itemType', |
|
| 49 | + 'itemTarget', |
|
| 50 | + 'itemSource', |
|
| 51 | + 'permissions', |
|
| 52 | + 'id', |
|
| 53 | + ] |
|
| 54 | + ); |
|
| 55 | + } elseif($params['shareType'] === Share::SHARE_TYPE_USER) { |
|
| 56 | + $this->log( |
|
| 57 | + 'The %s "%s" with ID "%s" has been shared to the user "%s" with permissions "%s" (Share ID: %s)', |
|
| 58 | + $params, |
|
| 59 | + [ |
|
| 60 | + 'itemType', |
|
| 61 | + 'itemTarget', |
|
| 62 | + 'itemSource', |
|
| 63 | + 'shareWith', |
|
| 64 | + 'permissions', |
|
| 65 | + 'id', |
|
| 66 | + ] |
|
| 67 | + ); |
|
| 68 | + } elseif($params['shareType'] === Share::SHARE_TYPE_GROUP) { |
|
| 69 | + $this->log( |
|
| 70 | + 'The %s "%s" with ID "%s" has been shared to the group "%s" with permissions "%s" (Share ID: %s)', |
|
| 71 | + $params, |
|
| 72 | + [ |
|
| 73 | + 'itemType', |
|
| 74 | + 'itemTarget', |
|
| 75 | + 'itemSource', |
|
| 76 | + 'shareWith', |
|
| 77 | + 'permissions', |
|
| 78 | + 'id', |
|
| 79 | + ] |
|
| 80 | + ); |
|
| 81 | + } elseif($params['shareType'] === Share::SHARE_TYPE_ROOM) { |
|
| 82 | + $this->log( |
|
| 83 | + 'The %s "%s" with ID "%s" has been shared to the room "%s" with permissions "%s" (Share ID: %s)', |
|
| 84 | + $params, |
|
| 85 | + [ |
|
| 86 | + 'itemType', |
|
| 87 | + 'itemTarget', |
|
| 88 | + 'itemSource', |
|
| 89 | + 'shareWith', |
|
| 90 | + 'permissions', |
|
| 91 | + 'id', |
|
| 92 | + ] |
|
| 93 | + ); |
|
| 94 | + } elseif($params['shareType'] === Share::SHARE_TYPE_EMAIL) { |
|
| 95 | + $this->log( |
|
| 96 | + 'The %s "%s" with ID "%s" has been shared to the email recipient "%s" with permissions "%s" (Share ID: %s)', |
|
| 97 | + $params, |
|
| 98 | + [ |
|
| 99 | + 'itemType', |
|
| 100 | + 'itemTarget', |
|
| 101 | + 'itemSource', |
|
| 102 | + 'shareWith', |
|
| 103 | + 'permissions', |
|
| 104 | + 'id', |
|
| 105 | + ] |
|
| 106 | + ); |
|
| 107 | + } |
|
| 108 | + } |
|
| 109 | 109 | |
| 110 | - /** |
|
| 111 | - * Logs unsharing of data |
|
| 112 | - * |
|
| 113 | - * @param array $params |
|
| 114 | - */ |
|
| 115 | - public function unshare(array $params) { |
|
| 116 | - if($params['shareType'] === Share::SHARE_TYPE_LINK) { |
|
| 117 | - $this->log( |
|
| 118 | - 'The %s "%s" with ID "%s" has been unshared (Share ID: %s)', |
|
| 119 | - $params, |
|
| 120 | - [ |
|
| 121 | - 'itemType', |
|
| 122 | - 'fileTarget', |
|
| 123 | - 'itemSource', |
|
| 124 | - 'id', |
|
| 125 | - ] |
|
| 126 | - ); |
|
| 127 | - } elseif($params['shareType'] === Share::SHARE_TYPE_USER) { |
|
| 128 | - $this->log( |
|
| 129 | - 'The %s "%s" with ID "%s" has been unshared from the user "%s" (Share ID: %s)', |
|
| 130 | - $params, |
|
| 131 | - [ |
|
| 132 | - 'itemType', |
|
| 133 | - 'fileTarget', |
|
| 134 | - 'itemSource', |
|
| 135 | - 'shareWith', |
|
| 136 | - 'id', |
|
| 137 | - ] |
|
| 138 | - ); |
|
| 139 | - } elseif($params['shareType'] === Share::SHARE_TYPE_GROUP) { |
|
| 140 | - $this->log( |
|
| 141 | - 'The %s "%s" with ID "%s" has been unshared from the group "%s" (Share ID: %s)', |
|
| 142 | - $params, |
|
| 143 | - [ |
|
| 144 | - 'itemType', |
|
| 145 | - 'fileTarget', |
|
| 146 | - 'itemSource', |
|
| 147 | - 'shareWith', |
|
| 148 | - 'id', |
|
| 149 | - ] |
|
| 150 | - ); |
|
| 151 | - } elseif($params['shareType'] === Share::SHARE_TYPE_ROOM) { |
|
| 152 | - $this->log( |
|
| 153 | - 'The %s "%s" with ID "%s" has been unshared from the room "%s" (Share ID: %s)', |
|
| 154 | - $params, |
|
| 155 | - [ |
|
| 156 | - 'itemType', |
|
| 157 | - 'fileTarget', |
|
| 158 | - 'itemSource', |
|
| 159 | - 'shareWith', |
|
| 160 | - 'id', |
|
| 161 | - ] |
|
| 162 | - ); |
|
| 163 | - } elseif($params['shareType'] === Share::SHARE_TYPE_EMAIL) { |
|
| 164 | - $this->log( |
|
| 165 | - 'The %s "%s" with ID "%s" has been unshared from the email recipient "%s" (Share ID: %s)', |
|
| 166 | - $params, |
|
| 167 | - [ |
|
| 168 | - 'itemType', |
|
| 169 | - 'fileTarget', |
|
| 170 | - 'itemSource', |
|
| 171 | - 'shareWith', |
|
| 172 | - 'id', |
|
| 173 | - ] |
|
| 174 | - ); |
|
| 175 | - } |
|
| 176 | - } |
|
| 110 | + /** |
|
| 111 | + * Logs unsharing of data |
|
| 112 | + * |
|
| 113 | + * @param array $params |
|
| 114 | + */ |
|
| 115 | + public function unshare(array $params) { |
|
| 116 | + if($params['shareType'] === Share::SHARE_TYPE_LINK) { |
|
| 117 | + $this->log( |
|
| 118 | + 'The %s "%s" with ID "%s" has been unshared (Share ID: %s)', |
|
| 119 | + $params, |
|
| 120 | + [ |
|
| 121 | + 'itemType', |
|
| 122 | + 'fileTarget', |
|
| 123 | + 'itemSource', |
|
| 124 | + 'id', |
|
| 125 | + ] |
|
| 126 | + ); |
|
| 127 | + } elseif($params['shareType'] === Share::SHARE_TYPE_USER) { |
|
| 128 | + $this->log( |
|
| 129 | + 'The %s "%s" with ID "%s" has been unshared from the user "%s" (Share ID: %s)', |
|
| 130 | + $params, |
|
| 131 | + [ |
|
| 132 | + 'itemType', |
|
| 133 | + 'fileTarget', |
|
| 134 | + 'itemSource', |
|
| 135 | + 'shareWith', |
|
| 136 | + 'id', |
|
| 137 | + ] |
|
| 138 | + ); |
|
| 139 | + } elseif($params['shareType'] === Share::SHARE_TYPE_GROUP) { |
|
| 140 | + $this->log( |
|
| 141 | + 'The %s "%s" with ID "%s" has been unshared from the group "%s" (Share ID: %s)', |
|
| 142 | + $params, |
|
| 143 | + [ |
|
| 144 | + 'itemType', |
|
| 145 | + 'fileTarget', |
|
| 146 | + 'itemSource', |
|
| 147 | + 'shareWith', |
|
| 148 | + 'id', |
|
| 149 | + ] |
|
| 150 | + ); |
|
| 151 | + } elseif($params['shareType'] === Share::SHARE_TYPE_ROOM) { |
|
| 152 | + $this->log( |
|
| 153 | + 'The %s "%s" with ID "%s" has been unshared from the room "%s" (Share ID: %s)', |
|
| 154 | + $params, |
|
| 155 | + [ |
|
| 156 | + 'itemType', |
|
| 157 | + 'fileTarget', |
|
| 158 | + 'itemSource', |
|
| 159 | + 'shareWith', |
|
| 160 | + 'id', |
|
| 161 | + ] |
|
| 162 | + ); |
|
| 163 | + } elseif($params['shareType'] === Share::SHARE_TYPE_EMAIL) { |
|
| 164 | + $this->log( |
|
| 165 | + 'The %s "%s" with ID "%s" has been unshared from the email recipient "%s" (Share ID: %s)', |
|
| 166 | + $params, |
|
| 167 | + [ |
|
| 168 | + 'itemType', |
|
| 169 | + 'fileTarget', |
|
| 170 | + 'itemSource', |
|
| 171 | + 'shareWith', |
|
| 172 | + 'id', |
|
| 173 | + ] |
|
| 174 | + ); |
|
| 175 | + } |
|
| 176 | + } |
|
| 177 | 177 | |
| 178 | - /** |
|
| 179 | - * Logs the updating of permission changes for shares |
|
| 180 | - * |
|
| 181 | - * @param array $params |
|
| 182 | - */ |
|
| 183 | - public function updatePermissions(array $params) { |
|
| 184 | - $this->log( |
|
| 185 | - 'The permissions of the shared %s "%s" with ID "%s" have been changed to "%s"', |
|
| 186 | - $params, |
|
| 187 | - [ |
|
| 188 | - 'itemType', |
|
| 189 | - 'path', |
|
| 190 | - 'itemSource', |
|
| 191 | - 'permissions', |
|
| 192 | - ] |
|
| 193 | - ); |
|
| 194 | - } |
|
| 178 | + /** |
|
| 179 | + * Logs the updating of permission changes for shares |
|
| 180 | + * |
|
| 181 | + * @param array $params |
|
| 182 | + */ |
|
| 183 | + public function updatePermissions(array $params) { |
|
| 184 | + $this->log( |
|
| 185 | + 'The permissions of the shared %s "%s" with ID "%s" have been changed to "%s"', |
|
| 186 | + $params, |
|
| 187 | + [ |
|
| 188 | + 'itemType', |
|
| 189 | + 'path', |
|
| 190 | + 'itemSource', |
|
| 191 | + 'permissions', |
|
| 192 | + ] |
|
| 193 | + ); |
|
| 194 | + } |
|
| 195 | 195 | |
| 196 | - /** |
|
| 197 | - * Logs the password changes for a share |
|
| 198 | - * |
|
| 199 | - * @param array $params |
|
| 200 | - */ |
|
| 201 | - public function updatePassword(array $params) { |
|
| 202 | - $this->log( |
|
| 203 | - 'The password of the publicly shared %s "%s" with ID "%s" has been changed', |
|
| 204 | - $params, |
|
| 205 | - [ |
|
| 206 | - 'itemType', |
|
| 207 | - 'token', |
|
| 208 | - 'itemSource', |
|
| 209 | - ] |
|
| 210 | - ); |
|
| 211 | - } |
|
| 196 | + /** |
|
| 197 | + * Logs the password changes for a share |
|
| 198 | + * |
|
| 199 | + * @param array $params |
|
| 200 | + */ |
|
| 201 | + public function updatePassword(array $params) { |
|
| 202 | + $this->log( |
|
| 203 | + 'The password of the publicly shared %s "%s" with ID "%s" has been changed', |
|
| 204 | + $params, |
|
| 205 | + [ |
|
| 206 | + 'itemType', |
|
| 207 | + 'token', |
|
| 208 | + 'itemSource', |
|
| 209 | + ] |
|
| 210 | + ); |
|
| 211 | + } |
|
| 212 | 212 | |
| 213 | - /** |
|
| 214 | - * Logs the expiration date changes for a share |
|
| 215 | - * |
|
| 216 | - * @param array $params |
|
| 217 | - */ |
|
| 218 | - public function updateExpirationDate(array $params) { |
|
| 219 | - $this->log( |
|
| 220 | - 'The expiration date of the publicly shared %s with ID "%s" has been changed to "%s"', |
|
| 221 | - $params, |
|
| 222 | - [ |
|
| 223 | - 'itemType', |
|
| 224 | - 'itemSource', |
|
| 225 | - 'date', |
|
| 226 | - ] |
|
| 227 | - ); |
|
| 228 | - } |
|
| 213 | + /** |
|
| 214 | + * Logs the expiration date changes for a share |
|
| 215 | + * |
|
| 216 | + * @param array $params |
|
| 217 | + */ |
|
| 218 | + public function updateExpirationDate(array $params) { |
|
| 219 | + $this->log( |
|
| 220 | + 'The expiration date of the publicly shared %s with ID "%s" has been changed to "%s"', |
|
| 221 | + $params, |
|
| 222 | + [ |
|
| 223 | + 'itemType', |
|
| 224 | + 'itemSource', |
|
| 225 | + 'date', |
|
| 226 | + ] |
|
| 227 | + ); |
|
| 228 | + } |
|
| 229 | 229 | |
| 230 | - /** |
|
| 231 | - * Logs access of shared files |
|
| 232 | - * |
|
| 233 | - * @param array $params |
|
| 234 | - */ |
|
| 235 | - public function shareAccessed(array $params) { |
|
| 236 | - $this->log( |
|
| 237 | - 'The shared %s with the token "%s" by "%s" has been accessed.', |
|
| 238 | - $params, |
|
| 239 | - [ |
|
| 240 | - 'itemType', |
|
| 241 | - 'token', |
|
| 242 | - 'uidOwner', |
|
| 243 | - ] |
|
| 244 | - ); |
|
| 245 | - } |
|
| 230 | + /** |
|
| 231 | + * Logs access of shared files |
|
| 232 | + * |
|
| 233 | + * @param array $params |
|
| 234 | + */ |
|
| 235 | + public function shareAccessed(array $params) { |
|
| 236 | + $this->log( |
|
| 237 | + 'The shared %s with the token "%s" by "%s" has been accessed.', |
|
| 238 | + $params, |
|
| 239 | + [ |
|
| 240 | + 'itemType', |
|
| 241 | + 'token', |
|
| 242 | + 'uidOwner', |
|
| 243 | + ] |
|
| 244 | + ); |
|
| 245 | + } |
|
| 246 | 246 | } |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | * @param array $params |
| 41 | 41 | */ |
| 42 | 42 | public function shared(array $params) { |
| 43 | - if($params['shareType'] === Share::SHARE_TYPE_LINK) { |
|
| 43 | + if ($params['shareType'] === Share::SHARE_TYPE_LINK) { |
|
| 44 | 44 | $this->log( |
| 45 | 45 | 'The %s "%s" with ID "%s" has been shared via link with permissions "%s" (Share ID: %s)', |
| 46 | 46 | $params, |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | 'id', |
| 53 | 53 | ] |
| 54 | 54 | ); |
| 55 | - } elseif($params['shareType'] === Share::SHARE_TYPE_USER) { |
|
| 55 | + } elseif ($params['shareType'] === Share::SHARE_TYPE_USER) { |
|
| 56 | 56 | $this->log( |
| 57 | 57 | 'The %s "%s" with ID "%s" has been shared to the user "%s" with permissions "%s" (Share ID: %s)', |
| 58 | 58 | $params, |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | 'id', |
| 66 | 66 | ] |
| 67 | 67 | ); |
| 68 | - } elseif($params['shareType'] === Share::SHARE_TYPE_GROUP) { |
|
| 68 | + } elseif ($params['shareType'] === Share::SHARE_TYPE_GROUP) { |
|
| 69 | 69 | $this->log( |
| 70 | 70 | 'The %s "%s" with ID "%s" has been shared to the group "%s" with permissions "%s" (Share ID: %s)', |
| 71 | 71 | $params, |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | 'id', |
| 79 | 79 | ] |
| 80 | 80 | ); |
| 81 | - } elseif($params['shareType'] === Share::SHARE_TYPE_ROOM) { |
|
| 81 | + } elseif ($params['shareType'] === Share::SHARE_TYPE_ROOM) { |
|
| 82 | 82 | $this->log( |
| 83 | 83 | 'The %s "%s" with ID "%s" has been shared to the room "%s" with permissions "%s" (Share ID: %s)', |
| 84 | 84 | $params, |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | 'id', |
| 92 | 92 | ] |
| 93 | 93 | ); |
| 94 | - } elseif($params['shareType'] === Share::SHARE_TYPE_EMAIL) { |
|
| 94 | + } elseif ($params['shareType'] === Share::SHARE_TYPE_EMAIL) { |
|
| 95 | 95 | $this->log( |
| 96 | 96 | 'The %s "%s" with ID "%s" has been shared to the email recipient "%s" with permissions "%s" (Share ID: %s)', |
| 97 | 97 | $params, |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | * @param array $params |
| 114 | 114 | */ |
| 115 | 115 | public function unshare(array $params) { |
| 116 | - if($params['shareType'] === Share::SHARE_TYPE_LINK) { |
|
| 116 | + if ($params['shareType'] === Share::SHARE_TYPE_LINK) { |
|
| 117 | 117 | $this->log( |
| 118 | 118 | 'The %s "%s" with ID "%s" has been unshared (Share ID: %s)', |
| 119 | 119 | $params, |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | 'id', |
| 125 | 125 | ] |
| 126 | 126 | ); |
| 127 | - } elseif($params['shareType'] === Share::SHARE_TYPE_USER) { |
|
| 127 | + } elseif ($params['shareType'] === Share::SHARE_TYPE_USER) { |
|
| 128 | 128 | $this->log( |
| 129 | 129 | 'The %s "%s" with ID "%s" has been unshared from the user "%s" (Share ID: %s)', |
| 130 | 130 | $params, |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | 'id', |
| 137 | 137 | ] |
| 138 | 138 | ); |
| 139 | - } elseif($params['shareType'] === Share::SHARE_TYPE_GROUP) { |
|
| 139 | + } elseif ($params['shareType'] === Share::SHARE_TYPE_GROUP) { |
|
| 140 | 140 | $this->log( |
| 141 | 141 | 'The %s "%s" with ID "%s" has been unshared from the group "%s" (Share ID: %s)', |
| 142 | 142 | $params, |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | 'id', |
| 149 | 149 | ] |
| 150 | 150 | ); |
| 151 | - } elseif($params['shareType'] === Share::SHARE_TYPE_ROOM) { |
|
| 151 | + } elseif ($params['shareType'] === Share::SHARE_TYPE_ROOM) { |
|
| 152 | 152 | $this->log( |
| 153 | 153 | 'The %s "%s" with ID "%s" has been unshared from the room "%s" (Share ID: %s)', |
| 154 | 154 | $params, |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | 'id', |
| 161 | 161 | ] |
| 162 | 162 | ); |
| 163 | - } elseif($params['shareType'] === Share::SHARE_TYPE_EMAIL) { |
|
| 163 | + } elseif ($params['shareType'] === Share::SHARE_TYPE_EMAIL) { |
|
| 164 | 164 | $this->log( |
| 165 | 165 | 'The %s "%s" with ID "%s" has been unshared from the email recipient "%s" (Share ID: %s)', |
| 166 | 166 | $params, |