Add sharing token/download key to station podcast URL when set to private; tab middle click fix

This commit is contained in:
Duncan Sommerville 2015-11-04 10:52:23 -05:00
parent 69da2fa07e
commit b4ec3eeb3f
6 changed files with 41 additions and 22 deletions

View file

@ -55,8 +55,16 @@ class PreferenceController extends Zend_Controller_Action
// Refresh the download key when enabling privacy
Application_Model_Preference::setStationPodcastDownloadKey();
}
// Append sharing token (download key) to Station podcast URL
$stationPodcast = PodcastQuery::create()->findOneByDbId(Application_Model_Preference::getStationPodcastId());
$key = Application_Model_Preference::getStationPodcastDownloadKey();
$url = Application_Common_HTTPHelper::getStationUrl() .
(((int) $values["stationPodcastPrivacy"]) ? "feeds/station-rss?sharing_token=$key" : "feeds/station-rss");
$stationPodcast->setDbUrl($url)->save();
Application_Model_Preference::setStationPodcastPrivacy($values["stationPodcastPrivacy"]);
$logoUploadElement = $form->getSubForm('preferences_general')->getElement('stationLogo');
$logoUploadElement->receive();
$imagePath = $logoUploadElement->getFileName();