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

@ -75,7 +75,8 @@ class ApiController extends Zend_Controller_Action
$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.';

View file

@ -376,8 +376,7 @@ class Schedule {
"currentShow"=>Show_DAL::GetCurrentShow($timeNow),
"nextShow"=>Show_DAL::GetNextShows($timeNow, 1),
"timezone"=> date("T"),
"timezoneOffset"=> date("Z"),
"apiKey"=>$CC_CONFIG['apiKey'][0]);
"timezoneOffset"=> date("Z"));
}
public static function GetLastScheduleItem($p_timeNow){

View file

@ -152,7 +152,7 @@ function audioPreview(filename, elemID){
}
var ext = getFileExt(filename);
var uri = "/api/get-media/api_key/" + apiKey + "/file/" + filename;
var uri = "/api/get-media/file/" + filename;
var media;
var supplied;

View file

@ -23,8 +23,6 @@ var APPLICATION_ENV = "";
var nextSongPrepare = true;
var nextShowPrepare = true;
var apiKey = "";
function secondsTimer(){
if (localRemoteTimeOffset !== null){
var date = new Date();
@ -190,7 +188,6 @@ function calcAdditionalShowData(show){
function parseItems(obj){
APPLICATION_ENV = obj.env;
apiKey = obj.apiKey;
$('#time-zone').text(obj.timezone);