diff --git a/airtime_mvc/application/common/WidgetHelper.php b/airtime_mvc/application/common/WidgetHelper.php index 8be23e200..fe36ee317 100644 --- a/airtime_mvc/application/common/WidgetHelper.php +++ b/airtime_mvc/application/common/WidgetHelper.php @@ -69,6 +69,8 @@ class WidgetHelper * We don't do any timezone conversion in this function on purpose. All timezone conversion * and show time ordering should be done on the frontend. * + * *** This function does no HTML encoding. It is up to the caller to escape or encode the data appropriately. + * * @return array */ public static function getWeekInfoV2() @@ -139,9 +141,6 @@ class WidgetHelper } $result["shows"] = $shows; - // XSS exploit prevention - SecurityHelper::htmlescape_recursive($result); - // convert image paths to point to api endpoints //TODO: do we need this here? self::findAndConvertPaths($result); diff --git a/airtime_mvc/application/controllers/IndexController.php b/airtime_mvc/application/controllers/IndexController.php index 56d239e5c..08c17b186 100644 --- a/airtime_mvc/application/controllers/IndexController.php +++ b/airtime_mvc/application/controllers/IndexController.php @@ -27,6 +27,12 @@ class IndexController extends Zend_Controller_Action $this->view->stationUrl = Application_Common_HTTPHelper::getStationUrl(); + $displayRadioPageLoginButtonValue = Application_Model_Preference::getRadioPageDisplayLoginButton(); + if ($displayRadioPageLoginButtonValue == "") { + $displayRadioPageLoginButtonValue = true; + } + $this->view->displayLoginButton = $displayRadioPageLoginButtonValue; + } public function mainAction() diff --git a/airtime_mvc/application/controllers/PreferenceController.php b/airtime_mvc/application/controllers/PreferenceController.php index 3ee1be528..22324f2ab 100644 --- a/airtime_mvc/application/controllers/PreferenceController.php +++ b/airtime_mvc/application/controllers/PreferenceController.php @@ -47,6 +47,7 @@ class PreferenceController extends Zend_Controller_Action Application_Model_Preference::SetDefaultLocale($values["locale"]); Application_Model_Preference::SetDefaultTimezone($values["timezone"]); Application_Model_Preference::SetWeekStartDay($values["weekStartDay"]); + Application_Model_Preference::setRadioPageDisplayLoginButton($values["radioPageLoginButton"]); $logoUploadElement = $form->getSubForm('preferences_general')->getElement('stationLogo'); $logoUploadElement->receive(); diff --git a/airtime_mvc/application/controllers/upgrade_sql/airtime_2.5.14/upgrade.sql b/airtime_mvc/application/controllers/upgrade_sql/airtime_2.5.14/upgrade.sql index 3a5362ca1..218a74096 100644 --- a/airtime_mvc/application/controllers/upgrade_sql/airtime_2.5.14/upgrade.sql +++ b/airtime_mvc/application/controllers/upgrade_sql/airtime_2.5.14/upgrade.sql @@ -1,4 +1,3 @@ -ALTER TABLE cc_pref ALTER COLUMN subjid SET NULL; ALTER TABLE cc_pref ALTER COLUMN subjid SET DEFAULT NULL; CREATE UNIQUE INDEX cc_pref_key_idx ON cc_pref (keystr) WHERE subjid IS NULL; ANALYZE cc_pref; \ No newline at end of file diff --git a/airtime_mvc/application/forms/AddShowLiveStream.php b/airtime_mvc/application/forms/AddShowLiveStream.php index 3718aa7d6..57066db0b 100644 --- a/airtime_mvc/application/forms/AddShowLiveStream.php +++ b/airtime_mvc/application/forms/AddShowLiveStream.php @@ -8,6 +8,7 @@ class Application_Form_AddShowLiveStream extends Zend_Form_SubForm { $cb_airtime_auth = new Zend_Form_Element_Checkbox("cb_airtime_auth"); $cb_airtime_auth->setLabel(sprintf(_("Use %s Authentication:"), PRODUCT_NAME)) + ->setChecked(true) ->setRequired(false); $this->addElement($cb_airtime_auth); @@ -57,7 +58,7 @@ class Application_Form_AddShowLiveStream extends Zend_Form_SubForm $showSourceMount = new Zend_Form_Element_Text('show_source_mount'); $showSourceMount->setAttrib('readonly', true) ->setLabel(_('Mount:')) - ->setValue(isset($showSourceParams["mount"])?$showSourceParams["mount"]:""); + ->setValue(isset($showSourceParams["path"])?$showSourceParams["path"]:""); $this->addElement($showSourceMount); $this->setDecorators( diff --git a/airtime_mvc/application/forms/GeneralPreferences.php b/airtime_mvc/application/forms/GeneralPreferences.php index aa2906d82..94230e667 100644 --- a/airtime_mvc/application/forms/GeneralPreferences.php +++ b/airtime_mvc/application/forms/GeneralPreferences.php @@ -136,6 +136,21 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm $week_start_day->setMultiOptions($this->getWeekStartDays()); $week_start_day->setValue(Application_Model_Preference::GetWeekStartDay()); $this->addElement($week_start_day); + + $radioPageLoginButton = new Zend_Form_Element_Checkbox("radioPageLoginButton"); + $radioPageLoginButton->setDecorators(array( + 'ViewHelper', + 'Errors', + 'Label' + )); + $displayRadioPageLoginButtonValue = Application_Model_Preference::getRadioPageDisplayLoginButton(); + if ($displayRadioPageLoginButtonValue == "") { + $displayRadioPageLoginButtonValue = true; + } + $radioPageLoginButton->addDecorator('Label', array("class" => "enable-tunein")); + $radioPageLoginButton->setLabel(_("Display login button on your Radio Page?")); + $radioPageLoginButton->setValue($displayRadioPageLoginButtonValue); + $this->addElement($radioPageLoginButton); } private function getWeekStartDays() diff --git a/airtime_mvc/application/models/Preference.php b/airtime_mvc/application/models/Preference.php index 72b31f10f..ddf676696 100644 --- a/airtime_mvc/application/models/Preference.php +++ b/airtime_mvc/application/models/Preference.php @@ -1522,4 +1522,13 @@ class Application_Model_Preference self::setValue("using_custom_stream_settings", $value); } + public static function getRadioPageDisplayLoginButton() + { + return self::getValue("radio_page_display_login_button"); + } + + public static function setRadioPageDisplayLoginButton($value) + { + self::setValue("radio_page_display_login_button", $value); + } } diff --git a/airtime_mvc/application/views/scripts/form/add-show-live-stream.phtml b/airtime_mvc/application/views/scripts/form/add-show-live-stream.phtml index fd2cbcc77..5707d9ed9 100644 --- a/airtime_mvc/application/views/scripts/form/add-show-live-stream.phtml +++ b/airtime_mvc/application/views/scripts/form/add-show-live-stream.phtml @@ -9,7 +9,7 @@
diff --git a/airtime_mvc/application/views/scripts/form/preferences_livestream.phtml b/airtime_mvc/application/views/scripts/form/preferences_livestream.phtml index 0c9393aea..9bf28c0b8 100644 --- a/airtime_mvc/application/views/scripts/form/preferences_livestream.phtml +++ b/airtime_mvc/application/views/scripts/form/preferences_livestream.phtml @@ -10,7 +10,7 @@