첨부파일을 다운로드 받을때 권한이 없는 것과 실제 파일이 없는 것에 대해 명확한 메세지를 출력하도록 수정.

그리고 대기 상태의 파일일지라도 최고관리자는 다운로드 할 수 있도록 수정


git-svn-id: http://xe-core.googlecode.com/svn/sandbox@6344 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
zero 2009-05-20 06:39:43 +00:00
parent b476c02ee2
commit d11cd092af
9 changed files with 21 additions and 5 deletions

View file

@ -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: ");

View file

@ -36,6 +36,7 @@
$lang->msg_cart_is_null = 'Please select file(s) to delete';
$lang->msg_checked_file_is_deleted = '%d attachment(s) was(were) deleted';
$lang->msg_exceeds_limit_size = 'File size of attachment is bigger than allowed size.';
$lang->msg_file_not_found = '요청하신 파일을 찾을 수 없습니다.';
$lang->file_search_target_list = array(

View file

@ -34,6 +34,7 @@
$lang->msg_cart_is_null = 'Seleccione el archivo a eliminar';
$lang->msg_checked_file_is_deleted = 'Total de %d archivos eliminados';
$lang->msg_exceeds_limit_size = 'Ha excedido el límite del tamaño total de los archivos adjuntos';
$lang->msg_file_not_found = '요청하신 파일을 찾을 수 없습니다.';
$lang->file_search_target_list = array(
'filename' => 'Nombre del archivo',

View file

@ -34,6 +34,7 @@
$lang->msg_cart_is_null = 'Choisissez un(des) fichier(s) a supprimer';
$lang->msg_checked_file_is_deleted = '%d Annexe(s) est(sont) supprime(s)';
$lang->msg_exceeds_limit_size = 'La mesure de l\'(des) Annexe(s) est plus grande que celle consentie.';
$lang->msg_file_not_found = '요청하신 파일을 찾을 수 없습니다.';
$lang->file_search_target_list = array(
'filename' => 'Nom de Fichier',

View file

@ -36,6 +36,7 @@
$lang->msg_cart_is_null = '削除するファイルを選択して下さい';
$lang->msg_checked_file_is_deleted = '%d個の添付ファイルを削除しました';
$lang->msg_exceeds_limit_size = 'ファイルサイズの制限を超えたため、添付出来ません。';
$lang->msg_file_not_found = '요청하신 파일을 찾을 수 없습니다.';
$lang->file_search_target_list = array(
'filename' => 'ファイル名',

View file

@ -36,6 +36,7 @@
$lang->msg_cart_is_null = '삭제할 파일을 선택해주세요';
$lang->msg_checked_file_is_deleted = '%d개의 첨부파일이 삭제되었습니다';
$lang->msg_exceeds_limit_size = '허용된 용량을 초과하여 첨부가 되지 않았습니다';
$lang->msg_file_not_found = '요청하신 파일을 찾을 수 없습니다.';
$lang->file_search_target_list = array(
'filename' => '파일이름',

View file

@ -34,6 +34,7 @@
$lang->msg_cart_is_null = 'Выберите файл, который Вы хотите удалить';
$lang->msg_checked_file_is_deleted = 'Всего %d вложений было удалено';
$lang->msg_exceeds_limit_size = 'Вложение провалено: превышен лимит размера файлов';
$lang->msg_file_not_found = '요청하신 파일을 찾을 수 없습니다.';
$lang->file_search_target_list = array(
'filename' => 'Имя файла',

View file

@ -34,6 +34,7 @@
$lang->msg_cart_is_null = ' 请选择要删除的文件。';
$lang->msg_checked_file_is_deleted = '已删除%d个文件';
$lang->msg_exceeds_limit_size = '已超过系统指定的上传文件大小!';
$lang->msg_file_not_found = '요청하신 파일을 찾을 수 없습니다.';
$lang->file_search_target_list = array(
'filename' => '文件名',

View file

@ -36,6 +36,7 @@
$lang->msg_cart_is_null = ' 請選擇要刪除的檔案。';
$lang->msg_checked_file_is_deleted = '已刪除%d個檔案';
$lang->msg_exceeds_limit_size = '已超過系統指定的檔案大小!';
$lang->msg_file_not_found = '요청하신 파일을 찾을 수 없습니다.';
$lang->file_search_target_list = array(
'filename' => '檔案名稱',