mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-07 16:41:48 +01:00
Fix CI
This commit is contained in:
@@ -848,6 +848,8 @@ class Documents extends DolibarrApi
|
||||
$modulepart = 'mrp';
|
||||
require_once DOL_DOCUMENT_ROOT . '/mrp/class/mo.class.php';
|
||||
$object = new Mo($this->db);
|
||||
} elseif ($modulepart == 'ecm') {
|
||||
throw new RestException(500, 'Using a non empty "ref" is not compatible with using modulepart = '.$modulepart);
|
||||
} else {
|
||||
// TODO Implement additional moduleparts
|
||||
throw new RestException(500, 'Modulepart '.$modulepart.' not implemented yet.');
|
||||
@@ -879,16 +881,16 @@ class Documents extends DolibarrApi
|
||||
}
|
||||
|
||||
// Test on permissions
|
||||
if ($modulepart != 'ecm') {
|
||||
$relativefile = $tmpreldir.dol_sanitizeFileName($object->ref);
|
||||
$tmp = dol_check_secure_access_document($modulepart, $relativefile, $entity, DolibarrApiAccess::$user, $ref, 'write');
|
||||
$upload_dir = $tmp['original_file']; // No dirname here, tmp['original_file'] is already the dir because dol_check_secure_access_document was called with param original_file that is only the dir
|
||||
} else {
|
||||
//if ($modulepart != 'ecm') { // Here $modulepart is always != 'ecm'
|
||||
$relativefile = $tmpreldir.dol_sanitizeFileName($object->ref);
|
||||
$tmp = dol_check_secure_access_document($modulepart, $relativefile, $entity, DolibarrApiAccess::$user, $ref, 'write');
|
||||
$upload_dir = $tmp['original_file']; // No dirname here, tmp['original_file'] is already the dir because dol_check_secure_access_document was called with param original_file that is only the dir
|
||||
/*} else {
|
||||
if (!DolibarrApiAccess::$user->hasRight('ecm', 'upload')) {
|
||||
throw new RestException(403, 'Missing permission to upload files in ECM module');
|
||||
}
|
||||
$upload_dir = $conf->medias->multidir_output[$conf->entity];
|
||||
}
|
||||
}*/
|
||||
|
||||
if (empty($upload_dir) || $upload_dir == '/') {
|
||||
throw new RestException(500, 'This value of modulepart ('.$modulepart.') does not support yet usage of ref. Check modulepart parameter or try to use subdir parameter instead of ref.');
|
||||
|
||||
Reference in New Issue
Block a user