Merge pull request #17537 from kastoras/create_share_on_file_upload_with_other_setup
New Add option MAIN_FORCE_SHARING_ON_ANY_UPLOADED_FILE to share file on any file upload
This commit is contained in:
commit
1ff6c33276
@ -1766,7 +1766,7 @@ function dol_remove_file_process($filenb, $donotupdatesession = 0, $donotdeletef
|
|||||||
*/
|
*/
|
||||||
function addFileIntoDatabaseIndex($dir, $file, $fullpathorig = '', $mode = 'uploaded', $setsharekey = 0, $object = null)
|
function addFileIntoDatabaseIndex($dir, $file, $fullpathorig = '', $mode = 'uploaded', $setsharekey = 0, $object = null)
|
||||||
{
|
{
|
||||||
global $db, $user;
|
global $db, $user, $conf;
|
||||||
|
|
||||||
$result = 0;
|
$result = 0;
|
||||||
|
|
||||||
@ -1799,6 +1799,10 @@ function addFileIntoDatabaseIndex($dir, $file, $fullpathorig = '', $mode = 'uplo
|
|||||||
if (isset($object->src_object_keywords)) $ecmfile->keywords = $object->src_object_keywords;
|
if (isset($object->src_object_keywords)) $ecmfile->keywords = $object->src_object_keywords;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!empty($conf->global->MAIN_FORCE_SHARING_ON_ANY_UPLOADED_FILE)) {
|
||||||
|
$setsharekey = 1;
|
||||||
|
}
|
||||||
|
|
||||||
if ($setsharekey) {
|
if ($setsharekey) {
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
|
||||||
$ecmfile->share = getRandomPassword(true);
|
$ecmfile->share = getRandomPassword(true);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user