diff --git a/airtime_mvc/application/controllers/ApiController.php b/airtime_mvc/application/controllers/ApiController.php index 1d6822db7..54840cae6 100644 --- a/airtime_mvc/application/controllers/ApiController.php +++ b/airtime_mvc/application/controllers/ApiController.php @@ -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.'; diff --git a/airtime_mvc/application/models/Schedule.php b/airtime_mvc/application/models/Schedule.php index eb6226d84..26ac92bf4 100644 --- a/airtime_mvc/application/models/Schedule.php +++ b/airtime_mvc/application/models/Schedule.php @@ -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){ diff --git a/airtime_mvc/public/js/airtime/dashboard/helperfunctions.js b/airtime_mvc/public/js/airtime/dashboard/helperfunctions.js index dcd1503cc..1b0747e1d 100644 --- a/airtime_mvc/public/js/airtime/dashboard/helperfunctions.js +++ b/airtime_mvc/public/js/airtime/dashboard/helperfunctions.js @@ -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; diff --git a/airtime_mvc/public/js/airtime/dashboard/playlist.js b/airtime_mvc/public/js/airtime/dashboard/playlist.js index cb786a200..8b85621a7 100644 --- a/airtime_mvc/public/js/airtime/dashboard/playlist.js +++ b/airtime_mvc/public/js/airtime/dashboard/playlist.js @@ -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);