@@ -103,7 +103,7 @@ |
||
| 103 | 103 | //'FileSharingUrl' => null, |
| 104 | 104 | //'FileUrl' => null, |
| 105 | 105 | 'FileVersionPostMessage' => true, |
| 106 | - // 'FileSharingPostMessage' => null, |
|
| 106 | + // 'FileSharingPostMessage' => null, |
|
| 107 | 107 | 'PostMessageOrigin' => $this->session['client'], |
| 108 | 108 | 'OwnerId' => (string) $this->file->getOwner(), |
| 109 | 109 | 'ReadOnly' => $this->file->isReadonly(), |
@@ -85,6 +85,6 @@ |
||
| 85 | 85 | protected function getTemplate(): string |
| 86 | 86 | { |
| 87 | 87 | return __DIR__.DIRECTORY_SEPARATOR.'assets' |
| 88 | - .DIRECTORY_SEPARATOR.'template.'.$this->type; |
|
| 88 | + .DIRECTORY_SEPARATOR.'template.'.$this->type; |
|
| 89 | 89 | } |
| 90 | 90 | } |
@@ -161,7 +161,7 @@ |
||
| 161 | 161 | $tpl = new Template($type); |
| 162 | 162 | |
| 163 | 163 | $attributes = compact('readonly', 'meta'); |
| 164 | - $attributes = array_filter($attributes, function ($attribute) {return !is_null($attribute); }); |
|
| 164 | + $attributes = array_filter($attributes, function($attribute) {return !is_null($attribute); }); |
|
| 165 | 165 | |
| 166 | 166 | $stream = $tpl->get(); |
| 167 | 167 | $storage = $parent->getStorage(); |
@@ -263,7 +263,7 @@ |
||
| 263 | 263 | $response = (new Response()) |
| 264 | 264 | ->setCode(200) |
| 265 | 265 | ->setHeader('X-WOPI-ItemVersion', (string) $file->getVersion()) |
| 266 | - ->setBody(function () use ($stream) { |
|
| 266 | + ->setBody(function() use ($stream) { |
|
| 267 | 267 | if ($stream === null) { |
| 268 | 268 | echo ''; |
| 269 | 269 | |
@@ -260,7 +260,7 @@ |
||
| 260 | 260 | $response = $this->client->request( |
| 261 | 261 | 'GET', |
| 262 | 262 | $url |
| 263 | - ); |
|
| 263 | + ); |
|
| 264 | 264 | |
| 265 | 265 | $body = $response->getBody()->getContents(); |
| 266 | 266 | $body = json_decode(json_encode(simplexml_load_string($body), JSON_THROW_ON_ERROR), true, 512, JSON_THROW_ON_ERROR | JSON_OBJECT_AS_ARRAY); |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | ->prependRoute(new Route('/api/v2/files/preview(/|\z)', v2\Preview::class)) |
| 32 | 32 | ->prependRoute(new Route('/api/v2/files/{id:#([0-9a-z]{24})#}/preview(/|\z)', v2\Preview::class)); |
| 33 | 33 | |
| 34 | - $decorator->addDecorator('preview', function ($node) { |
|
| 34 | + $decorator->addDecorator('preview', function($node) { |
|
| 35 | 35 | if ($node instanceof Collection) { |
| 36 | 36 | return null; |
| 37 | 37 | } |
@@ -62,10 +62,10 @@ |
||
| 62 | 62 | |
| 63 | 63 | // Public Key Credential Request Options |
| 64 | 64 | $key = new PublicKeyCredentialRequestOptions( |
| 65 | - random_bytes(32), // Challenge |
|
| 66 | - 60000, // Timeout |
|
| 67 | - $domain, // Relying Party ID |
|
| 68 | - $registeredPublicKeyCredentialDescriptors, // Registered PublicKeyCredentialDescriptor classes |
|
| 65 | + random_bytes(32), // Challenge |
|
| 66 | + 60000, // Timeout |
|
| 67 | + $domain, // Relying Party ID |
|
| 68 | + $registeredPublicKeyCredentialDescriptors, // Registered PublicKeyCredentialDescriptor classes |
|
| 69 | 69 | PublicKeyCredentialRequestOptions::USER_VERIFICATION_REQUIREMENT_PREFERRED, // User verification requirement |
| 70 | 70 | $this->auth_extensions |
| 71 | 71 | ); |
@@ -97,13 +97,13 @@ discard block |
||
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | return [ |
| 100 | - 'created' => function ($role) use ($attributes) { |
|
| 100 | + 'created' => function($role) use ($attributes) { |
|
| 101 | 101 | return $attributes['created']->toDateTime()->format('c'); |
| 102 | 102 | }, |
| 103 | - 'changed' => function ($role) use ($attributes) { |
|
| 103 | + 'changed' => function($role) use ($attributes) { |
|
| 104 | 104 | return $attributes['changed']->toDateTime()->format('c'); |
| 105 | 105 | }, |
| 106 | - 'deleted' => function ($role) use ($attributes) { |
|
| 106 | + 'deleted' => function($role) use ($attributes) { |
|
| 107 | 107 | if (false === $attributes['deleted']) { |
| 108 | 108 | return null; |
| 109 | 109 | } |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | 'id' => (string) $attributes['_id'], |
| 127 | 127 | 'name' => $attributes['name'], |
| 128 | 128 | 'namespace' => isset($attributes['namespace']) ? (string) $attributes['namespace'] : null, |
| 129 | - 'member' => array_map(function ($member) { return (string) $member; }, $attributes['member']), |
|
| 129 | + 'member' => array_map(function($member) { return (string) $member; }, $attributes['member']), |
|
| 130 | 130 | ]; |
| 131 | 131 | } |
| 132 | 132 | |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | 'name' => (string) $attributes['username'], |
| 149 | 149 | 'admin' => (bool) $attributes['admin'], |
| 150 | 150 | 'namespace' => isset($attributes['namespace']) ? (string) $attributes['namespace'] : null, |
| 151 | - 'mail' => function ($role) use ($attributes, $user) { |
|
| 151 | + 'mail' => function($role) use ($attributes, $user) { |
|
| 152 | 152 | if (!isset($attributes['mail'])) { |
| 153 | 153 | return null; |
| 154 | 154 | } |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | 'locale' => isset($attributes['locale']) ? (string) $attributes['locale'] : null, |
| 163 | 163 | 'hard_quota' => isset($attributes['hard_quota']) ? (int) $attributes['hard_quota'] : null, |
| 164 | 164 | 'soft_quota' => isset($attributes['soft_quota']) ? (int) $attributes['soft_quota'] : null, |
| 165 | - 'available' => function ($role) use (&$quota, $attributes, $user) { |
|
| 165 | + 'available' => function($role) use (&$quota, $attributes, $user) { |
|
| 166 | 166 | $quota === null ? $quota = $role->getQuotaUsage() : null; |
| 167 | 167 | if ($attributes['_id'] == $user->getId() || $user->isAdmin()) { |
| 168 | 168 | return $quota['available']; |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | |
| 171 | 171 | return null; |
| 172 | 172 | }, |
| 173 | - 'used' => function ($role) use (&$quota, $attributes, $user) { |
|
| 173 | + 'used' => function($role) use (&$quota, $attributes, $user) { |
|
| 174 | 174 | $quota === null ? $quota = $role->getQuotaUsage() : null; |
| 175 | 175 | if ($attributes['_id'] == $user->getId() || $user->isAdmin()) { |
| 176 | 176 | return $quota['used']; |
@@ -178,14 +178,14 @@ discard block |
||
| 178 | 178 | |
| 179 | 179 | return null; |
| 180 | 180 | }, |
| 181 | - 'has_password' => function ($role) use ($user, $attributes) { |
|
| 181 | + 'has_password' => function($role) use ($user, $attributes) { |
|
| 182 | 182 | if ($attributes['_id'] == $user->getId() || $user->isAdmin()) { |
| 183 | 183 | return $role->hasPassword(); |
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | return null; |
| 187 | 187 | }, |
| 188 | - 'auth' => function () use ($user) { |
|
| 188 | + 'auth' => function() use ($user) { |
|
| 189 | 189 | $identity = $user->getIdentity(); |
| 190 | 190 | if ($identity === null) { |
| 191 | 191 | return null; |
@@ -113,20 +113,20 @@ discard block |
||
| 113 | 113 | 'mime' => (string) $attributes['mime'], |
| 114 | 114 | 'readonly' => (bool) $attributes['readonly'], |
| 115 | 115 | 'directory' => $node instanceof Collection, |
| 116 | - 'meta' => function ($node) { |
|
| 116 | + 'meta' => function($node) { |
|
| 117 | 117 | return (object) $node->getMetaAttributes(); |
| 118 | 118 | }, |
| 119 | - 'size' => function ($node) { |
|
| 119 | + 'size' => function($node) { |
|
| 120 | 120 | return $node->getSize(); |
| 121 | 121 | }, |
| 122 | - 'path' => function ($node) { |
|
| 122 | + 'path' => function($node) { |
|
| 123 | 123 | try { |
| 124 | 124 | return $node->getPath(); |
| 125 | 125 | } catch (\Exception $e) { |
| 126 | 126 | return null; |
| 127 | 127 | } |
| 128 | 128 | }, |
| 129 | - 'parent' => function ($node) { |
|
| 129 | + 'parent' => function($node) { |
|
| 130 | 130 | $parent = $node->getParent(); |
| 131 | 131 | |
| 132 | 132 | if (null === $parent || $parent->isRoot()) { |
@@ -135,17 +135,17 @@ discard block |
||
| 135 | 135 | |
| 136 | 136 | return $this->decorate($node->getParent(), ['id', 'name', '_links']); |
| 137 | 137 | }, |
| 138 | - 'access' => function ($node) use ($acl) { |
|
| 138 | + 'access' => function($node) use ($acl) { |
|
| 139 | 139 | return $acl->getAclPrivilege($node); |
| 140 | 140 | }, |
| 141 | - 'acl' => function ($node) use ($attributes) { |
|
| 141 | + 'acl' => function($node) use ($attributes) { |
|
| 142 | 142 | if ($node->isShareMember() && count($attributes['acl']) > 0) { |
| 143 | 143 | return $node->getAcl(); |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | return null; |
| 147 | 147 | }, |
| 148 | - 'lock' => function ($node) use ($server, $decorator, $attributes) { |
|
| 148 | + 'lock' => function($node) use ($server, $decorator, $attributes) { |
|
| 149 | 149 | if (!$node->isLocked()) { |
| 150 | 150 | return null; |
| 151 | 151 | } |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | 'id' => $lock['id'], |
| 171 | 171 | ]; |
| 172 | 172 | }, |
| 173 | - 'share' => function ($node) use ($fs) { |
|
| 173 | + 'share' => function($node) use ($fs) { |
|
| 174 | 174 | if ($node->isShared() || !$node->isSpecial()) { |
| 175 | 175 | return null; |
| 176 | 176 | } |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | return null; |
| 182 | 182 | } |
| 183 | 183 | }, |
| 184 | - 'sharename' => function ($node) { |
|
| 184 | + 'sharename' => function($node) { |
|
| 185 | 185 | if (!$node->isShared()) { |
| 186 | 186 | return null; |
| 187 | 187 | } |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | return null; |
| 193 | 193 | } |
| 194 | 194 | }, |
| 195 | - 'shareowner' => function ($node) use ($server, $fs, $decorator) { |
|
| 195 | + 'shareowner' => function($node) use ($server, $fs, $decorator) { |
|
| 196 | 196 | if (!$node->isSpecial()) { |
| 197 | 197 | return null; |
| 198 | 198 | } |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | return null; |
| 207 | 207 | } |
| 208 | 208 | }, |
| 209 | - 'owner' => function ($node) use ($server, $decorator) { |
|
| 209 | + 'owner' => function($node) use ($server, $decorator) { |
|
| 210 | 210 | try { |
| 211 | 211 | return $decorator->decorate( |
| 212 | 212 | $server->getUserById($node->getOwner()), |
@@ -227,20 +227,20 @@ discard block |
||
| 227 | 227 | protected function getTimeAttributes(NodeInterface $node, array $attributes): array |
| 228 | 228 | { |
| 229 | 229 | return [ |
| 230 | - 'created' => function ($node) use ($attributes) { |
|
| 230 | + 'created' => function($node) use ($attributes) { |
|
| 231 | 231 | return $attributes['created']->toDateTime()->format('c'); |
| 232 | 232 | }, |
| 233 | - 'changed' => function ($node) use ($attributes) { |
|
| 233 | + 'changed' => function($node) use ($attributes) { |
|
| 234 | 234 | return $attributes['changed']->toDateTime()->format('c'); |
| 235 | 235 | }, |
| 236 | - 'deleted' => function ($node) use ($attributes) { |
|
| 236 | + 'deleted' => function($node) use ($attributes) { |
|
| 237 | 237 | if (false === $attributes['deleted']) { |
| 238 | 238 | return null; |
| 239 | 239 | } |
| 240 | 240 | |
| 241 | 241 | return $attributes['deleted']->toDateTime()->format('c'); |
| 242 | 242 | }, |
| 243 | - 'destroy' => function ($node) use ($attributes) { |
|
| 243 | + 'destroy' => function($node) use ($attributes) { |
|
| 244 | 244 | if (null === $attributes['destroy']) { |
| 245 | 245 | return null; |
| 246 | 246 | } |
@@ -268,14 +268,14 @@ discard block |
||
| 268 | 268 | return [ |
| 269 | 269 | 'shared' => $node->isShared(), |
| 270 | 270 | 'reference' => $node->isReference(), |
| 271 | - 'filter' => function ($node) use ($attributes) { |
|
| 271 | + 'filter' => function($node) use ($attributes) { |
|
| 272 | 272 | if (null === $attributes['filter']) { |
| 273 | 273 | return null; |
| 274 | 274 | } |
| 275 | 275 | |
| 276 | 276 | return json_decode($attributes['filter'], true, 512, JSON_THROW_ON_ERROR); |
| 277 | 277 | }, |
| 278 | - 'mount' => function ($node) use ($fs, $attributes) { |
|
| 278 | + 'mount' => function($node) use ($fs, $attributes) { |
|
| 279 | 279 | $mount = $node->getAttributes()['mount']; |
| 280 | 280 | |
| 281 | 281 | if (!$node->isMounted() && !$node->isReference()) { |