Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MaarchParapheur
Manage
Activity
Members
Plan
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maarch
MaarchParapheur
Commits
3e2ae47a
Verified
Commit
3e2ae47a
authored
4 years ago
by
Florian Azizian
Browse files
Options
Downloads
Patches
Plain Diff
FIX #14565 TIME 0:00 Sign document with certificate
parent
fb5f9fef
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/app/document/controllers/CertificateSignatureController.php
+26
-2
26 additions, 2 deletions
...p/document/controllers/CertificateSignatureController.php
with
26 additions
and
2 deletions
src/app/document/controllers/CertificateSignatureController.php
+
26
−
2
View file @
3e2ae47a
...
...
@@ -14,6 +14,7 @@
namespace
Document\controllers
;
use
Docserver\controllers\DocserverController
;
use
Docserver\models\AdrModel
;
use
Docserver\models\DocserverModel
;
use
SrcCore\models\CoreConfigModel
;
...
...
@@ -153,11 +154,34 @@ class CertificateSignatureController
$signer
->
saveSignature
(
$tmpDocument
,
$cms
);
try
{
$signer
->
saveSignature
(
$tmpDocument
,
$cms
);
unlink
(
$tmpDocument
->
getWriter
()
->
getPath
());
//
unlink($tmpDocument->getWriter()->getPath());
}
catch
(
\SetaPDF_Signer_Exception_ContentLength
$e
)
{
unlink
(
$tmpDocument
->
getWriter
()
->
getPath
());
//
unlink($tmpDocument->getWriter()->getPath());
$signatureContentLength
=
$signatureContentLength
+
1000
;
return
[
'errors'
=>
'Not enought space for signature'
,
'newSignatureLength'
=>
$signatureContentLength
];
}
$storeInfos
=
DocserverController
::
storeResourceOnDocServer
([
'encodedFile'
=>
base64_encode
(
file_get_contents
(
$signedDocumentPath
)),
'format'
=>
'pdf'
,
'docserverType'
=>
'ESIGN'
]);
// if (!empty($storeInfos['errors'])) {
// return ['errors' => $storeInfos['errors']];
// }
AdrModel
::
deleteDocumentAdr
([
'where'
=>
[
'main_document_id = ?'
,
'type = ?'
],
'data'
=>
[
$args
[
'id'
],
'ESIGN'
]
]);
AdrModel
::
createDocumentAdr
([
'documentId'
=>
$args
[
'id'
],
'type'
=>
'ESIGN'
,
'path'
=>
$storeInfos
[
'path'
],
'filename'
=>
$storeInfos
[
'filename'
],
'fingerprint'
=>
$storeInfos
[
'fingerprint'
]
]);
// unlink($signedDocumentPath);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment