recusfiscaux/www/admin/upload.php
engel 26c113349a ajouts fichiers oubliés ; suppression fichiers inutiles
FossilOrigin-Name: 28fb218f925df004a6471dfeb2df98aac1da5c505559adf051425ac76cc1dead
2022-02-25 17:07:24 +00:00

24 lines
582 B
PHP

<?php
namespace Garradin;
use Garradin\Entities\Files\File;
use Garradin\Files\Files;
$parent = qg('p');
if (!File::checkCreateAccess($parent, $session)) {
throw new UserException('Vous n\'avez pas le droit d\'ajouter de fichier.');
}
$csrf_key = 'upload_file_' . md5($parent);
$form->runIf('upload', function () use ($parent) {
$sig_file = File::uploadMultiple($parent, 'file');
$_SESSION['sig_file'] = $sig_file;
}, $csrf_key, PLUGIN_ROOT . '/www/admin/config.php');
$tpl->assign(compact('parent', 'csrf_key'));
$tpl->display(PLUGIN_ROOT . '/templates/upload.tpl');