diff --git a/modules/file/file.model.php b/modules/file/file.model.php index c2cc861a3..f3b48d35f 100644 --- a/modules/file/file.model.php +++ b/modules/file/file.model.php @@ -210,23 +210,6 @@ class fileModel extends file if(!$config->download_grant) $config->download_grant = array(); if(!$config->inline_download_format) $config->inline_download_format = array(); - /* - $size = ini_get('upload_max_filesize'); - $unit = strtolower($size[strlen($size) - 1]); - $size = (float)$size; - if($unit == 'g') $size *= 1024; - if($unit == 'k') $size /= 1024; - - if($config->allowed_filesize > $size) - { - $config->allowed_filesize = $size; - } - if($config->allowed_attach_size > $size) - { - $config->allowed_attach_size = $size; - } - */ - return $config; } @@ -319,13 +302,10 @@ class fileModel extends file if($logged_info->is_admin == 'Y') { - /* - $iniPostMaxSize = FileHandler::returnbytes(ini_get('post_max_size')); - $iniUploadMaxSize = FileHandler::returnbytes(ini_get('upload_max_filesize')); - $size = min($iniPostMaxSize, $iniUploadMaxSize) / 1048576; - $file_config->allowed_attach_size = $size; - $file_config->allowed_filesize = $size; - */ + $oModuleModel = getModel('module'); + $module_config = $oModuleModel->getModuleConfig('file'); + $file_config->allowed_filesize = max($file_config->allowed_filesize, $module_config->allowed_filesize); + $file_config->allowed_attach_size = max($file_config->allowed_attach_size, $module_config->allowed_attach_size); $file_config->allowed_filetypes = '*.*'; } return $file_config; diff --git a/modules/file/lang/en.php b/modules/file/lang/en.php index d1fac6871..16eb7b425 100644 --- a/modules/file/lang/en.php +++ b/modules/file/lang/en.php @@ -26,9 +26,11 @@ $lang->about_inline_download_format = 'Selected types of files will be opened in $lang->enable_download_group = 'Downloadable Groups'; $lang->about_allow_outlink = 'You can block other websites from accessing your download URLs directly.
This does not apply to images and other files that can be embedded directly in a document.'; $lang->about_allow_outlink_format = 'These file formats will always be allowed.
Please use a comma (,) to separate items: e.g. doc, zip, pdf'; -$lang->about_allow_outlink_site = 'These referers will alyways be allowed.
Please enter one full address per line: e.g. https://www.rhymix.org/'; -$lang->about_allowed_filesize = 'You can limit the size of each attached file. Administrators are exempt.'; -$lang->about_allowed_attach_size = 'You can limit the total size of all attached files in one document. Administrators are exempt.'; +$lang->about_allow_outlink_site = 'These referers will always be allowed.
Please enter one full address per line: e.g. https://www.rhymix.org/'; +$lang->about_allowed_filesize = 'You can limit the size of each attached file.
Administrators are limited to this setting or the limit set in the file module, whichever is greater.'; +$lang->about_allowed_attach_size = 'You can limit the total size of all attached files in one document.
Administrators are limited to this setting or the limit set in the file module, whichever is greater.'; +$lang->about_allowed_filesize_global = 'This is the global limit on the size of each attachment.'; +$lang->about_allowed_attach_size_global = 'This is the global limit on the combined size of all attachments in one document.'; $lang->about_allowed_size_limits = 'The file size will be limited to the value set in php.ini (%sB) in IE9 and below and older Android browsers.'; $lang->about_allowed_filetypes = 'To allow an extension, use "*.[extention]". To allow multiple extensions, use ";" between each extension. ex) *.* or *.jpg;*.gif; '; $lang->cmd_delete_checked_file = 'Delete Selected Item(s)'; diff --git a/modules/file/lang/ko.php b/modules/file/lang/ko.php index 85bcfe5ea..e271e80e7 100644 --- a/modules/file/lang/ko.php +++ b/modules/file/lang/ko.php @@ -27,8 +27,10 @@ $lang->enable_download_group = '다운로드 가능 그룹'; $lang->about_allow_outlink = '다른 사이트에서 파일 다운로드 링크에 직접 접근하는 것을 차단합니다.
다운로드 링크를 사용하지 않고 본문에 바로 삽입할 수 있는 이미지 파일 등에는 적용되지 않습니다.'; $lang->about_allow_outlink_format = '파일 외부 링크 설정에 상관없이 허용하는 파일 확장자입니다.
여러 개 입력시 쉼표(,)을 이용해서 구분해 주세요. 예) doc, zip, pdf'; $lang->about_allow_outlink_site = '파일 외부 링크 설정에 상관없이 허용하는 사이트 주소입니다.
여러 개 입력시 줄을 바꿔서 구분해 주세요. 예) https://www.rhymix.org/'; -$lang->about_allowed_filesize = '각 파일의 용량을 제한할 수 있습니다. 관리자에게는 적용되지 않습니다.'; -$lang->about_allowed_attach_size = '하나의 문서에 첨부할 수 있는 최대 용량을 제한할 수 있습니다. 관리자에게는 적용되지 않습니다.'; +$lang->about_allowed_filesize = '각 파일의 용량을 제한할 수 있습니다.
관리자에게는 이 게시판의 제한과 파일 모듈의 제한 중 높은 쪽이 적용됩니다.'; +$lang->about_allowed_attach_size = '하나의 문서에 첨부할 수 있는 최대 용량을 제한할 수 있습니다.
관리자에게는 이 게시판의 제한과 파일 모듈의 제한 중 높은 쪽이 적용됩니다.'; +$lang->about_allowed_filesize_global = '관리자를 포함하여 사이트 전체에 적용되는 파일 크기 제한입니다.'; +$lang->about_allowed_attach_size_global = '관리자를 포함하여 사이트 전체에 적용되는 문서당 총 첨부 용량 제한입니다.'; $lang->about_allowed_size_limits = 'IE9 이하, 구버전 안드로이드 등에서는 php.ini에서 지정한 %sB로 제한됩니다.'; $lang->about_allowed_filetypes = '"*.확장자"로 지정할 수 있고 ";" 으로 여러 개 지정이 가능합니다. 예) *.* or *.jpg;*.gif;'; $lang->cmd_delete_checked_file = '선택항목 삭제'; diff --git a/modules/file/tpl/adminConfig.html b/modules/file/tpl/adminConfig.html index fcbe49fcb..57f8047d3 100644 --- a/modules/file/tpl/adminConfig.html +++ b/modules/file/tpl/adminConfig.html @@ -45,14 +45,14 @@
MB -

{$lang->about_allowed_filesize}
{sprintf($lang->about_allowed_size_limits, ini_get('upload_max_filesize'))}

+

{$lang->about_allowed_filesize_global}
{sprintf($lang->about_allowed_size_limits, ini_get('upload_max_filesize'))}

MB -

{$lang->about_allowed_attach_size}
{sprintf($lang->about_allowed_size_limits, ini_get('upload_max_filesize'))}

+

{$lang->about_allowed_attach_size_global}
{sprintf($lang->about_allowed_size_limits, ini_get('upload_max_filesize'))}

diff --git a/modules/file/tpl/file_module_config.html b/modules/file/tpl/file_module_config.html index 64fb9e2c8..6eb82ad60 100644 --- a/modules/file/tpl/file_module_config.html +++ b/modules/file/tpl/file_module_config.html @@ -18,7 +18,7 @@
MB -

{$lang->about_allowed_attach_size}
{sprintf($lang->about_allowed_size_limits, ini_get('upload_max_filesize'))}

+

{sprintf($lang->about_allowed_attach_size, getUrl('', 'module', 'admin', 'act', 'dispFileAdminConfig'))}
{sprintf($lang->about_allowed_size_limits, ini_get('upload_max_filesize'))}