Merge branch '3545' into 1.11.x

pull/3559/head
Yannick Warnier 5 years ago
commit 7776b1db49
  1. 3
      main/install/configuration.dist.php
  2. 34
      src/Chamilo/CoreBundle/Component/Editor/Driver/PersonalDriver.php

@ -1760,6 +1760,9 @@ $_configuration['auth_password_links'] = [
// Add another layer of security by checking if the user is disabled at every page load (might generate considerable extra DB load)
// $_configuration['security_block_inactive_users_immediately'] = false;
// Allow all office suite documents to be uploaded in the "My files" section of the social network
//$_configuration['social_myfiles_office_files_upload_allowed'] = false;
// KEEP THIS AT THE END
// -------- Custom DB changes
// Add user activation by confirmation email

@ -43,6 +43,7 @@ class PersonalDriver extends Driver implements DriverInterface
// Adding user personal files
$dir = \UserManager::getUserPathById($userId, 'system');
$dirWeb = \UserManager::getUserPathById($userId, 'web');
$mimeType = [
'application',
'text/html',
@ -52,6 +53,8 @@ class PersonalDriver extends Driver implements DriverInterface
'image/svg',
];
$driver = [
'driver' => 'PersonalDriver',
'alias' => get_lang('MyFiles'),
@ -75,6 +78,37 @@ class PersonalDriver extends Driver implements DriverInterface
],
];
if (api_get_setting('social_myfiles_office_files_upload_allowed')) {
//Allow all office suite documents to be uploaded in the "My files" section of the social network
$driver['uploadOrder'] = ['deny', 'allow'];
$driver['uploadAllow'] = [
'application/pdf',
"application/msword",
"application/vnd.ms-excel",
"application/vnd.ms-excel.addin.macroEnabled.12",
"application/vnd.ms-excel.sheet.binary.macroEnabled.12",
"application/vnd.ms-excel.sheet.macroEnabled.12",
"application/vnd.ms-excel.template.macroEnabled.12",
"application/vnd.ms-powerpoint",
"application/vnd.ms-powerpoint.addin.macroEnabled.12",
"application/vnd.ms-powerpoint.presentation.macroEnabled.12",
"application/vnd.ms-powerpoint.slide.macroenabled.12",
"application/vnd.ms-powerpoint.slideshow.macroEnabled.12",
"application/vnd.ms-powerpoint.template.macroEnabled.12",
"application/vnd.ms-word.document.macroEnabled.12",
"application/vnd.ms-word.template.macroEnabled.12",
"application/vnd.openxmlformats-officedocument.presentationml.presentation",
"application/vnd.openxmlformats-officedocument.presentationml.slide",
"application/vnd.openxmlformats-officedocument.presentationml.slideshow",
"application/vnd.openxmlformats-officedocument.presentationml.template",
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
"application/vnd.openxmlformats-officedocument.spreadsheetml.template",
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"application/vnd.openxmlformats-officedocument.wordprocessingml.template",
];
}
return $driver;
}
}

Loading…
Cancel
Save