CC-3513: Playlist Builder->Download makes user be redirected to a blank page
- fixed
This commit is contained in:
parent
4cb64b0eb1
commit
bcdd27863f
2 changed files with 8 additions and 11 deletions
|
@ -107,21 +107,18 @@ class ApiController extends Zend_Controller_Action
|
||||||
|
|
||||||
$api_key = $this->_getParam('api_key');
|
$api_key = $this->_getParam('api_key');
|
||||||
|
|
||||||
|
|
||||||
$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()))
|
is_null(Zend_Auth::getInstance()->getStorage()->read()))
|
||||||
{
|
{
|
||||||
header('HTTP/1.0 401 Unauthorized');
|
header('HTTP/1.0 401 Unauthorized');
|
||||||
print 'You are not allowed to access this resource.';
|
print 'You are not allowed to access this resource.';
|
||||||
$logger->info("401 Unauthorized");
|
Logging::log("401 Unauthorized");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$fileID = $this->_getParam("fileID");
|
$fileID = $this->_getParam("file");
|
||||||
$file_id = substr($fileID, 0, strpos($fileID, "."));
|
$file_id = substr($fileID, 0, strpos($fileID, "."));
|
||||||
|
|
||||||
if (ctype_alnum($file_id) && strlen($file_id) == 32)
|
if (ctype_alnum($file_id) && strlen($file_id) == 32)
|
||||||
{
|
{
|
||||||
$media = Application_Model_StoredFile::RecallByGunid($file_id);
|
$media = Application_Model_StoredFile::RecallByGunid($file_id);
|
||||||
|
|
|
@ -92,12 +92,12 @@ function buildplaylist(p_url, p_playIndex) {
|
||||||
if (data[index]['element_mp3'] != undefined){
|
if (data[index]['element_mp3'] != undefined){
|
||||||
media = {title: data[index]['element_title'],
|
media = {title: data[index]['element_title'],
|
||||||
artist: data[index]['element_artist'],
|
artist: data[index]['element_artist'],
|
||||||
mp3:"/api/get-media/fileID/"+data[index]['element_mp3']
|
mp3:"/api/get-media/file/"+data[index]['element_mp3']
|
||||||
};
|
};
|
||||||
}else if (data[index]['element_oga'] != undefined) {
|
}else if (data[index]['element_oga'] != undefined) {
|
||||||
media = {title: data[index]['element_title'],
|
media = {title: data[index]['element_title'],
|
||||||
artist: data[index]['element_artist'],
|
artist: data[index]['element_artist'],
|
||||||
oga:"/api/get-media/fileID/"+data[index]['element_oga']
|
oga:"/api/get-media/file/"+data[index]['element_oga']
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
myPlaylist[index] = media;
|
myPlaylist[index] = media;
|
||||||
|
@ -132,12 +132,12 @@ function playOne(p_audioFileID) {
|
||||||
if (fileExtensioin === 'mp3') {
|
if (fileExtensioin === 'mp3') {
|
||||||
media = {title: $('.audioFileTitle').text() !== 'null' ?$('.audioFileTitle').text():"",
|
media = {title: $('.audioFileTitle').text() !== 'null' ?$('.audioFileTitle').text():"",
|
||||||
artist: $('.audioFileArtist').text() !== 'null' ?$('.audioFileArtist').text():"",
|
artist: $('.audioFileArtist').text() !== 'null' ?$('.audioFileArtist').text():"",
|
||||||
mp3:"/api/get-media/fileID/"+p_audioFileID
|
mp3:"/api/get-media/file/"+p_audioFileID
|
||||||
};
|
};
|
||||||
}else if (fileExtensioin === 'ogg' ) {
|
}else if (fileExtensioin === 'ogg' ) {
|
||||||
media = {title: $('.audioFileTitle').text() != 'null' ?$('.audioFileTitle').text():"",
|
media = {title: $('.audioFileTitle').text() != 'null' ?$('.audioFileTitle').text():"",
|
||||||
artist: $('.audioFileArtist').text() != 'null' ?$('.audioFileArtist').text():"",
|
artist: $('.audioFileArtist').text() != 'null' ?$('.audioFileArtist').text():"",
|
||||||
oga:"/api/get-media/fileID/"+p_audioFileID
|
oga:"/api/get-media/file/"+p_audioFileID
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
_playlist_jplayer.option("autoPlay", true);
|
_playlist_jplayer.option("autoPlay", true);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue