From 951bd3c9b5f52865e28fe8e03961096cce860f86 Mon Sep 17 00:00:00 2001 From: denise Date: Fri, 8 Jun 2012 10:51:10 -0400 Subject: [PATCH 1/8] CC-3933: Remove version number and date strings from login page footer, add robots.txt -done --- airtime_mvc/application/layouts/scripts/login.phtml | 2 +- airtime_mvc/public/robots.txt | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 airtime_mvc/public/robots.txt diff --git a/airtime_mvc/application/layouts/scripts/login.phtml b/airtime_mvc/application/layouts/scripts/login.phtml index 56a71bfcc..42389f11a 100644 --- a/airtime_mvc/application/layouts/scripts/login.phtml +++ b/airtime_mvc/application/layouts/scripts/login.phtml @@ -13,7 +13,7 @@ layout()->content ?> diff --git a/airtime_mvc/public/robots.txt b/airtime_mvc/public/robots.txt new file mode 100644 index 000000000..7e873bb8c --- /dev/null +++ b/airtime_mvc/public/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Disallow: /login From 76c598c05b58a1d271902e4b0a29d85a4c4d7e37 Mon Sep 17 00:00:00 2001 From: denise Date: Fri, 8 Jun 2012 10:55:13 -0400 Subject: [PATCH 2/8] CC-3940: Calendar displays highlighting with regards to date and time of server instead of adjusting to the Timezone settings -committing diff between original fullcalendar.js and changes made to it --- .../AIRTIME_DEV_README_June_7_2012 | 169 ++++++++++++++++++ 1 file changed, 169 insertions(+) create mode 100644 airtime_mvc/public/js/fullcalendar/AIRTIME_DEV_README_June_7_2012 diff --git a/airtime_mvc/public/js/fullcalendar/AIRTIME_DEV_README_June_7_2012 b/airtime_mvc/public/js/fullcalendar/AIRTIME_DEV_README_June_7_2012 new file mode 100644 index 000000000..1caa62b9e --- /dev/null +++ b/airtime_mvc/public/js/fullcalendar/AIRTIME_DEV_README_June_7_2012 @@ -0,0 +1,169 @@ +Before you overwrite fullcalendar.js, note that we have changed a few lines +in this file. + +Running a diff between the original (fullcalendarMKchanged.js) and our modified one (fullcalendar.js): + +denise@denise-DX4860:~/airtime/airtime_mvc/public/js/fullcalendar$ diff -u fullcalendarMKchanged.js fullcalendar.js +--- fullcalendarMKchanged.js 2012-04-11 17:39:06.734126350 -0400 ++++ fullcalendar.js 2012-06-07 16:08:56.426248827 -0400 +@@ -1,6 +1,6 @@ + /** + * @preserve +- * FullCalendar v1.5.1-CUSTOM (Changes by Martin Konecny -added primitive support for timezones) ++ * FullCalendar v1.5.3 + * http://arshaw.com/fullcalendar/ + * + * Use fullcalendar.css for basic styling. +@@ -11,7 +11,7 @@ + * Dual licensed under the MIT and GPL licenses, located in + * MIT-LICENSE.txt and GPL-LICENSE.txt respectively. + * +- * Date: Sat Apr 9 14:09:51 2011 -0700 ++ * Date: Mon Feb 6 22:40:40 2012 -0800 + * + */ + +@@ -111,7 +111,7 @@ + + + +-var fc = $.fullCalendar = { version: "1.5.1" }; ++var fc = $.fullCalendar = { version: "1.5.3" }; + var fcViews = fc.views = {}; + + +@@ -227,7 +227,7 @@ + var absoluteViewElement; + var resizeUID = 0; + var ignoreWindowResize = 0; +- var date = adjustDateToServerDate(new Date(), options["serverTimezoneOffset"]); ++ var date = new Date(); + var events = []; + var _dragElement; + +@@ -399,9 +399,7 @@ + elementOuterWidth = element.outerWidth(); + + header.updateTitle(currentView.title); +- //adjusting this date ensures that the "today" button is greyed out on the +- //correct day. +- var today = adjustDateToServerDate(new Date(), options["serverTimezoneOffset"]); ++ var today = new Date(); + if (today >= currentView.start && today < currentView.end) { + header.disableButton('today'); + }else{ +@@ -583,8 +581,7 @@ + + + function today() { +- //adjusting this date ensures that clicking "today" takes us to the correct date. +- date = adjustDateToServerDate(new Date(), options["serverTimezoneOffset"]); ++ date = new Date(); + renderView(); + } + +@@ -1398,7 +1395,7 @@ + return null; + } + var date = new Date(m[1], 0, 1); +- if (ignoreTimezone || !m[14]) { ++ if (ignoreTimezone || !m[13]) { + var check = new Date(m[1], 0, 1, 9, 0); + if (m[3]) { + date.setMonth(m[3] - 1); +@@ -1434,9 +1431,11 @@ + m[10] || 0, + m[12] ? Number("0." + m[12]) * 1000 : 0 + ); +- var offset = Number(m[16]) * 60 + (m[18] ? Number(m[18]) : 0); +- offset *= m[15] == '-' ? 1 : -1; +- date = new Date(+date + (offset * 60 * 1000)); ++ if (m[14]) { ++ var offset = Number(m[16]) * 60 + (m[18] ? Number(m[18]) : 0); ++ offset *= m[15] == '-' ? 1 : -1; ++ date = new Date(+date + (offset * 60 * 1000)); ++ } + } + return date; + } +@@ -2188,11 +2187,18 @@ + }else{ + clearEvents(); + } +- updateCells(firstTime); ++ getOffset(); + } + +- +- ++ function getOffset() { ++ var timezoneOffset; ++ $.ajax({ url: "/Api/calendar-init/format/json", dataType:"json", success:function(data) { ++ timezoneOffset = data.calendarInit.timezoneOffset*1000; ++ var firstTime = !body; ++ updateCells(firstTime, timezoneOffset); ++ }, error:function(jqXHR, textStatus, errorThrown){}}); ++ } ++ + function updateOptions() { + rtl = opt('isRTL'); + if (rtl) { +@@ -2273,15 +2279,17 @@ + .appendTo(element); + } + +- +- +- function updateCells(firstTime) { ++ function updateCells(firstTime, timezoneOffset) { + var dowDirty = firstTime || rowCnt == 1; // could the cells' day-of-weeks need updating? + var month = t.start.getMonth(); +- var today = clearTime(adjustDateToServerDate(new Date(), opt("serverTimezoneOffset"))); + var cell; + var date; + var row; ++ ++ var today = new Date(); ++ var utc = today.getTime() + (today.getTimezoneOffset()*60000); ++ var userTime = new Date(utc + timezoneOffset); ++ today = clearTime(userTime); + + if (dowDirty) { + headCells.each(function(i, _cell) { +@@ -3111,7 +3119,7 @@ + var headCell; + var bodyCell; + var date; +- var today = clearTime(adjustDateToServerDate(new Date(), opt("serverTimezoneOffset"))); ++ var today = clearTime(new Date()); + for (i=0; i Date: Fri, 8 Jun 2012 11:39:04 -0400 Subject: [PATCH 3/8] CC-3837: Calendar -> Add Show: Show's duration check does actually allow to create less than 25 hours' show. -fixed --- airtime_mvc/application/forms/AddShowWhen.php | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/airtime_mvc/application/forms/AddShowWhen.php b/airtime_mvc/application/forms/AddShowWhen.php index 73405e5a1..ba0a4df26 100644 --- a/airtime_mvc/application/forms/AddShowWhen.php +++ b/airtime_mvc/application/forms/AddShowWhen.php @@ -117,19 +117,24 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm } $pattern = '/([0-9][0-9])h ([0-9][0-9])m/'; - preg_match($pattern, $formData['add_show_duration'], $matches); - $hours = $matches[1]; - $minutes = $matches[2]; - if( $formData["add_show_duration"] == "00h 00m" ) { - $this->getElement('add_show_duration')->setErrors(array('Cannot have duration 00h 00m')); - $valid = false; - }elseif(strpos($formData["add_show_duration"], 'h') !== false && $hours >= 24) { - if ($hours > 24 || ($hours == 24 && $minutes > 0)) { - $this->getElement('add_show_duration')->setErrors(array('Cannot have duration greater than 24h')); + + if (preg_match($pattern, $formData['add_show_duration'], $matches) && count($matches) == 3) { + $hours = $matches[1]; + $minutes = $matches[2]; + if( $formData["add_show_duration"] == "00h 00m" ) { + $this->getElement('add_show_duration')->setErrors(array('Cannot have duration 00h 00m')); + $valid = false; + }elseif(strpos($formData["add_show_duration"], 'h') !== false && $hours >= 24) { + if ($hours > 24 || ($hours == 24 && $minutes > 0)) { + $this->getElement('add_show_duration')->setErrors(array('Cannot have duration greater than 24h')); + $valid = false; + } + }elseif( strstr($formData["add_show_duration"], '-') ){ + $this->getElement('add_show_duration')->setErrors(array('Cannot have duration < 0m')); $valid = false; } - }elseif( strstr($formData["add_show_duration"], '-') ){ - $this->getElement('add_show_duration')->setErrors(array('Cannot have duration < 0m')); + } + else { $valid = false; } From 2d78f58d4228dfc869ac1f77c57e96eb40f87a58 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Fri, 8 Jun 2012 11:43:55 -0400 Subject: [PATCH 4/8] CC-3947: Pypo log history is too brief -increased history by 10x --- python_apps/pypo/logging.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python_apps/pypo/logging.cfg b/python_apps/pypo/logging.cfg index c74ad0b68..f0a4b4bee 100644 --- a/python_apps/pypo/logging.cfg +++ b/python_apps/pypo/logging.cfg @@ -51,7 +51,7 @@ args=("/var/log/airtime/pypo/notify.log", 'a', 1000000, 5,) class=logging.handlers.RotatingFileHandler level=DEBUG formatter=simpleFormatter -args=("/var/log/airtime/pypo/pypo.log", 'a', 1000000, 5,) +args=("/var/log/airtime/pypo/pypo.log", 'a', 5000000, 10,) [handler_recorder] class=logging.handlers.RotatingFileHandler From 33f77c8c280d4fa19f3ba15d7b27c81b31ae2269 Mon Sep 17 00:00:00 2001 From: denise Date: Fri, 8 Jun 2012 12:03:23 -0400 Subject: [PATCH 5/8] CC-3923: Show Timefilter - Even If the time filter is scheduled for yesterday it displays the Show played today -fixed --- airtime_mvc/public/js/airtime/utilities/utilities.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/airtime_mvc/public/js/airtime/utilities/utilities.js b/airtime_mvc/public/js/airtime/utilities/utilities.js index 54475a580..844f91e66 100644 --- a/airtime_mvc/public/js/airtime/utilities/utilities.js +++ b/airtime_mvc/public/js/airtime/utilities/utilities.js @@ -96,7 +96,7 @@ var AIRTIME = (function(AIRTIME){ iRange = iEnd - iStart; - if (iRange === 0 || iEnd < iStart) { + if (iEnd < iStart) { iEnd = iStart + DEFAULT_RANGE; iRange = DEFAULT_RANGE; } @@ -110,4 +110,4 @@ var AIRTIME = (function(AIRTIME){ return AIRTIME; -}(AIRTIME || {})); \ No newline at end of file +}(AIRTIME || {})); From 0416c05f9cd2b8610b9360eb829339d7df22b793 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Fri, 8 Jun 2012 12:06:54 -0400 Subject: [PATCH 6/8] add reason why Propel connection failed --- airtime_mvc/application/models/Preference.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/airtime_mvc/application/models/Preference.php b/airtime_mvc/application/models/Preference.php index 248442af5..d1b821488 100644 --- a/airtime_mvc/application/models/Preference.php +++ b/airtime_mvc/application/models/Preference.php @@ -66,7 +66,7 @@ class Application_Model_Preference } catch (Exception $e){ header('HTTP/1.0 503 Service Unavailable'); - Logging::log("Could not connect to database."); + Logging::log("Could not connect to database: ".$e->getMessage()); exit; } @@ -104,7 +104,7 @@ class Application_Model_Preference } } catch (Exception $e) { header('HTTP/1.0 503 Service Unavailable'); - Logging::log("Could not connect to database."); + Logging::log("Could not connect to database: ".$e->getMessage()); exit; } } From cf32096d9cc53d82b232ce093042a85d5ecdac75 Mon Sep 17 00:00:00 2001 From: denise Date: Fri, 8 Jun 2012 12:14:16 -0400 Subject: [PATCH 7/8] CC-3942: Canceling a storage folder change does not blank the Import Folder field -fixed --- airtime_mvc/public/js/airtime/preferences/musicdirs.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/airtime_mvc/public/js/airtime/preferences/musicdirs.js b/airtime_mvc/public/js/airtime/preferences/musicdirs.js index 7e70b8650..8edb019c8 100644 --- a/airtime_mvc/public/js/airtime/preferences/musicdirs.js +++ b/airtime_mvc/public/js/airtime/preferences/musicdirs.js @@ -56,6 +56,9 @@ function setWatchedDirEvents() { setWatchedDirEvents(); }); } + else { + $('#storageFolder').val(""); + } }); $('#watchedFolder-ok').click(function(){ From 7d4851573f717a09d71554595743943138b3ebea Mon Sep 17 00:00:00 2001 From: denise Date: Fri, 8 Jun 2012 13:09:14 -0400 Subject: [PATCH 8/8] CC-3951: Password Reset: You can still reset password even after system email for Password Reset disabled -fixed --- .../controllers/LoginController.php | 51 ++++++++++--------- 1 file changed, 28 insertions(+), 23 deletions(-) diff --git a/airtime_mvc/application/controllers/LoginController.php b/airtime_mvc/application/controllers/LoginController.php index 043983ede..bb39d2978 100644 --- a/airtime_mvc/application/controllers/LoginController.php +++ b/airtime_mvc/application/controllers/LoginController.php @@ -14,7 +14,7 @@ class LoginController extends Zend_Controller_Action if (Zend_Auth::getInstance()->hasIdentity()) { - $this->_redirect('Showbuilder'); + $this->_redirect('Showbuilder'); } //uses separate layout without a navigation. @@ -99,30 +99,35 @@ class LoginController extends Zend_Controller_Action } public function passwordRestoreAction() - { - //uses separate layout without a navigation. - $this->_helper->layout->setLayout('login'); - - $form = new Application_Form_PasswordRestore(); - - $request = $this->getRequest(); - if ($request->isPost() && $form->isValid($request->getPost())) { - $user = CcSubjsQuery::create() - ->filterByDbEmail($form->email->getValue()) - ->findOne(); - - if (!empty($user)) { - $auth = new Application_Model_Auth(); - - $auth->sendPasswordRestoreLink($user, $this->view); - $this->_helper->redirector('password-restore-after', 'login'); - } - else { - $form->email->addError($this->view->translate("Given email not found.")); - } + { + if (!Application_Model_Preference::GetEnableSystemEmail()) { + $this->_redirect('login'); } + else { + //uses separate layout without a navigation. + $this->_helper->layout->setLayout('login'); + + $form = new Application_Form_PasswordRestore(); - $this->view->form = $form; + $request = $this->getRequest(); + if ($request->isPost() && $form->isValid($request->getPost())) { + $user = CcSubjsQuery::create() + ->filterByDbEmail($form->email->getValue()) + ->findOne(); + + if (!empty($user)) { + $auth = new Application_Model_Auth(); + + $auth->sendPasswordRestoreLink($user, $this->view); + $this->_helper->redirector('password-restore-after', 'login'); + } + else { + $form->email->addError($this->view->translate("Given email not found.")); + } + } + + $this->view->form = $form; + } } public function passwordRestoreAfterAction()