recusfiscaux/admin/upload.php
engel b2885f3c01 Changement namespace Garradin => Paheko
FossilOrigin-Name: 05bd9b85d91af38c15952ea00891080a67e21c8e00ce3acf16c7b8263dc55d2c
2023-09-28 11:20:36 +00:00

22 lines
548 B
PHP

<?php
namespace Paheko;
use Paheko\Entities\Files\File;
use Paheko\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');