Your IP : 216.73.217.64


Current Path : /home3/gp97/jscb.97gp.net/data/plugins/pim/admin/
Upload File :
Current File : //home3/gp97/jscb.97gp.net/data/plugins/pim/admin/upload.php

<?php

namespace Paheko\Plugin\PIM;

use Paheko\UserException;
use Paheko\Utils;
use Paheko\Users\Session;

require __DIR__ . '/_inc.php';

$events = new Events(Session::getUserId());

$csrf_key = 'upload_file';

$form->runIf('upload', function () use ($events) {
	if (empty($_FILES['file']['tmp_name'])) {
		throw new UserException('Erreur à l\'envoi');
	}

	$events->importFile($_FILES['file']['tmp_name']);
}, $csrf_key, './');

$tpl->assign(compact('csrf_key'));

$tpl->display(__DIR__ . '/../templates/upload.tpl');