Merge remote-tracking branch 'origin/create_share_on_file_upload_with_other_setup' into develop

This commit is contained in:
kastoras 2021-05-11 22:23:12 +03:00
commit 55caff1dd9

View File

@ -1766,7 +1766,7 @@ function dol_remove_file_process($filenb, $donotupdatesession = 0, $donotdeletef
*/
function addFileIntoDatabaseIndex($dir, $file, $fullpathorig = '', $mode = 'uploaded', $setsharekey = 0, $object = null)
{
global $db, $user;
global $db, $user, $conf;
$result = 0;
@ -1792,6 +1792,9 @@ function addFileIntoDatabaseIndex($dir, $file, $fullpathorig = '', $mode = 'uplo
$ecmfile->src_object_type = $object->table_element;
}
if (!empty($conf->global->MAIN_CREATE_SHARE_ON_FILE_UPLOAD) && $conf->global->MAIN_CREATE_SHARE_ON_FILE_UPLOAD=='1') {
$setsharekey = 1;
}
if ($setsharekey) {
require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
$ecmfile->share = getRandomPassword(true);