Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
don
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
25
Issues
25
List
Boards
Labels
Service Desk
Milestones
Merge Requests
5
Merge Requests
5
Operations
Operations
Incidents
Environments
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
LQDN Adminsys
don
Commits
82a3949c
Verified
Commit
82a3949c
authored
Oct 13, 2018
by
Guinness
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix receipt.pdf being outdated + fix paths.
parent
213037a8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
app/controller/perso.php
app/controller/perso.php
+6
-6
www/receipt.pdf
www/receipt.pdf
+0
-0
No files found.
app/controller/perso.php
View file @
82a3949c
...
@@ -408,7 +408,7 @@ class Perso extends Controller
...
@@ -408,7 +408,7 @@ class Perso extends Controller
$db
=
$f3
->
get
(
'DB'
);
$db
=
$f3
->
get
(
'DB'
);
$id
=
$params
[
'id'
];
$id
=
$params
[
'id'
];
$command
=
"pdftk "
;
$command
=
"pdftk "
;
$args
=
" ./receipt.pdf fill_form
tmp/"
.
$id
.
".xfdf output
tmp/"
.
$id
.
".pdf flatten dont_ask"
;
$args
=
" ./receipt.pdf fill_form
../tmp/"
.
$id
.
".xfdf output ../
tmp/"
.
$id
.
".pdf flatten dont_ask"
;
$logger
->
write
(
$command
.
" "
.
$args
);
$logger
->
write
(
$command
.
" "
.
$args
);
// Vérification que le don appartient bien à l'utilisateur connecté
// Vérification que le don appartient bien à l'utilisateur connecté
...
@@ -472,7 +472,7 @@ class Perso extends Controller
...
@@ -472,7 +472,7 @@ class Perso extends Controller
</field>
</field>
</fields>
</fields>
</xfdf>'
;
</xfdf>'
;
$fp
=
fopen
(
"tmp/"
.
$id
.
".xfdf"
,
"w"
);
$fp
=
fopen
(
"
../
tmp/"
.
$id
.
".xfdf"
,
"w"
);
if
(
$fp
)
{
if
(
$fp
)
{
fputs
(
$fp
,
$content
);
fputs
(
$fp
,
$content
);
fclose
(
$fp
);
fclose
(
$fp
);
...
@@ -483,12 +483,12 @@ class Perso extends Controller
...
@@ -483,12 +483,12 @@ class Perso extends Controller
exec
(
$command
.
$args
,
$output
);
exec
(
$command
.
$args
,
$output
);
// Suppression du fichier datas
// Suppression du fichier datas
unlink
(
"tmp/"
.
$id
.
".xfdf"
);
unlink
(
"
../
tmp/"
.
$id
.
".xfdf"
);
// Renvoi du fichier pdf au client
// Renvoi du fichier pdf au client
$fp
=
fopen
(
"tmp/"
.
$id
.
".pdf"
,
"rb"
);
$fp
=
fopen
(
"
../
tmp/"
.
$id
.
".pdf"
,
"rb"
);
if
(
$fp
)
{
if
(
$fp
)
{
$fsize
=
filesize
(
"tmp/"
.
$id
.
".pdf"
);
$fsize
=
filesize
(
"
../
tmp/"
.
$id
.
".pdf"
);
header
(
"Content-Type: application/pdf"
);
header
(
"Content-Type: application/pdf"
);
header
(
"Content-Disposition: attachment; filename=
\"
"
.
$id
.
".pdf
\"
"
);
header
(
"Content-Disposition: attachment; filename=
\"
"
.
$id
.
".pdf
\"
"
);
header
(
"Content-Length:
$fsize
"
);
header
(
"Content-Length:
$fsize
"
);
...
@@ -502,7 +502,7 @@ class Perso extends Controller
...
@@ -502,7 +502,7 @@ class Perso extends Controller
}
}
// Suppression du fichier reçu
// Suppression du fichier reçu
unlink
(
"tmp/"
.
$id
.
".pdf"
);
unlink
(
"
../
tmp/"
.
$id
.
".pdf"
);
die
();
die
();
}
}
...
...
www/receipt.pdf
0 → 100644
View file @
82a3949c
File added
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment