Add station podcast privacy toggle

This commit is contained in:
Duncan Sommerville 2015-10-21 17:30:24 -04:00
parent 92ffa955c3
commit 6580c12ad3
12 changed files with 71 additions and 10 deletions

View file

@ -4,6 +4,12 @@ class FeedsController extends Zend_Controller_Action
{
public function stationRssAction()
{
if (Application_Model_Preference::getStationPodcastPrivacy()
&& $this->getRequest()->getParam("sharing_token") != Application_Model_Preference::getStationPodcastDownloadKey()) {
$this->getResponse()
->setHttpResponseCode(401);
return;
}
$this->view->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);

View file

@ -51,6 +51,12 @@ class PreferenceController extends Zend_Controller_Action
Application_Model_Preference::SetWeekStartDay($values["weekStartDay"]);
Application_Model_Preference::setRadioPageDisplayLoginButton($values["radioPageLoginButton"]);
if (!Application_Model_Preference::getStationPodcastPrivacy() && $values["stationPodcastPrivacy"] == 1) {
// Refresh the download key when enabling privacy
Application_Model_Preference::setStationPodcastDownloadKey();
}
Application_Model_Preference::setStationPodcastPrivacy($values["stationPodcastPrivacy"]);
$logoUploadElement = $form->getSubForm('preferences_general')->getElement('stationLogo');
$logoUploadElement->receive();
$imagePath = $logoUploadElement->getFileName();