Skip to content

Commit 9953392

Browse files
committed
feat: add envelope feature validation
- Validate envelope_enabled config before creating envelopes - Throw descriptive exception when feature is disabled - Keep original error message for maximum files exceeded Signed-off-by: Vitor Mattos <[email protected]>
1 parent 5ada404 commit 9953392

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

lib/Service/EnvelopeService.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@
1919
use OCP\IL10N;
2020
use Sabre\DAV\UUIDUtil;
2121

22-
/**
23-
* Manage envelopes (DocuSign-style digital containers for multiple documents)
24-
*/
2522
class EnvelopeService {
2623
public function __construct(
2724
protected FileMapper $fileMapper,

lib/Service/RequestSignatureService.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ public function save(array $data): FileEntity {
7575
}
7676

7777
public function saveEnvelope(array $data): array {
78+
$isEnabled = $this->appConfig->getValueBool(Application::APP_ID, 'envelope_enabled', true);
79+
if (!$isEnabled) {
80+
throw new \Exception($this->l10n->t('Envelope feature is disabled'));
81+
}
82+
7883
$envelopeName = $data['name'] ?: $this->l10n->t('Envelope %s', [date('Y-m-d H:i:s')]);
7984
$userManager = $data['userManager'] ?? null;
8085
$userId = $userManager instanceof IUser ? $userManager->getUID() : null;

0 commit comments

Comments
 (0)