CC-2529: Create download file API key

-users who are authenticed via ZEND_AUTH can now preview files
 without using api-key
This commit is contained in:
martin 2011-07-12 14:09:40 -04:00
parent 88bdb4840b
commit 1416274882
4 changed files with 5 additions and 8 deletions

View file

@ -74,8 +74,9 @@ class ApiController extends Zend_Controller_Action
$download = ("true" == $this->_getParam('download'));
$logger = Logging::getLogger();
if(!in_array($api_key, $CC_CONFIG["apiKey"]))
if(!in_array($api_key, $CC_CONFIG["apiKey"]) &&
is_null(Zend_Auth::getInstance()->getStorage()->read()))
{
header('HTTP/1.0 401 Unauthorized');
print 'You are not allowed to access this resource.';