From 42fd118658dacc6b211f7326ea351807b1a6e6cf Mon Sep 17 00:00:00 2001 From: Duncan Sommerville Date: Mon, 6 Jul 2015 18:05:05 -0400 Subject: [PATCH 01/11] Comment out table level lock (it can cause dead locks in some edge cases) --- airtime_mvc/application/models/Preference.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/airtime_mvc/application/models/Preference.php b/airtime_mvc/application/models/Preference.php index ec8b49a3c..736dbef98 100644 --- a/airtime_mvc/application/models/Preference.php +++ b/airtime_mvc/application/models/Preference.php @@ -31,7 +31,8 @@ class Application_Model_Preference $con->beginTransaction(); try { - static::_lock($con); + /* Comment this out while we reevaluate it in favor of a unique constraint + static::_lock($con); */ $userId = self::getUserId(); if ($isUserValue && is_null($userId)) { From 67c5b73db4f3d6d59ba5c42826ddfc9ab7c8c81e Mon Sep 17 00:00:00 2001 From: Albert Santoni Date: Wed, 8 Jul 2015 10:32:35 -0400 Subject: [PATCH 02/11] airtime_analyzer unit test backwards compatibility with older versions of requests --- .../airtime_analyzer/airtime_analyzer/status_reporter.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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): From ad39174f572299e49ef75dfeceeae1d9ffb2c3ee Mon Sep 17 00:00:00 2001 From: Duncan Sommerville Date: Wed, 8 Jul 2015 14:19:50 -0400 Subject: [PATCH 03/11] Fix fieldset flow for Firefox --- airtime_mvc/public/css/styles.css | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/airtime_mvc/public/css/styles.css b/airtime_mvc/public/css/styles.css index 6ad9b941c..d9031f095 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; From 4b8944f221fe4e6f43c99f34f2e3546ff5a6883c Mon Sep 17 00:00:00 2001 From: Albert Santoni Date: Thu, 9 Jul 2015 09:22:49 -0400 Subject: [PATCH 04/11] Improved explanation for live streaming form --- .../views/scripts/form/preferences_livestream.phtml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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() ?> From d2ca10294fc40930732c76146f0ed0e1eb056678 Mon Sep 17 00:00:00 2001 From: Albert Santoni Date: Thu, 9 Jul 2015 10:18:21 -0400 Subject: [PATCH 05/11] Two Add Show form bugfixes * Fixed the Show Source mount name not showing up in Add Show form * Use Airtime Authenticaiton by default --- airtime_mvc/application/forms/AddShowLiveStream.php | 3 ++- .../application/views/scripts/form/add-show-live-stream.phtml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) 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/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() ?> From 5ec3684ea6f970eac27a8247db7e81dab212849e Mon Sep 17 00:00:00 2001 From: drigato Date: Thu, 9 Jul 2015 10:34:48 -0400 Subject: [PATCH 06/11] CSS fix onradio page schedule widget Widen width or show time and name columns on mobile phones --- airtime_mvc/public/css/embed/weekly-schedule-widget-basic.css | 4 ++-- airtime_mvc/public/css/embed/weekly-schedule-widget.css | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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%; } } From 1efa591d67ffe996d46da2cf2e93d1f066d56093 Mon Sep 17 00:00:00 2001 From: Albert Santoni Date: Thu, 9 Jul 2015 12:49:49 -0400 Subject: [PATCH 07/11] Fixed double HTML encoding on embedded schedule widget --- airtime_mvc/application/common/WidgetHelper.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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); From 0601bd675e8317a87535f05f7eb5e7cbce692cff Mon Sep 17 00:00:00 2001 From: drigato Date: Thu, 9 Jul 2015 14:38:44 -0400 Subject: [PATCH 08/11] SAAS-939: Add option to preferences to display login button on radio page --- .../application/controllers/IndexController.php | 2 ++ .../application/controllers/PreferenceController.php | 1 + airtime_mvc/application/forms/GeneralPreferences.php | 11 +++++++++++ airtime_mvc/application/models/Preference.php | 9 +++++++++ .../views/scripts/form/preferences_general.phtml | 3 +++ .../application/views/scripts/index/index.phtml | 10 ++++++---- 6 files changed, 32 insertions(+), 4 deletions(-) diff --git a/airtime_mvc/application/controllers/IndexController.php b/airtime_mvc/application/controllers/IndexController.php index 56d239e5c..32e4a17a1 100644 --- a/airtime_mvc/application/controllers/IndexController.php +++ b/airtime_mvc/application/controllers/IndexController.php @@ -27,6 +27,8 @@ class IndexController extends Zend_Controller_Action $this->view->stationUrl = Application_Common_HTTPHelper::getStationUrl(); + $this->view->displayLoginButton = Application_Model_Preference::getRadioPageDisplayLoginButton(); + } public function mainAction() diff --git a/airtime_mvc/application/controllers/PreferenceController.php b/airtime_mvc/application/controllers/PreferenceController.php index 5803d3223..39b7a8613 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/forms/GeneralPreferences.php b/airtime_mvc/application/forms/GeneralPreferences.php index aa2906d82..ff3cf4118 100644 --- a/airtime_mvc/application/forms/GeneralPreferences.php +++ b/airtime_mvc/application/forms/GeneralPreferences.php @@ -136,6 +136,17 @@ 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' + )); + $radioPageLoginButton->addDecorator('Label', array("class" => "enable-tunein")); + $radioPageLoginButton->setLabel(_("Display login button on your Radio Page?")); + $radioPageLoginButton->setValue(Application_Model_Preference::getRadioPageDisplayLoginButton()); + $this->addElement($radioPageLoginButton); } private function getWeekStartDays() diff --git a/airtime_mvc/application/models/Preference.php b/airtime_mvc/application/models/Preference.php index 5c1e7c889..6143058ba 100644 --- a/airtime_mvc/application/models/Preference.php +++ b/airtime_mvc/application/models/Preference.php @@ -1512,4 +1512,13 @@ class Application_Model_Preference self::setValue("task_manager_lock", $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/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/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 ""; } ?> - "; + }?>
From 670395bb2e782329690dbb64f27751f5524736c8 Mon Sep 17 00:00:00 2001 From: drigato Date: Thu, 9 Jul 2015 15:16:54 -0400 Subject: [PATCH 09/11] SAAS-939: Add option to preferences to display login button on radio page Change option to ON by default --- airtime_mvc/application/controllers/IndexController.php | 6 +++++- airtime_mvc/application/forms/GeneralPreferences.php | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/airtime_mvc/application/controllers/IndexController.php b/airtime_mvc/application/controllers/IndexController.php index 32e4a17a1..08c17b186 100644 --- a/airtime_mvc/application/controllers/IndexController.php +++ b/airtime_mvc/application/controllers/IndexController.php @@ -27,7 +27,11 @@ class IndexController extends Zend_Controller_Action $this->view->stationUrl = Application_Common_HTTPHelper::getStationUrl(); - $this->view->displayLoginButton = Application_Model_Preference::getRadioPageDisplayLoginButton(); + $displayRadioPageLoginButtonValue = Application_Model_Preference::getRadioPageDisplayLoginButton(); + if ($displayRadioPageLoginButtonValue == "") { + $displayRadioPageLoginButtonValue = true; + } + $this->view->displayLoginButton = $displayRadioPageLoginButtonValue; } diff --git a/airtime_mvc/application/forms/GeneralPreferences.php b/airtime_mvc/application/forms/GeneralPreferences.php index ff3cf4118..94230e667 100644 --- a/airtime_mvc/application/forms/GeneralPreferences.php +++ b/airtime_mvc/application/forms/GeneralPreferences.php @@ -143,9 +143,13 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm '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(Application_Model_Preference::getRadioPageDisplayLoginButton()); + $radioPageLoginButton->setValue($displayRadioPageLoginButtonValue); $this->addElement($radioPageLoginButton); } From c44035c27db1a61f357de407ecd963ac9d8fa0b7 Mon Sep 17 00:00:00 2001 From: drigato Date: Fri, 10 Jul 2015 09:08:19 -0400 Subject: [PATCH 10/11] SAAS-938: Long track metadata messes up player bar on the radio page --- .../public/css/radio-page/premium_player.css | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) 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))); From e4720b59921657b10380f5074b2e2a7e2fc19829 Mon Sep 17 00:00:00 2001 From: Duncan Sommerville Date: Fri, 10 Jul 2015 10:27:28 -0400 Subject: [PATCH 11/11] Remove incorrect sql in 2.5.14 upgrade --- .../controllers/upgrade_sql/airtime_2.5.14/upgrade.sql | 1 - 1 file changed, 1 deletion(-) 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