recusfiscaux/admin/upload.php

25 lines
619 B
PHP

<?php
namespace Paheko;
session_start();
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.');
}
// checkCreateAccess n'existe plus...
*/
$csrf_key = 'upload_file_' . md5($parent);
$form->runIf('upload', function () use ($parent) {
$_SESSION['sig_file'] = \Paheko\Files\Files::uploadMultiple($parent, 'file');
}, $csrf_key, PLUGIN_ROOT . '/admin/config.php');
$tpl->assign(compact('parent', 'csrf_key'));
$tpl->display(PLUGIN_ROOT . '/templates/upload.tpl');