29define(
'NOTOKENRENEWAL', 1);
35require_once
'../../../../main.inc.php';
45$pos = strstr($uri,
'/');
50$entity = ((!empty($_SESSION[
'dol_entity']) && $_SESSION[
'dol_entity'] > 1) ? $_SESSION[
'dol_entity'] : null);
53if (empty($user->admin) && !$user->hasRight(
'website',
'write')) {
54 accessforbidden(
'Need to be admin or having write permission on website module');
61$Config[
'Enabled'] =
true;
65$extEntity = (empty($entity) ? 1 : $entity);
67$Config[
'UserFilesPath'] = DOL_URL_ROOT.
'/viewimage.php?modulepart=medias'.(empty($website) ?
'' :
'_'.$website).
'&entity='.$extEntity.
'&file=';
68$Config[
'UserFilesAbsolutePathRelative'] = (!empty($entity) ?
'/'.$entity :
'').(empty($website) ?
'/medias/' : (
'/website/'.$website));
75$Config[
'UserFilesAbsolutePath'] = $dolibarr_main_data_root.$Config[
'UserFilesAbsolutePathRelative'];
79$Config[
'ForceSingleExtension'] =
true;
83$Config[
'SecureImageUploads'] =
true;
86$Config[
'ConfigAllowedCommands'] = array(
'QuickUpload',
'FileUpload',
'GetFolders',
'GetFoldersAndFiles',
'CreateFolder');
89$Config[
'ConfigAllowedTypes'] = array(
'File',
'Image',
'Media');
93$Config[
'HtmlExtensions'] = array(
"html",
"htm",
"xml",
"xsd",
"txt",
"js");
104$Config[
'ChmodOnUpload'] = $newmask;
109$dirmaskdec = octdec($newmask);
111 $dirmaskdec = octdec($conf->global->MAIN_UMASK);
113$dirmaskdec |= octdec(
'0200');
114$newmask = decoct($dirmaskdec);
116$Config[
'ChmodOnFolderCreate'] = $newmask;
170$Config[
'AllowedExtensions'][
'File'] = array(
'7z',
'aiff',
'asf',
'avi',
'bmp',
'csv',
'doc',
'fla',
'flv',
'gif',
'gz',
'gzip',
'jpeg',
'jpg',
'mid',
'mov',
'mp3',
'mp4',
'mpc',
'mpeg',
'mpg',
'ods',
'odt',
'pdf',
'png',
'ppt',
'pxd',
'qt',
'ram',
'rar',
'rm',
'rmi',
'rmvb',
'rtf',
'sdc',
'sitd',
'swf',
'sxc',
'sxw',
'tar',
'tgz',
'tif',
'tiff',
'txt',
'vsd',
'wav',
'wma',
'wmv',
'xls',
'xml',
'zip');
171$Config[
'DeniedExtensions'][
'File'] = array();
172$Config[
'FileTypesPath'][
'File'] = $Config[
'UserFilesPath'].
'file/';
173$Config[
'FileTypesAbsolutePath'][
'File'] = ($Config[
'UserFilesAbsolutePath'] ==
'') ?
'' : $Config[
'UserFilesAbsolutePath'].
'file/';
174$Config[
'QuickUploadPath'][
'File'] = $Config[
'UserFilesPath'];
175$Config[
'QuickUploadAbsolutePath'][
'File'] = $Config[
'UserFilesAbsolutePath'];
177$Config[
'AllowedExtensions'][
'Image'] = array(
'bmp',
'gif',
'jpeg',
'jpg',
'png',
'ai');
179 $Config[
'AllowedExtensions'][
'Image'][] =
'svg';
181$Config[
'DeniedExtensions'][
'Image'] = array();
182$Config[
'FileTypesPath'][
'Image'] = $Config[
'UserFilesPath'].
'image/';
183$Config[
'FileTypesAbsolutePath'][
'Image'] = ($Config[
'UserFilesAbsolutePath'] ==
'') ?
'' : $Config[
'UserFilesAbsolutePath'].
'image/';
184$Config[
'QuickUploadPath'][
'Image'] = $Config[
'UserFilesPath'];
185$Config[
'QuickUploadAbsolutePath'][
'Image'] = $Config[
'UserFilesAbsolutePath'];
187$Config[
'AllowedExtensions'][
'Flash'] = array(
'swf',
'flv');
188$Config[
'DeniedExtensions'][
'Flash'] = array();
189$Config[
'FileTypesPath'][
'Flash'] = $Config[
'UserFilesPath'].
'flash/';
190$Config[
'FileTypesAbsolutePath'][
'Flash'] = ($Config[
'UserFilesAbsolutePath'] ==
'') ?
'' : $Config[
'UserFilesAbsolutePath'].
'flash/';
191$Config[
'QuickUploadPath'][
'Flash'] = $Config[
'UserFilesPath'];
192$Config[
'QuickUploadAbsolutePath'][
'Flash'] = $Config[
'UserFilesAbsolutePath'];
194$Config[
'AllowedExtensions'][
'Media'] = array(
'aiff',
'asf',
'avi',
'bmp',
'fla',
'flv',
'gif',
'jpeg',
'jpg',
'mid',
'mov',
'mp3',
'mp4',
'mpc',
'mpeg',
'mpg',
'png',
'qt',
'ram',
'rm',
'rmi',
'rmvb',
'swf',
'tif',
'tiff',
'wav',
'wma',
'wmv');
195$Config[
'DeniedExtensions'][
'Media'] = array();
196$Config[
'FileTypesPath'][
'Media'] = $Config[
'UserFilesPath'].
'media/';
197$Config[
'FileTypesAbsolutePath'][
'Media'] = ($Config[
'UserFilesAbsolutePath'] ==
'') ?
'' : $Config[
'UserFilesAbsolutePath'].
'media/';
198$Config[
'QuickUploadPath'][
'Media'] = $Config[
'UserFilesPath'];
199$Config[
'QuickUploadAbsolutePath'][
'Media'] = $Config[
'UserFilesAbsolutePath'];
global $dolibarr_main_url_root
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.