recusfiscaux/admin/upload.php
engel bc4739877c Début restructuration pour compatibilité version 1.3 de paheko
FossilOrigin-Name: 467790c5738a867592117ea6b3a7ac6c61738dab3b8e29a48fed8f19b9df2b38
2023-09-28 09:08:46 +00:00

22 lines
554 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) {
$_SESSION['sig_file'] = File::uploadMultiple($parent, 'file');
}, $csrf_key, PLUGIN_ROOT . '/www/admin/config.php');
$tpl->assign(compact('parent', 'csrf_key'));
$tpl->display(PLUGIN_ROOT . '/templates/upload.tpl');