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 @@

- +

element->getElement("show_source_host")->render() ?> element->getElement("show_source_port")->render() ?> diff --git a/airtime_mvc/application/views/scripts/form/preferences_general.phtml b/airtime_mvc/application/views/scripts/form/preferences_general.phtml index 614416765..77f4201f5 100644 --- a/airtime_mvc/application/views/scripts/form/preferences_general.phtml +++ b/airtime_mvc/application/views/scripts/form/preferences_general.phtml @@ -37,5 +37,8 @@ element->getElement('thirdPartyApi')->render() ?> + element->getElement('radioPageLoginButton')->renderViewHelper() ?> + element->getElement('radioPageLoginButton')->renderLabel() ?> +
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 @@

- +

element->getElement('master_username')->render() ?> @@ -24,7 +24,7 @@

- +

element->getElement("show_source_host")->render() ?> element->getElement("show_source_port")->render() ?> diff --git a/airtime_mvc/application/views/scripts/index/index.phtml b/airtime_mvc/application/views/scripts/index/index.phtml index a8467757f..7940ec812 100644 --- a/airtime_mvc/application/views/scripts/index/index.phtml +++ b/airtime_mvc/application/views/scripts/index/index.phtml @@ -24,12 +24,14 @@ document.getElementById(id).width= (newwidth) + "px"; echo ""; } ?> - "; + }?>
diff --git a/airtime_mvc/public/css/embed/weekly-schedule-widget-basic.css b/airtime_mvc/public/css/embed/weekly-schedule-widget-basic.css index a74d276a7..b7f484e83 100644 --- a/airtime_mvc/public/css/embed/weekly-schedule-widget-basic.css +++ b/airtime_mvc/public/css/embed/weekly-schedule-widget-basic.css @@ -217,11 +217,11 @@ background: rgba(53, 53, 53, 1.0); @media (max-width: 400px) { .schedule_item div.time_grid { - width: 90%; + width: 95%; } .schedule_item div.name_grid { - width: 90%; + width: 95%; } } diff --git a/airtime_mvc/public/css/embed/weekly-schedule-widget.css b/airtime_mvc/public/css/embed/weekly-schedule-widget.css index 59c460860..8151a99d8 100644 --- a/airtime_mvc/public/css/embed/weekly-schedule-widget.css +++ b/airtime_mvc/public/css/embed/weekly-schedule-widget.css @@ -167,11 +167,11 @@ body { @media (max-width: 400px) { .schedule_item div.time_grid { - width: 90%; + width: 95%; } .schedule_item div.name_grid { - width: 90%; + width: 95%; } } diff --git a/airtime_mvc/public/css/radio-page/premium_player.css b/airtime_mvc/public/css/radio-page/premium_player.css index 81583d31e..f36306135 100644 --- a/airtime_mvc/public/css/radio-page/premium_player.css +++ b/airtime_mvc/public/css/radio-page/premium_player.css @@ -39,6 +39,7 @@ body { .on_air { display: inline-block; margin-left: 40px; + width: 65% } .bottom_bar p.now_playing { @@ -47,11 +48,19 @@ body { font-weight: 300; float: left; margin: 28px 0px; + width: 100%; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; } .bottom_bar p.now_playing span { display: block; font-weight: 100; + width: 100%; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; } .bottom_bar .button { @@ -88,6 +97,30 @@ body { float: right; } +@media (max-width: 1230px) { + .on_air { + width: 60%; + } +} + +@media (max-width: 1075px) { + .on_air { + width: 55%; + } +} + +@media (max-width: 960px) { + .on_air { + width: 50%; + } +} + +@media (max-width: 850px) { + .on_air { + width: 45%; + } +} + @media (max-width: 780px) { .bottom_bar { height: 80px; @@ -122,6 +155,7 @@ body { left: 0px; right: 0px; padding-top: 40px; + width: 100%; background: rgba(0,0,0,0); background: -moz-linear-gradient(top, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 69%, rgba(0,0,0,1) 100%); background: -webkit-gradient(left top, left bottom, color-stop(0%, rgba(0,0,0,0)), color-stop(69%, rgba(0,0,0,1)), color-stop(100%, rgba(0,0,0,1))); diff --git a/airtime_mvc/public/css/styles.css b/airtime_mvc/public/css/styles.css index e6b1e1082..2bbdd947c 100644 --- a/airtime_mvc/public/css/styles.css +++ b/airtime_mvc/public/css/styles.css @@ -47,6 +47,11 @@ select { border:1px solid #9d9d9d; } +/* Fix for Firefox */ +fieldset { + clear: both; +} + .logo { background: transparent url(images/airtime_logo.png) no-repeat 0 0; height: 35px; diff --git a/python_apps/airtime_analyzer/airtime_analyzer/status_reporter.py b/python_apps/airtime_analyzer/airtime_analyzer/status_reporter.py index 4f357c3db..bb1d03d34 100644 --- a/python_apps/airtime_analyzer/airtime_analyzer/status_reporter.py +++ b/python_apps/airtime_analyzer/airtime_analyzer/status_reporter.py @@ -9,7 +9,10 @@ import pickle import threading from urlparse import urlparse -requests.packages.urllib3.disable_warnings() +# Disable urllib3 warnings because these can cause a rare deadlock due to Python 2's crappy internal non-reentrant locking +# around POSIX stuff. See SAAS-714. The hasattr() is for compatibility with older versions of requests. +if hasattr(requests, 'packages'): + requests.packages.urllib3.disable_warnings() class PicklableHttpRequest: def __init__(self, method, url, data, api_key):