[stable32] feat: Sign usign only PHP#7125
Merged
vitormattos merged 41 commits intostable32from Mar 5, 2026
Merged
Conversation
Signed-off-by: Vitor Mattos <vitor@php.rio>
Signed-off-by: Vitor Mattos <vitor@php.rio>
Signed-off-by: Vitor Mattos <vitor@php.rio>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
- Reduce line height from 1.2× to 1.15× font size for tighter spacing - Set top padding to 0.35× line height to match JSignPdf output - Ensures visual parity with JSignPdf's iText-based text rendering Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
- Replace string literal 'GRAPHIC_ONLY' with SignerElementsService::RENDER_MODE_GRAPHIC_ONLY - Improves code consistency and maintainability Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
- Use date_default_timezone_get() instead of hardcoded UTC - Ensures ServerSignatureDate reflects actual server timezone configuration - Captures date at rendering time, not during params preparation Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
- ServerSignatureDate is now injected at rendering time by each handler
- PhpNativeHandler uses server timezone
- JSignPdfHandler uses ${timestamp} placeholder
- Ensures proper timezone handling for each implementation
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
- LocalSignerSignatureDateTime now uses user's timezone, not UTC - Correctly reflects 'Local' in variable name - Use date_default_timezone_get() for user's configured timezone - LocalSignerTimezone parameter indicates which timezone was used Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
…ervice - Replace string literal 'GRAPHIC_ONLY' with SignerElementsService::RENDER_MODE_GRAPHIC_ONLY - Add SignerElementsService import - Improves code consistency across codebase Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
- New render mode for PhpNativeHandler to show signature without description text - Full canvas displays signature drawing with watermark background - Extends existing JSignPdf render modes for PHP-only signing Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
…bject text operators Remove Imagick/ITempManager dependencies from PhpNativeHandler. All render modes now produce a SignatureAppearanceXObjectDto carrying PDF text stream operators instead of compositing raster images. The paradoxical-condition psalm issue is also resolved here - the max(0.0,...) guard was removed so the inner overflow check can fire. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
…pearance branch Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Covers: wrapTextForPdf (4 cases), escapePdfText (5 cases), hasExistingSignatures (5 cases), buildTimestampOptions (4 cases), resolveCertificationLevel (4 cases), buildAppearanceForElement signature image placement (2 cases), buildXObject layout per render mode (4 cases). Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
…signature params Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
…x-start Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
…re without placed elements When admin sets GRAPHIC_ONLY render mode (canCreateSignature=true), the signer must draw their signature even if no visual element box was placed on the document. The previous check required visibleElements.some(...) which returned false for documents with no placed boxes, silently skipping the drawing prompt. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
… elements needsCreateSignature previously required visibleElements.some(...) to be true, meaning it only triggered when the document had a pre-placed visual element box for the signer. With GRAPHIC_ONLY render mode (canCreateSignature=true) and no placed box, the check always returned false and the drawing prompt was never shown. Fix: when signerHasSignRequest=true is provided, return true immediately after confirming the signer has a signRequestId — the visual box placement is irrelevant for deciding whether to ask for a drawing. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
…ement needCreateSignature computed was duplicating the validator logic and also required a placed visual element box, so it returned false for clickToSign documents in GRAPHIC_ONLY mode. Added signerHasSignRequest computed (true when the current user has a signRequestId) and pass it to requirementValidator.getFirstUnmetRequirement() in both confirmSignDocument and executeSigningAction so the validator can prompt for the signature drawing even when no element box was placed. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com> [skip ci]
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #2595
Warning, This backport's changes differ from the original and might be incomplete⚠️
Todo
Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.