mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 17:21:39 +09:00
Fix incorrect global filesize limit for admin
https://xetown.com/questions/1154564
This commit is contained in:
parent
ed7368e6d9
commit
d0ec85db3b
5 changed files with 16 additions and 32 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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.<br />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.<br />Please use a comma (,) to separate items: e.g. doc, zip, pdf';
|
||||
$lang->about_allow_outlink_site = 'These referers will alyways be allowed.<br />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.<br />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.<br />Administrators are limited to this setting or the limit set in the <a href="%s" target="_blank">file module</a>, whichever is greater.';
|
||||
$lang->about_allowed_attach_size = 'You can limit the total size of all attached files in one document.<br />Administrators are limited to this setting or the limit set in the <a href="%s" target="_blank">file module</a>, 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)';
|
||||
|
|
|
|||
|
|
@ -27,8 +27,10 @@ $lang->enable_download_group = '다운로드 가능 그룹';
|
|||
$lang->about_allow_outlink = '다른 사이트에서 파일 다운로드 링크에 직접 접근하는 것을 차단합니다.<br />다운로드 링크를 사용하지 않고 본문에 바로 삽입할 수 있는 이미지 파일 등에는 적용되지 않습니다.';
|
||||
$lang->about_allow_outlink_format = '파일 외부 링크 설정에 상관없이 허용하는 파일 확장자입니다.<br />여러 개 입력시 쉼표(,)을 이용해서 구분해 주세요. 예) doc, zip, pdf';
|
||||
$lang->about_allow_outlink_site = '파일 외부 링크 설정에 상관없이 허용하는 사이트 주소입니다.<br />여러 개 입력시 줄을 바꿔서 구분해 주세요. 예) https://www.rhymix.org/';
|
||||
$lang->about_allowed_filesize = '각 파일의 용량을 제한할 수 있습니다. 관리자에게는 적용되지 않습니다.';
|
||||
$lang->about_allowed_attach_size = '하나의 문서에 첨부할 수 있는 최대 용량을 제한할 수 있습니다. 관리자에게는 적용되지 않습니다.';
|
||||
$lang->about_allowed_filesize = '각 파일의 용량을 제한할 수 있습니다.<br />관리자에게는 이 게시판의 제한과 <a href="%s" target="_blank">파일 모듈</a>의 제한 중 높은 쪽이 적용됩니다.';
|
||||
$lang->about_allowed_attach_size = '하나의 문서에 첨부할 수 있는 최대 용량을 제한할 수 있습니다.<br />관리자에게는 이 게시판의 제한과 <a href="%s" target="_blank">파일 모듈</a>의 제한 중 높은 쪽이 적용됩니다.';
|
||||
$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 = '선택항목 삭제';
|
||||
|
|
|
|||
|
|
@ -45,14 +45,14 @@
|
|||
<label for="allowed_filesize" class="x_control-label">{$lang->allowed_filesize}</label>
|
||||
<div class="x_controls">
|
||||
<input type="number" min="0" name="allowed_filesize" id="allowed_filesize" value="{$config->allowed_filesize}" size="7" style="min-width:80px" /> MB
|
||||
<p class="x_help-block">{$lang->about_allowed_filesize}<br />{sprintf($lang->about_allowed_size_limits, ini_get('upload_max_filesize'))}</p>
|
||||
<p class="x_help-block">{$lang->about_allowed_filesize_global}<br />{sprintf($lang->about_allowed_size_limits, ini_get('upload_max_filesize'))}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
<label for="allowed_attach_size" class="x_control-label">{$lang->allowed_attach_size}</label>
|
||||
<div class="x_controls">
|
||||
<input type="number" min="0" name="allowed_attach_size" id="allowed_attach_size" value="{$config->allowed_attach_size}" size="7" style="min-width:80px" /> MB
|
||||
<p class="x_help-block">{$lang->about_allowed_attach_size}<br />{sprintf($lang->about_allowed_size_limits, ini_get('upload_max_filesize'))}</p>
|
||||
<p class="x_help-block">{$lang->about_allowed_attach_size_global}<br />{sprintf($lang->about_allowed_size_limits, ini_get('upload_max_filesize'))}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
<label for="allowed_attach_size" class="x_control-label">{$lang->allowed_attach_size}</label>
|
||||
<div class="x_controls">
|
||||
<input type="number" min="0" name="allowed_attach_size" id="allowed_attach_size" value="{$file_config->allowed_attach_size}" size="7" style="min-width:80px" /> MB
|
||||
<p class="x_help-block">{$lang->about_allowed_attach_size}<br />{sprintf($lang->about_allowed_size_limits, ini_get('upload_max_filesize'))}</p>
|
||||
<p class="x_help-block">{sprintf($lang->about_allowed_attach_size, getUrl('', 'module', 'admin', 'act', 'dispFileAdminConfig'))}<br />{sprintf($lang->about_allowed_size_limits, ini_get('upload_max_filesize'))}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue