From 0fd3d7e085ae86c6b944f99f4beb2700550c526f Mon Sep 17 00:00:00 2001 From: ovclas Date: Mon, 7 Nov 2011 08:45:13 +0000 Subject: [PATCH] issue 859 check file download permission, when guest access git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9804 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- modules/file/file.controller.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/file/file.controller.php b/modules/file/file.controller.php index f49916e9c..874b267d7 100644 --- a/modules/file/file.controller.php +++ b/modules/file/file.controller.php @@ -170,7 +170,14 @@ } // Check if a permission for file download is granted - if(is_array($file_module_config->download_grant) && count($file_module_config->download_grant)>0) { + $downloadGrantCount = 0; + if(is_array($file_module_config->download_grant)) + { + foreach($file_module_config->download_grant AS $value) + if($value) $downloadGrantCount++; + } + + if(is_array($file_module_config->download_grant) && $downloadGrantCount>0) { if(!Context::get('is_logged')) return $this->stop('msg_not_permitted_download'); $logged_info = Context::get('logged_info'); if($logged_info->is_admin != 'Y') {