(string $token, ?string $providedPass, string $subPath = '')
| 2716 | } |
| 2717 | |
| 2718 | public static function getSharedUploadContext(string $token, ?string $providedPass, string $subPath = ''): array |
| 2719 | { |
| 2720 | $ctx = self::resolveSharedFolderContext($token, $providedPass, $subPath, false); |
| 2721 | if (isset($ctx['error']) || isset($ctx['needs_password'])) { |
| 2722 | return $ctx; |
| 2723 | } |
| 2724 | $record = is_array($ctx['record'] ?? null) ? $ctx['record'] : []; |
| 2725 | if (empty($record['allowUpload']) || (int)$record['allowUpload'] !== 1) { |
| 2726 | return ['error' => 'File uploads are not allowed for this share.']; |
| 2727 | } |
| 2728 | return $ctx; |
| 2729 | } |
| 2730 | |
| 2731 | /** |
| 2732 | * Creates a share link for a folder. |
no test coverage detected