mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-02 01:52:10 +09:00
첨부파일을 다운로드 받을때 권한이 없는 것과 실제 파일이 없는 것에 대해 명확한 메세지를 출력하도록 수정.
그리고 대기 상태의 파일일지라도 최고관리자는 다운로드 할 수 있도록 수정 git-svn-id: http://xe-core.googlecode.com/svn/sandbox@6344 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
b476c02ee2
commit
d11cd092af
9 changed files with 21 additions and 5 deletions
|
|
@ -46,18 +46,25 @@
|
|||
* sid : db에 저장된 비교 값, 틀리면 다운로드 하지 않음
|
||||
**/
|
||||
function procFileDownload() {
|
||||
$oFileModel = &getModel('file');
|
||||
|
||||
$file_srl = Context::get('file_srl');
|
||||
$sid = Context::get('sid');
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
||||
// 파일의 정보를 DB에서 받아옴
|
||||
$oFileModel = &getModel('file');
|
||||
$file_obj = $oFileModel->getFile($file_srl);
|
||||
if($file_obj->file_srl!=$file_srl || $file_obj->sid!=$sid || $file_obj->isvalid!='Y') return $this->stop('msg_not_permitted_download');
|
||||
|
||||
// 요청된 파일 정보가 잘못되었다면 파일을 찾을 수 없다는 오류 출력
|
||||
if($file_obj->file_srl!=$file_srl || $file_obj->sid!=$sid) return $this->stop('msg_file_not_found');
|
||||
|
||||
// 대기 상태일 경우 파일 다운로드 권한이 없음을 알림 (최고관리자는 다운 로드 허용)
|
||||
if($logged_info->is_admin != 'Y' && $file_obj->isvalid!='Y') return $this->stop('msg_not_permitted_download');
|
||||
|
||||
// 파일 이름
|
||||
$filename = $file_obj->source_filename;
|
||||
|
||||
$file_module_config = $oFileModel->getFileModuleConfig($file_obj->module_srl);
|
||||
|
||||
// 파일 외부링크 차단
|
||||
if($file_module_config->allow_outlink == 'N') {
|
||||
//외부링크 허용 확장자 처리
|
||||
|
|
@ -96,6 +103,7 @@
|
|||
}
|
||||
if($file_module_config->allow_outlink != 'Y') return $this->stop('msg_not_permitted_download');
|
||||
}
|
||||
|
||||
// 파일 다운로드 권한이 있는지 확인
|
||||
if(is_array($file_module_config->download_grant) && count($file_module_config->download_grant)>0) {
|
||||
if(!Context::get('is_logged')) return $this->stop('msg_not_permitted_download');
|
||||
|
|
@ -124,10 +132,10 @@
|
|||
}
|
||||
|
||||
$uploaded_filename = $file_obj->uploaded_filename;
|
||||
if(!file_exists($uploaded_filename)) return $this->stop('msg_not_permitted_download');
|
||||
if(!file_exists($uploaded_filename)) return $this->stop('msg_file_not_found');
|
||||
|
||||
$fp = fopen($uploaded_filename, 'rb');
|
||||
if(!$fp) return $this->stop('msg_not_permitted_download');
|
||||
if(!$fp) return $this->stop('msg_file_not_found');
|
||||
|
||||
header("Cache-Control: ");
|
||||
header("Pragma: ");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue