Skip to content
Permalink
Browse files

Les types de fichiers acceptés à l'import otx sont définis dans lodel…

…config, une valeur par défaut est donnée dans oochargement.php en cas d'absence dans lodelconfig
  • Loading branch information...
lnprieto committed Apr 16, 2019
1 parent d12012b commit 85cc0ff374aa31fed6e141a3d935666f5ccf5d00
Showing with 8 additions and 3 deletions.
  1. +4 −3 lodel/src/lodel/edition/oochargement.php
  2. +4 −0 lodelconfig-default.php
@@ -123,6 +123,7 @@ function printErrors($errors, $exit = true, $isFrame = true)
if($isFrame) printJavascript("window.parent.o.changeStep(1);");
$auth_imp = C::get('authorized_import', 'cfg') ? C::get('authorized_import', 'cfg') : array('doc', 'rtf', 'sxw', 'odt');
set_time_limit(0);
$sources = $context['urls'] = array();
$ext = strtolower(pathinfo($sourceoriginale, PATHINFO_EXTENSION));
@@ -196,7 +197,7 @@ function printErrors($errors, $exit = true, $isFrame = true)
{
foreach($extracted_files as $file)
{
if(in_array(strtolower(pathinfo($file, PATHINFO_EXTENSION)), array('doc', 'sxw', 'odt', 'rtf')))
if(in_array(strtolower(pathinfo($file, PATHINFO_EXTENSION)), $auth_imp))
{
$tmp = tmpdir(uniqid('import_', true));
rename($oldtmpdir . DIRECTORY_SEPARATOR . $file, $tmp . DIRECTORY_SEPARATOR . $file);
@@ -281,9 +282,9 @@ function removefilesfromimport($rep)
die;
}
elseif(!in_array($ext, array('doc', 'sxw', 'odt', 'rtf')))
elseif(!in_array($ext, $auth_imp))
{
printErrors('Invalid file type for document <em>'.$sourceoriginale.'</em>, authorized are .doc, .sxw, .odt, .rtf', true, $isFrame);
printErrors('Invalid file type for document <em>'.$sourceoriginale.'</em>, authorized are '.implode(', ', $auth_imp), true, $isFrame);
}
elseif(!empty($context['multiple']))
{
@@ -176,6 +176,10 @@
//tableau des types de fichiers acceptés à l'upload
$cfg['authorizedFiles'] = array( '.png', '.gif', '.jpg', '.jpeg', '.tif', '.doc', '.odt', '.ods', '.odp', '.pdf', '.ppt', '.sxw', '.xls', '.rtf', '.zip', '.gz', '.ps', '.ai', '.eps', '.swf', '.rar', '.mpg', '.mpeg', '.avi', '.asf', '.flv', '.wmv', '.docx', '.xlsx', '.pptx', '.mp3', '.mp4', '.ogg', '.xml');
// Types de fichiers autorisés à l'import par otx
$cfg['authorized_import'] = array('doc', 'docx', 'sxw', 'odt', 'rtf');
// lock les tables.
// Chez certains hebergeurs n'acceptent pas les LOCK

0 comments on commit 85cc0ff

Please sign in to comment.
You can’t perform that action at this time.