mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 17:21:39 +09:00
Fix #1207 enable option to control whether audio/video files are downloaded directly or through procFileDownload
This commit is contained in:
parent
7633bc7b3a
commit
66a6834204
5 changed files with 23 additions and 2 deletions
|
|
@ -127,9 +127,10 @@ class fileAdminController extends file
|
|||
{
|
||||
// Update configuration
|
||||
$config = getModel('module')->getModuleConfig('file');
|
||||
$config->allow_outlink = Context::get('allow_outlink');
|
||||
$config->allow_outlink = Context::get('allow_outlink') === 'N' ? 'N' : 'Y';
|
||||
$config->allow_outlink_format = Context::get('allow_outlink_format');
|
||||
$config->allow_outlink_site = Context::get('allow_outlink_site');
|
||||
$config->allow_multimedia_direct_download = Context::get('allow_multimedia_direct_download') === 'Y' ? 'Y' : 'N';
|
||||
$config->download_short_url = Context::get('download_short_url') === 'Y' ? 'Y' : 'N';
|
||||
$config->inline_download_format = array_map('utf8_trim', Context::get('inline_download_format'));
|
||||
|
||||
|
|
|
|||
|
|
@ -955,7 +955,15 @@ class fileController extends file
|
|||
{
|
||||
$storage_path = $this->getStoragePath('binaries', $args->file_srl, $module_srl, $upload_target_srl, $args->regdate);
|
||||
}
|
||||
$args->direct_download = $direct ? 'Y' : 'N';
|
||||
|
||||
if($config->allow_multimedia_direct_download !== 'N')
|
||||
{
|
||||
$args->direct_download = $direct ? 'Y' : 'N';
|
||||
}
|
||||
else
|
||||
{
|
||||
$args->direct_download = Rhymix\Framework\Filters\FilenameFilter::isDirectDownload($args->source_filename, false) ? 'Y' : 'N';
|
||||
}
|
||||
|
||||
// Create a directory
|
||||
if(!Rhymix\Framework\Storage::isDirectory($storage_path) && !Rhymix\Framework\Storage::createDirectory($storage_path))
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ $lang->file_list = 'Attachment List';
|
|||
$lang->allow_outlink = 'Allow External Link to Download URL';
|
||||
$lang->allow_outlink_site = 'Allowed Websites';
|
||||
$lang->allow_outlink_format = 'Allowed Formats';
|
||||
$lang->allow_multimedia_direct_download = 'Allow Direct Link to Multimedia Attachments';
|
||||
$lang->allowed_filesize = 'Maximum File Size';
|
||||
$lang->allowed_attach_size = 'Maximum Attachments';
|
||||
$lang->allowed_filetypes = 'Allowed extentsions';
|
||||
|
|
@ -34,6 +35,7 @@ $lang->enable_download_group = 'Downloadable Groups';
|
|||
$lang->about_allow_outlink = 'Allow other websites to link directly to your download URLs.<br />Rhymix does not control links to image files that can be embedded directly in a document.<br />in order to block external links to such images, you may need to modify your web server configuration.';
|
||||
$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 always be allowed.<br />Please enter one full address per line: e.g. https://www.rhymix.org/';
|
||||
$lang->about_allow_multimedia_direct_download = 'Use directly accessible links for audio and video attachments.<br>This helps reduce server load, as the download of such large files will not go through PHP.<br>However, unprivileged users may be able to download audio and video files if the link is exposed.';
|
||||
$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.';
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ $lang->allow_outlink_format = '외부 접근 허용 확장자';
|
|||
$lang->allowed_filesize = '파일 용량 제한';
|
||||
$lang->allowed_attach_size = '문서 첨부 제한';
|
||||
$lang->allowed_filetypes = '허용 확장자';
|
||||
$lang->allow_multimedia_direct_download = '멀티미디어 파일 직접 접근 허용';
|
||||
$lang->download_short_url = '다운로드시 짧은주소 사용';
|
||||
$lang->inline_download_format = '다운로드시 현재 창 사용';
|
||||
$lang->inline_download_image = '이미지';
|
||||
|
|
@ -34,6 +35,7 @@ $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_allow_multimedia_direct_download = '오디오, 동영상 등의 멀티미디어 파일 링크를 본문에 삽입할 때 직접 접근이 가능한 링크를 사용합니다.<br>다운로드시 PHP를 거치지 않게 되므로 서버 부하가 줄어들지만, 권한이 없는 사람에게 링크가 노출되지 않도록 주의해야 합니다.';
|
||||
$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 = '관리자를 포함하여 사이트 전체에 적용되는 파일 용량 제한입니다.';
|
||||
|
|
|
|||
|
|
@ -30,6 +30,14 @@
|
|||
<p class="x_help-block">{$lang->about_allow_outlink_site}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
<label class="x_control-label">{$lang->allow_multimedia_direct_download}</label>
|
||||
<div class="x_controls">
|
||||
<label class="x_inline"><input type="radio" name="allow_multimedia_direct_download" value="Y" checked="checked"|cond="$config->allow_multimedia_direct_download !== 'N'" /> {$lang->cmd_yes}</label>
|
||||
<label class="x_inline"><input type="radio" name="allow_multimedia_direct_download" value="N" checked="checked"|cond="$config->allow_multimedia_direct_download === 'N'" /> {$lang->cmd_no}</label>
|
||||
<p class="x_help-block">{$lang->about_allow_multimedia_direct_download}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
<label class="x_control-label">{$lang->download_short_url}</label>
|
||||
<div class="x_controls">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue