2022-02-25 18:07:24 +01:00
|
|
|
<?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) {
|
2022-03-02 13:38:15 +01:00
|
|
|
$_SESSION['sig_file'] = File::uploadMultiple($parent, 'file');
|
2022-02-25 18:07:24 +01:00
|
|
|
}, $csrf_key, PLUGIN_ROOT . '/www/admin/config.php');
|
|
|
|
|
|
|
|
$tpl->assign(compact('parent', 'csrf_key'));
|
|
|
|
|
|
|
|
$tpl->display(PLUGIN_ROOT . '/templates/upload.tpl');
|