29define(
'NOTOKENRENEWAL', 1);
35require_once
'../../../../main.inc.php';
46$pos = strstr($uri,
'/');
51$entity = ((!empty($_SESSION[
'dol_entity']) && $_SESSION[
'dol_entity'] > 1) ? $_SESSION[
'dol_entity'] : null);
56if (empty($user->admin) && !$user->hasRight(
'website',
'write')) {
57 accessforbidden(
'Need to be admin or having write permission on website module');
63$Config[
'Enabled'] =
true;
67$extEntity = (empty($entity) ? 1 : $entity);
69$Config[
'UserFilesPath'] = DOL_URL_ROOT.
'/viewimage.php?modulepart=medias'.(empty($website) ?
'' :
'_'.$website).
'&entity='.$extEntity.
'&file=';
70$Config[
'UserFilesAbsolutePathRelative'] = (!empty($entity) ?
'/'.$entity :
'').(empty($website) ?
'/medias/' : (
'/website/'.$website));
77$Config[
'UserFilesAbsolutePath'] = $dolibarr_main_data_root.$Config[
'UserFilesAbsolutePathRelative'];
81$Config[
'ForceSingleExtension'] =
true;
85$Config[
'SecureImageUploads'] =
true;
88$Config[
'ConfigAllowedCommands'] = array(
'QuickUpload',
'FileUpload',
'GetFolders',
'GetFoldersAndFiles',
'CreateFolder');
91$Config[
'ConfigAllowedTypes'] = array(
'File',
'Image',
'Media');
95$Config[
'HtmlExtensions'] = array(
"html",
"htm",
"xml",
"xsd",
"txt",
"js");
106$Config[
'ChmodOnUpload'] = $newmask;
111$dirmaskdec = octdec($newmask);
113 $dirmaskdec = octdec(
$conf->global->MAIN_UMASK);
115$dirmaskdec |= octdec(
'0200');
116$newmask = decoct($dirmaskdec);
118$Config[
'ChmodOnFolderCreate'] = $newmask;
172$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');
173$Config[
'DeniedExtensions'][
'File'] = array();
174$Config[
'FileTypesPath'][
'File'] = $Config[
'UserFilesPath'].
'file/';
175$Config[
'FileTypesAbsolutePath'][
'File'] = ($Config[
'UserFilesAbsolutePath'] ==
'') ?
'' : $Config[
'UserFilesAbsolutePath'].
'file/';
176$Config[
'QuickUploadPath'][
'File'] = $Config[
'UserFilesPath'];
177$Config[
'QuickUploadAbsolutePath'][
'File'] = $Config[
'UserFilesAbsolutePath'];
179$Config[
'AllowedExtensions'][
'Image'] = array(
'bmp',
'gif',
'jpeg',
'jpg',
'png',
'ai');
181 $Config[
'AllowedExtensions'][
'Image'][] =
'svg';
183$Config[
'DeniedExtensions'][
'Image'] = array();
184$Config[
'FileTypesPath'][
'Image'] = $Config[
'UserFilesPath'].
'image/';
185$Config[
'FileTypesAbsolutePath'][
'Image'] = ($Config[
'UserFilesAbsolutePath'] ==
'') ?
'' : $Config[
'UserFilesAbsolutePath'].
'image/';
186$Config[
'QuickUploadPath'][
'Image'] = $Config[
'UserFilesPath'];
187$Config[
'QuickUploadAbsolutePath'][
'Image'] = $Config[
'UserFilesAbsolutePath'];
189$Config[
'AllowedExtensions'][
'Flash'] = array(
'swf',
'flv');
190$Config[
'DeniedExtensions'][
'Flash'] = array();
191$Config[
'FileTypesPath'][
'Flash'] = $Config[
'UserFilesPath'].
'flash/';
192$Config[
'FileTypesAbsolutePath'][
'Flash'] = ($Config[
'UserFilesAbsolutePath'] ==
'') ?
'' : $Config[
'UserFilesAbsolutePath'].
'flash/';
193$Config[
'QuickUploadPath'][
'Flash'] = $Config[
'UserFilesPath'];
194$Config[
'QuickUploadAbsolutePath'][
'Flash'] = $Config[
'UserFilesAbsolutePath'];
196$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');
197$Config[
'DeniedExtensions'][
'Media'] = array();
198$Config[
'FileTypesPath'][
'Media'] = $Config[
'UserFilesPath'].
'media/';
199$Config[
'FileTypesAbsolutePath'][
'Media'] = ($Config[
'UserFilesAbsolutePath'] ==
'') ?
'' : $Config[
'UserFilesAbsolutePath'].
'media/';
200$Config[
'QuickUploadPath'][
'Media'] = $Config[
'UserFilesPath'];
201$Config[
'QuickUploadAbsolutePath'][
'Media'] = $Config[
'UserFilesAbsolutePath'];
global $dolibarr_main_url_root
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.