diff --git a/.gitignore b/.gitignore index 22928c6..e88db5b 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ package-lock.json package.json node_modules tests/downloads/ +config/config.ini diff --git a/app.php b/app.php index 2ad61c9..f944297 100644 --- a/app.php +++ b/app.php @@ -10,7 +10,12 @@ $f3->set('XFRAME', null); // Allow use in an iframe $f3->set('ROOT', __DIR__); $f3->set('UI', $f3->get('ROOT')."/templates/"); $f3->set('UPLOADS', sys_get_temp_dir()."/"); -$f3->set('STORAGE', sys_get_temp_dir()."/pdf/"); +$f3->config(__DIR__.'/config/config.ini'); + + +if($f3->get('STORAGE') && !preg_match('|/$|', $f3->get('STORAGE'))) { + $f3->set('STORAGE', $f3->get('STORAGE').'/'); +} function convertPHPSizeToBytes($sSize) { @@ -50,6 +55,9 @@ $f3->route('GET /signature', $f3->set('maxSize', min(array(convertPHPSizeToBytes(ini_get('post_max_size')), convertPHPSizeToBytes(ini_get('upload_max_filesize'))))); $f3->set('maxPage', ini_get('max_file_uploads') - 1); + if(!$f3->get('STORAGE')) { + $f3->set('noSharingMode', true); + } echo View::instance()->render('signature.html.php'); } ); diff --git a/config/config.ini.example b/config/config.ini.example new file mode 100644 index 0000000..784a9fa --- /dev/null +++ b/config/config.ini.example @@ -0,0 +1,5 @@ +[globals] + +# Path to which stored pdf to activate the mode of sharing a signature to several. +# To deactivate this mode, simply do not configure it or leave it empty +STORAGE=/path/to/folder \ No newline at end of file diff --git a/templates/signature.html.php b/templates/signature.html.php index 773e30a..3bbdec9 100644 --- a/templates/signature.html.php +++ b/templates/signature.html.php @@ -78,6 +78,7 @@
+
@@ -85,12 +86,13 @@
+
- +

Vous êtes 0 à avoir signé ce PDF

Télécharger le PDF