From 4ad8ee2472bc63ff29acd7e97bb5617dea96feb7 Mon Sep 17 00:00:00 2001 From: James Date: Thu, 18 Oct 2012 14:32:56 -0400 Subject: [PATCH 001/113] - removing a line for saas --- airtime_mvc/application/controllers/ScheduleController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airtime_mvc/application/controllers/ScheduleController.php b/airtime_mvc/application/controllers/ScheduleController.php index a8b5b557c..d893b590f 100644 --- a/airtime_mvc/application/controllers/ScheduleController.php +++ b/airtime_mvc/application/controllers/ScheduleController.php @@ -797,7 +797,7 @@ class ScheduleController extends Zend_Controller_Action if (!$validateStartTime) { $this->view->when->getElement('add_show_start_time')->setOptions(array('disabled' => true)); } - $this->view->rr->getElement('add_show_record')->setOptions(array('disabled' => true)); + //$this->view->rr->getElement('add_show_record')->setOptions(array('disabled' => true)); $this->view->addNewShow = false; $this->view->action = "edit-show"; $this->view->form = $this->view->render('schedule/add-show-form.phtml'); From d23ba12aaab3c86d8b09182a25c872918c25514d Mon Sep 17 00:00:00 2001 From: denise Date: Fri, 19 Oct 2012 15:42:09 -0400 Subject: [PATCH 002/113] CC-4608: Chat Box is gone on sourcefabric.airtime.pro -fixed --- airtime_mvc/application/Bootstrap.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/airtime_mvc/application/Bootstrap.php b/airtime_mvc/application/Bootstrap.php index c4c53ffa5..6b698c3d6 100644 --- a/airtime_mvc/application/Bootstrap.php +++ b/airtime_mvc/application/Bootstrap.php @@ -75,6 +75,7 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap $view->headScript()->appendScript("var baseUrl='$baseUrl/'"); //scripts for now playing bar + $view->headScript()->appendFile($baseUrl.'/js/airtime/airtime_bootstrap.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $view->headScript()->appendFile($baseUrl.'/js/airtime/dashboard/helperfunctions.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $view->headScript()->appendFile($baseUrl.'/js/airtime/dashboard/dashboard.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $view->headScript()->appendFile($baseUrl.'/js/airtime/dashboard/versiontooltip.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); @@ -89,9 +90,13 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap } else { $userType = ""; } - $view->headScript()->appendScript("var userType = '$userType';"); - + if (strpos($_SERVER['REQUEST_URI'], $baseUrl.'/Dashboard/stream-player') === false + && strpos($_SERVER['REQUEST_URI'], $baseUrl.'/audiopreview/audio-preview') === false) { + $client_id = Application_Model_Preference::GetClientId(); + $view->headScript()->appendScript("var livechat_client_id = '$client_id';"); + $view->headScript()->appendFile($baseUrl . '/js/airtime/common/livechat.js?'.$CC_CONFIG['airtime_version'], 'text/javascript'); + } if (isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1) { $view->headScript()->appendFile($baseUrl.'/js/libs/google-analytics.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); From b4264f83e8282c555196801fd13f092c8d119c84 Mon Sep 17 00:00:00 2001 From: denise Date: Fri, 19 Oct 2012 15:45:14 -0400 Subject: [PATCH 003/113] CC-4608: Chat Box is gone on sourcefabric.airtime.pro --- airtime_mvc/application/Bootstrap.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/airtime_mvc/application/Bootstrap.php b/airtime_mvc/application/Bootstrap.php index 6b698c3d6..392161212 100644 --- a/airtime_mvc/application/Bootstrap.php +++ b/airtime_mvc/application/Bootstrap.php @@ -90,6 +90,8 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap } else { $userType = ""; } + + $view->headScript()->appendScript("var userType = '$userType';"); if (strpos($_SERVER['REQUEST_URI'], $baseUrl.'/Dashboard/stream-player') === false && strpos($_SERVER['REQUEST_URI'], $baseUrl.'/audiopreview/audio-preview') === false) { From 70ed5548b9ddc5563caf1873e2d7f7a0a93f4e75 Mon Sep 17 00:00:00 2001 From: denise Date: Tue, 23 Oct 2012 16:50:25 -0400 Subject: [PATCH 004/113] -chat box was appearing in playlist-preview window --- airtime_mvc/application/Bootstrap.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/airtime_mvc/application/Bootstrap.php b/airtime_mvc/application/Bootstrap.php index 392161212..ce3096d0f 100644 --- a/airtime_mvc/application/Bootstrap.php +++ b/airtime_mvc/application/Bootstrap.php @@ -94,7 +94,8 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap $view->headScript()->appendScript("var userType = '$userType';"); if (strpos($_SERVER['REQUEST_URI'], $baseUrl.'/Dashboard/stream-player') === false - && strpos($_SERVER['REQUEST_URI'], $baseUrl.'/audiopreview/audio-preview') === false) { + && strpos($_SERVER['REQUEST_URI'], $baseUrl.'/audiopreview/audio-preview') === false + && strpos($_SERVER['REQUEST_URI'], $baseUrl.'/audiopreview/playlist-preview') === false) { $client_id = Application_Model_Preference::GetClientId(); $view->headScript()->appendScript("var livechat_client_id = '$client_id';"); $view->headScript()->appendFile($baseUrl . '/js/airtime/common/livechat.js?'.$CC_CONFIG['airtime_version'], 'text/javascript'); From a4d91a5d48e279d33a354f57d47d388f719e7677 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Tue, 23 Oct 2012 17:44:06 -0400 Subject: [PATCH 005/113] CC-4620: Now Playing page loading is very slow because 1M records in cc_schedule table -small fix --- airtime_mvc/application/models/Schedule.php | 45 +++++++++++-------- .../application/models/ShowBuilder.php | 3 +- 2 files changed, 28 insertions(+), 20 deletions(-) diff --git a/airtime_mvc/application/models/Schedule.php b/airtime_mvc/application/models/Schedule.php index 233128433..b668f13e5 100644 --- a/airtime_mvc/application/models/Schedule.php +++ b/airtime_mvc/application/models/Schedule.php @@ -263,6 +263,15 @@ SQL; global $CC_CONFIG; $con = Propel::getConnection(); + $p_start_str = $p_start->format("Y-m-d H:i:s"); + $p_end_str = $p_end->format("Y-m-d H:i:s"); + + + //We need to search 24 hours before and after the show times so that that we + //capture all of the show's contents. + $p_track_start= $p_start->sub(new DateInterval("PT24H"))->format("Y-m-d H:i:s"); + $p_track_end = $p_end->add(new DateInterval("PT24H"))->format("Y-m-d H:i:s"); + $templateSql = <<= '{$p_start}' - AND sched.starts < '{$p_end}') - OR (sched.ends > '{$p_start}' - AND sched.ends <= '{$p_end}') - OR (sched.starts <= '{$p_start}' - AND sched.ends >= '{$p_end}')) + AND ((sched.starts >= '{$p_track_start}' + AND sched.starts < '{$p_track_end}') + OR (sched.ends > '{$p_track_start}' + AND sched.ends <= '{$p_track_end}') + OR (sched.starts <= '{$p_track_start}' + AND sched.ends >= '{$p_track_end}')) ) SQL; @@ -315,12 +324,12 @@ SQL; $streamJoin = <<= '{$p_start}' - AND sched.starts < '{$p_end}') - OR (sched.ends > '{$p_start}' - AND sched.ends <= '{$p_end}') - OR (sched.starts <= '{$p_start}' - AND sched.ends >= '{$p_end}')) + AND ((sched.starts >= '{$p_track_start}' + AND sched.starts < '{$p_track_end}') + OR (sched.ends > '{$p_track_start}' + AND sched.ends <= '{$p_track_end}') + OR (sched.starts <= '{$p_track_start}' + AND sched.ends >= '{$p_track_end}')) ) LEFT JOIN cc_subjs AS sub ON (ws.creator_id = sub.id) SQL; @@ -358,12 +367,12 @@ SELECT showt.name AS show_name, JOIN cc_show AS showt ON (showt.id = si.show_id) WHERE si.modified_instance = FALSE $showPredicate - AND ((si.starts >= '{$p_start}' - AND si.starts < '{$p_end}') - OR (si.ends > '{$p_start}' - AND si.ends <= '{$p_end}') - OR (si.starts <= '{$p_start}' - AND si.ends >= '{$p_end}')) + AND ((si.starts >= '{$p_start_str}' + AND si.starts < '{$p_end_str}') + OR (si.ends > '{$p_start_str}' + AND si.ends <= '{$p_end_str}') + OR (si.starts <= '{$p_start_str}' + AND si.ends >= '{$p_end_str}')) ORDER BY si_starts, sched_starts; SQL; diff --git a/airtime_mvc/application/models/ShowBuilder.php b/airtime_mvc/application/models/ShowBuilder.php index 90a67a1d6..8436c3011 100644 --- a/airtime_mvc/application/models/ShowBuilder.php +++ b/airtime_mvc/application/models/ShowBuilder.php @@ -423,8 +423,7 @@ class Application_Model_ShowBuilder } $scheduled_items = Application_Model_Schedule::GetScheduleDetailItems( - $this->startDT->format("Y-m-d H:i:s"), $this->endDT->format( - "Y-m-d H:i:s"), $shows); + $this->startDT, $this->endDT, $shows); for ($i = 0, $rows = count($scheduled_items); $i < $rows; $i++) { From b8d6132b52eb65f305b36f113fc8f45ba4dfbf1f Mon Sep 17 00:00:00 2001 From: James Date: Tue, 23 Oct 2012 18:47:15 -0400 Subject: [PATCH 006/113] - saas patch #1 --- .../application/controllers/ApiController.php | 16 +++++++ .../controllers/PreferenceController.php | 1 - .../forms/SoundcloudPreferences.php | 10 ----- airtime_mvc/application/models/RabbitMq.php | 42 +++++++++++++++++++ airtime_mvc/application/models/User.php | 12 +++++- .../scripts/form/preferences_soundcloud.phtml | 13 ------ 6 files changed, 69 insertions(+), 25 deletions(-) diff --git a/airtime_mvc/application/controllers/ApiController.php b/airtime_mvc/application/controllers/ApiController.php index 1a1876ce9..5d07d250a 100644 --- a/airtime_mvc/application/controllers/ApiController.php +++ b/airtime_mvc/application/controllers/ApiController.php @@ -686,6 +686,22 @@ class ApiController extends Zend_Controller_Action Logging::info("Registered Component: ".$component."@".$remoteAddr); Application_Model_ServiceRegister::Register($component, $remoteAddr); + + //send ip, subdomain + if (Application_Model_Preference::GetPlanLevel() != 'disabled'){ + if ($component == "pypo"){ + $split = explode('.', $_SERVER['SERVER_NAME']); + if (count($split) > 0){ + $subDomain = $split[0]; + + $md = array(); + $md["sub_domain"] = $subDomain; + $md["pypo_ip"] = $remoteAddr; + + Application_Model_RabbitMq::SendMessageToHaproxyConfigDaemon($md); + } + } + } } public function updateLiquidsoapStatusAction() diff --git a/airtime_mvc/application/controllers/PreferenceController.php b/airtime_mvc/application/controllers/PreferenceController.php index 5c375deab..c1ffda4ad 100644 --- a/airtime_mvc/application/controllers/PreferenceController.php +++ b/airtime_mvc/application/controllers/PreferenceController.php @@ -53,7 +53,6 @@ class PreferenceController extends Zend_Controller_Action Application_Model_Preference::SetMailServerRequiresAuth($values["preferences_email_server"]["msRequiresAuth"]); } - Application_Model_Preference::SetAutoUploadRecordedShowToSoundcloud($values["preferences_soundcloud"]["UseSoundCloud"]); Application_Model_Preference::SetUploadToSoundcloudOption($values["preferences_soundcloud"]["UploadToSoundcloudOption"]); Application_Model_Preference::SetSoundCloudDownloadbleOption($values["preferences_soundcloud"]["SoundCloudDownloadbleOption"]); Application_Model_Preference::SetSoundCloudUser($values["preferences_soundcloud"]["SoundCloudUser"]); diff --git a/airtime_mvc/application/forms/SoundcloudPreferences.php b/airtime_mvc/application/forms/SoundcloudPreferences.php index d3840cbbf..848368697 100644 --- a/airtime_mvc/application/forms/SoundcloudPreferences.php +++ b/airtime_mvc/application/forms/SoundcloudPreferences.php @@ -11,16 +11,6 @@ class Application_Form_SoundcloudPreferences extends Zend_Form_SubForm array('ViewScript', array('viewScript' => 'form/preferences_soundcloud.phtml')) )); - //enable soundcloud uploads - $this->addElement('checkbox', 'UseSoundCloud', array( - 'label' => 'Automatically Upload Recorded Shows', - 'required' => false, - 'value' => Application_Model_Preference::GetAutoUploadRecordedShowToSoundcloud(), - 'decorators' => array( - 'ViewHelper' - ) - )); - //enable soundcloud uploads option $this->addElement('checkbox', 'UploadToSoundcloudOption', array( 'label' => 'Enable SoundCloud Upload', diff --git a/airtime_mvc/application/models/RabbitMq.php b/airtime_mvc/application/models/RabbitMq.php index d92975413..7fea88348 100644 --- a/airtime_mvc/application/models/RabbitMq.php +++ b/airtime_mvc/application/models/RabbitMq.php @@ -71,4 +71,46 @@ class Application_Model_RabbitMq self::sendMessage($exchange, $data); } + + public static function SendMessageToHaproxyConfigDaemon($md){ + $config = parse_ini_file("/etc/airtime-saas/rabbitmq.ini", true); + $conn = new AMQPConnection($config["rabbitmq"]["host"], + $config["rabbitmq"]["port"], + $config["rabbitmq"]["user"], + $config["rabbitmq"]["password"], + $config["rabbitmq"]["vhost"]); + + $exchange = $config["rabbitmq"]["queue"]; + $queue = $config["rabbitmq"]["queue"]; + + $ch = $conn->channel(); + + + /* + name: $queue + passive: false + durable: true // the queue will survive server restarts + exclusive: false // the queue can be accessed in other channels + auto_delete: false //the queue won't be deleted once the channel is closed. + */ + $ch->queue_declare($queue, false, true, false, false); + + /* + name: $exchange + type: direct + passive: false + durable: true // the exchange will survive server restarts + auto_delete: false //the exchange won't be deleted once the channel is closed. + */ + + $ch->exchange_declare($exchange, 'direct', false, true, false); + $ch->queue_bind($queue, $exchange); + + $data = json_encode($md).PHP_EOL; + $msg = new AMQPMessage($data, array('content_type' => 'application/json')); + + $ch->basic_publish($msg, $exchange); + $ch->close(); + $conn->close(); + } } diff --git a/airtime_mvc/application/models/User.php b/airtime_mvc/application/models/User.php index 63b82820a..48a4c3e2f 100644 --- a/airtime_mvc/application/models/User.php +++ b/airtime_mvc/application/models/User.php @@ -329,14 +329,24 @@ class Application_Model_User $res = Application_Model_Datatables::findEntries($con, $displayColumns, $fromTable, $datatables); // mark record which is for the current user - foreach ($res['aaData'] as &$record) { + foreach($res['aaData'] as $key => &$record){ if ($record['login'] == $username) { $record['delete'] = "self"; } else { $record['delete'] = ""; } + + if($record['login'] == 'sourcefabric_admin'){ + //arrays in PHP are basically associative arrays that can be iterated in order. + //Deleting an earlier element does not change the keys of elements that come after it. --MK + unset($res['aaData'][$key]); + $res['iTotalDisplayRecords']--; + $res['iTotalRecords']--; + } } + $res['aaData'] = array_values($res['aaData']); + return $res; } diff --git a/airtime_mvc/application/views/scripts/form/preferences_soundcloud.phtml b/airtime_mvc/application/views/scripts/form/preferences_soundcloud.phtml index 20bcc92c9..8a007c10d 100644 --- a/airtime_mvc/application/views/scripts/form/preferences_soundcloud.phtml +++ b/airtime_mvc/application/views/scripts/form/preferences_soundcloud.phtml @@ -13,19 +13,6 @@ -
- - element->getElement('UseSoundCloud')->hasErrors()) : ?> -
    - element->getElement('UseSoundCloud')->getMessages() as $error): ?> -
  • - -
- -
- isSaas ){?> -
- -
-
- element->getElement('master_harbor_input_port') ?> - element->getElement('master_harbor_input_port')->hasErrors()) : ?> -
    - element->getElement('master_harbor_input_port')->getMessages() as $error): ?> -
  • - -
- -
-
- -
-
- element->getElement('master_harbor_input_mount_point') ?> - element->getElement('master_harbor_input_mount_point')->hasErrors()) : ?> -
    - element->getElement('master_harbor_input_mount_point')->getMessages() as $error): ?> -
  • - -
- -
-
element->getElement('master_dj_connection_url')->setValue($this->master_dj_connection_url) ?> - isSaas && !$this->isDemo){?> - Override   - -
-
- isSaas ){?> -
- -
-
- element->getElement('dj_harbor_input_port') ?> - element->getElement('dj_harbor_input_port')->hasErrors()) : ?> -
    - element->getElement('dj_harbor_input_port')->getMessages() as $error): ?> -
  • - -
- -
-
- -
-
- element->getElement('dj_harbor_input_mount_point') ?> - element->getElement('dj_harbor_input_mount_point')->hasErrors()) : ?> -
    - element->getElement('dj_harbor_input_mount_point')->getMessages() as $error): ?> -
  • - -
- -
-
element->getElement('live_dj_connection_url')->setValue($this->live_dj_connection_url) ?> - isSaas && !$this->isDemo ){?> - Override   - -
- diff --git a/airtime_mvc/application/views/scripts/form/support-setting.phtml b/airtime_mvc/application/views/scripts/form/support-setting.phtml index f35a6eab1..012cbb6a7 100644 --- a/airtime_mvc/application/views/scripts/form/support-setting.phtml +++ b/airtime_mvc/application/views/scripts/form/support-setting.phtml @@ -1,45 +1,5 @@
-isSaas ){?> -
-
-
- Help Airtime improve by letting Sourcefabric know how you are using it. This information - will be collected regularly in order to enhance your user experience.
- Click the "Send support feedback" box and we'll make sure the features you use are - constantly improving. -
- - element->getElement('SupportFeedback')->hasErrors()) : ?> -
    - element->getElement('SupportFeedback')->getMessages() as $error): ?> -
  • - -
- -
-
-
Click the box below to promote your station on - Sourcefabric.org. -
- - element->getElement('Publicise')->hasErrors()) : ?> -
    - element->getElement('Publicise')->getMessages() as $error): ?> -
  • - -
- -
-
-
(In order to promote your station, "Send support feedback" must be enabled).

- -
;"> +
;">
-isSaas ){?> -
-
- Show me what I am sending -
- element->getElement('SendInfo') ?> -
-
-
- -
-
- element->getView()->privacyChecked){?> - - element->getElement('Privacy')->hasErrors()) : ?> -
    - element->getElement('Privacy')->getMessages() as $error): ?> -
  • - -
- - - Sourcefabric Privacy Policy - -
- diff --git a/airtime_mvc/application/views/scripts/menu.phtml b/airtime_mvc/application/views/scripts/menu.phtml index 0e6eb8dc1..215fbbcf1 100644 --- a/airtime_mvc/application/views/scripts/menu.phtml +++ b/airtime_mvc/application/views/scripts/menu.phtml @@ -1,9 +1,3 @@ - + diff --git a/airtime_mvc/public/js/airtime/preferences/preferences.js b/airtime_mvc/public/js/airtime/preferences/preferences.js index 2c0ef024a..dae344b70 100644 --- a/airtime_mvc/public/js/airtime/preferences/preferences.js +++ b/airtime_mvc/public/js/airtime/preferences/preferences.js @@ -92,10 +92,36 @@ function setCollapsibleWidgetJsCode() { $('#widgetCode-label').hide("fast"); $('#widgetCode-element').hide("fast"); } - }); } +function createWidgetHelpDescription() { + $('#thirdPartyApiInfo').qtip({ + content: { + text: "Enabling this feature will allow Airtime to " + + "provide schedule data to external widgets that can be embedded " + + "in your website. Enable this feature to reveal the embeddable " + + "code." + }, + hide: { + delay: 500, + fixed: true + }, + style: { + border: { + width: 0, + radius: 4 + }, + classes: "ui-tooltip-dark ui-tooltip-rounded" + }, + position: { + my: "left bottom", + at: "right center" + }, + }); + +} + $(document).ready(function() { $('.collapsible-header').live('click',function() { @@ -111,4 +137,5 @@ $(document).ready(function() { setConfigureMailServerListener(); setEnableSystemEmailsListener(); setCollapsibleWidgetJsCode(); + createWidgetHelpDescription(); }); From bb8f5e107c93c5f120148a3ef8393283d32c45a0 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Wed, 7 Nov 2012 17:19:47 -0500 Subject: [PATCH 015/113] CC-4661: Listener Statistics -ability to gather stats without admin password --- python_apps/pypo/listenerstat.py | 26 ++++++++++++-------------- python_apps/pypo/pypocli.py | 2 +- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/python_apps/pypo/listenerstat.py b/python_apps/pypo/listenerstat.py index 431f05e98..306015a58 100644 --- a/python_apps/pypo/listenerstat.py +++ b/python_apps/pypo/listenerstat.py @@ -10,8 +10,9 @@ import time from api_clients import api_client class ListenerStat(Thread): - def __init__(self, logger=None): + def __init__(self, config, logger=None): Thread.__init__(self) + self.config = config self.api_client = api_client.AirtimeApiClient() if logger is None: self.logger = logging.getLogger() @@ -31,20 +32,18 @@ class ListenerStat(Thread): def get_icecast_xml(self, ip): - encoded = base64.b64encode("%(admin_user)s:%(admin_password)s" % ip) + #encoded = base64.b64encode("%(admin_user)s:%(admin_password)s" % ip) - header = {"Authorization":"Basic %s" % encoded} + #header = {"Authorization":"Basic %s" % encoded} self.logger.debug(ip) - url = 'http://%(host)s:%(port)s/admin/stats.xml' % ip + url = 'http://%(host)s:%(port)s/stats.xsl' % ip self.logger.debug(url) - req = urllib2.Request( - #assuming that the icecast stats path is /admin/stats.xml - #need to fix this - url=url, - headers=header) + req = urllib2.Request(url=url) + #headers=header) f = urllib2.urlopen(req) document = f.read() + return document @@ -78,11 +77,10 @@ class ListenerStat(Thread): #streams are the same server, we will still initiate 3 separate #connections for k, v in stream_parameters.items(): - v["admin_user"] = "admin" - v["admin_password"] = "hackme" + #v["admin_user"] = "admin" + #v["admin_password"] = "hackme" if v["enable"] == 'true': stats.append(self.get_icecast_stats(v)) - #stats.append(get_shoutcast_stats(ip)) return stats @@ -123,5 +121,5 @@ if __name__ == "__main__": # add ch to logger #logger.addHandler(ch) - ls = ListenerStat(logger) - ls.run() + #ls = ListenerStat(logger=logger) + #ls.run() diff --git a/python_apps/pypo/pypocli.py b/python_apps/pypo/pypocli.py index 1b51a13f8..ac511c8e5 100644 --- a/python_apps/pypo/pypocli.py +++ b/python_apps/pypo/pypocli.py @@ -210,7 +210,7 @@ if __name__ == '__main__': recorder.daemon = True recorder.start() - stat = ListenerStat() + stat = ListenerStat(config) stat.daemon = True stat.start() From a0a9fc71f171928c22dcc4b22552d7e7a555cc94 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Mon, 12 Nov 2012 17:44:26 -0500 Subject: [PATCH 016/113] disable unlimited attempts for pushing stats data --- python_apps/api_clients/api_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python_apps/api_clients/api_client.py b/python_apps/api_clients/api_client.py index ca1f37cd8..22c28e7c4 100644 --- a/python_apps/api_clients/api_client.py +++ b/python_apps/api_clients/api_client.py @@ -764,7 +764,7 @@ class AirtimeApiClient(object): json_data = json.dumps(data) encoded_data = urllib.urlencode({'data': json_data}) request = urllib2.Request(url, encoded_data) - print self.get_response_from_server(request) + print self.get_response_from_server(request, attempts = 1) except Exception, e: self.logger.error("Exception: %s", e) From 0f2d5bc844e1ac69b95ab8e801fe4df179da0d87 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Mon, 12 Nov 2012 17:45:20 -0500 Subject: [PATCH 017/113] files should not be independent events --- airtime_mvc/application/models/Schedule.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airtime_mvc/application/models/Schedule.php b/airtime_mvc/application/models/Schedule.php index aceeb3849..f98547059 100644 --- a/airtime_mvc/application/models/Schedule.php +++ b/airtime_mvc/application/models/Schedule.php @@ -687,7 +687,7 @@ SQL; 'end' => $end, 'show_name' => $item["show_name"], 'replay_gain' => is_null($item["replay_gain"]) ? "0": $item["replay_gain"], - 'independent_event' => true + 'independent_event' => false ); self::appendScheduleItem($data, $start, $schedule_item); } From d8165cbf44f70b8983e3b80af1e17755a56577e0 Mon Sep 17 00:00:00 2001 From: James Date: Tue, 13 Nov 2012 16:32:36 -0500 Subject: [PATCH 018/113] - haproxy support subdomain name with '.' --- .../application/controllers/ApiController.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/airtime_mvc/application/controllers/ApiController.php b/airtime_mvc/application/controllers/ApiController.php index 928d5adb0..5ad5bfbad 100644 --- a/airtime_mvc/application/controllers/ApiController.php +++ b/airtime_mvc/application/controllers/ApiController.php @@ -693,13 +693,21 @@ class ApiController extends Zend_Controller_Action if (Application_Model_Preference::GetPlanLevel() != 'disabled'){ if ($component == "pypo"){ $split = explode('.', $_SERVER['SERVER_NAME']); - if (count($split) > 0){ - $subDomain = $split[0]; - + $subdomain = array(); + foreach ($split as $value) { + if ($value == 'airtime') { + break; + } else { + $subdomain[] = $value; + } + } + if (count($subdomain) > 0){ + $subDomain = implode('.',$subdomain); + $md = array(); $md["sub_domain"] = $subDomain; $md["pypo_ip"] = $remoteAddr; - + Application_Model_RabbitMq::SendMessageToHaproxyConfigDaemon($md); } } From 858f03c9ad126a11c98da80296c5c350ce08b17b Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Thu, 29 Nov 2012 15:58:29 -0500 Subject: [PATCH 019/113] -remove rebroadcast code --- airtime_mvc/application/forms/AddShowWhen.php | 29 ------------------- 1 file changed, 29 deletions(-) diff --git a/airtime_mvc/application/forms/AddShowWhen.php b/airtime_mvc/application/forms/AddShowWhen.php index 5f8105657..3dbc63b86 100644 --- a/airtime_mvc/application/forms/AddShowWhen.php +++ b/airtime_mvc/application/forms/AddShowWhen.php @@ -250,35 +250,6 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm $valid = false; $this->getElement('add_show_duration')->setErrors(array('Cannot schedule overlapping shows')); } - } elseif ($formData["add_show_rebroadcast"]) { - /* Check first show - * Continue if the first show does not overlap - */ - $overlapping = Application_Model_Schedule::checkOverlappingShows($show_start, $show_end, $update, $instanceId); - - if (!$overlapping) { - $durationToAdd = "PT".$hours."H".$minutes."M"; - for ($i = 1; $i <= 10; $i++) { - - if (empty($formData["add_show_rebroadcast_date_absolute_".$i])) break; - - $abs_rebroadcast_start = $formData["add_show_rebroadcast_date_absolute_".$i]." ". - $formData["add_show_rebroadcast_time_absolute_".$i]; - $rebroadcastShowStart = new DateTime($abs_rebroadcast_start); - $rebroadcastShowStart->setTimezone(new DateTimeZone('UTC')); - $rebroadcastShowEnd = clone $rebroadcastShowStart; - $rebroadcastShowEnd->add(new DateInterval($durationToAdd)); - $overlapping = Application_Model_Schedule::checkOverlappingShows($rebroadcastShowStart, $rebroadcastShowEnd, $update, $instanceId); - if ($overlapping) { - $valid = false; - $this->getElement('add_show_duration')->setErrors(array('Cannot schedule overlapping shows')); - break; - } - } - } else { - $valid = false; - $this->getElement('add_show_duration')->setErrors(array('Cannot schedule overlapping shows')); - } } else { $overlapping = Application_Model_Schedule::checkOverlappingShows($show_start, $show_end, $update, $instanceId); if ($overlapping) { From 3086bde17ebd8ad481abc624f5728f0a7783effa Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Tue, 4 Dec 2012 16:22:03 -0500 Subject: [PATCH 020/113] -cleanup parsing for form elements that weren't provided by the client in our SaaS implementation --- .../controllers/PreferenceController.php | 34 +++++++------------ .../application/forms/SupportSettings.php | 17 ---------- 2 files changed, 12 insertions(+), 39 deletions(-) diff --git a/airtime_mvc/application/controllers/PreferenceController.php b/airtime_mvc/application/controllers/PreferenceController.php index 7ab568144..6450626e5 100644 --- a/airtime_mvc/application/controllers/PreferenceController.php +++ b/airtime_mvc/application/controllers/PreferenceController.php @@ -70,30 +70,20 @@ class PreferenceController extends Zend_Controller_Action if ($request->isPost()) { $values = $request->getPost(); if ($form->isValid($values)) { - if ($values["Publicise"] != 1) { - Application_Model_Preference::SetSupportFeedback($values["SupportFeedback"]); - Application_Model_Preference::SetPublicise($values["Publicise"]); - if (isset($values["Privacy"])) { - Application_Model_Preference::SetPrivacyPolicyCheck($values["Privacy"]); - } - } else { - Application_Model_Preference::SetHeadTitle($values["stationName"], $this->view); - Application_Model_Preference::SetPhone($values["Phone"]); - Application_Model_Preference::SetEmail($values["Email"]); - Application_Model_Preference::SetStationWebSite($values["StationWebSite"]); - Application_Model_Preference::SetSupportFeedback($values["SupportFeedback"]); - Application_Model_Preference::SetPublicise($values["Publicise"]); + Application_Model_Preference::SetHeadTitle($values["stationName"], $this->view); + Application_Model_Preference::SetPhone($values["Phone"]); + Application_Model_Preference::SetEmail($values["Email"]); + Application_Model_Preference::SetStationWebSite($values["StationWebSite"]); - $form->Logo->receive(); - $imagePath = $form->Logo->getFileName(); + $form->Logo->receive(); + $imagePath = $form->Logo->getFileName(); - Application_Model_Preference::SetStationCountry($values["Country"]); - Application_Model_Preference::SetStationCity($values["City"]); - Application_Model_Preference::SetStationDescription($values["Description"]); - Application_Model_Preference::SetStationLogo($imagePath); - if (isset($values["Privacy"])) { - Application_Model_Preference::SetPrivacyPolicyCheck($values["Privacy"]); - } + Application_Model_Preference::SetStationCountry($values["Country"]); + Application_Model_Preference::SetStationCity($values["City"]); + Application_Model_Preference::SetStationDescription($values["Description"]); + Application_Model_Preference::SetStationLogo($imagePath); + if (isset($values["Privacy"])) { + Application_Model_Preference::SetPrivacyPolicyCheck($values["Privacy"]); } $this->view->statusMsg = "
Support setting updated.
"; } diff --git a/airtime_mvc/application/forms/SupportSettings.php b/airtime_mvc/application/forms/SupportSettings.php index aeda6d7ed..827b9013b 100644 --- a/airtime_mvc/application/forms/SupportSettings.php +++ b/airtime_mvc/application/forms/SupportSettings.php @@ -126,20 +126,6 @@ class Application_Form_SupportSettings extends Zend_Form } $this->addElement($checkboxPublicise); - // text area for sending detail - $this->addElement('textarea', 'SendInfo', array( - 'class' => 'sending_textarea', - 'required' => false, - 'filters' => array('StringTrim'), - 'readonly' => true, - 'cols' => 61, - 'rows' => 5, - 'value' => Application_Model_Preference::GetSystemInfo(false, true), - 'decorators' => array( - 'ViewHelper' - ) - )); - // checkbox for privacy policy $checkboxPrivacy = new Zend_Form_Element_Checkbox("Privacy"); $checkboxPrivacy->setLabel("By checking this box, I agree to Sourcefabric's privacy policy.") @@ -159,9 +145,6 @@ class Application_Form_SupportSettings extends Zend_Form public function isValid ($data) { $isValid = parent::isValid($data); - if ($data['Publicise'] != 1) { - $isValid = true; - } if (isset($data["Privacy"])) { $checkPrivacy = $this->getElement('Privacy'); if ($data["SupportFeedback"] == "1" && $data["Privacy"] != "1") { From b1985e2bdff4bb085b2db1478f108c5158fe5a8a Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Tue, 4 Dec 2012 17:42:28 -0500 Subject: [PATCH 021/113] SAAS-290: Hosted SaaS widgets + javascript code generation -fix code box not automatically expanding on page refresh --- airtime_mvc/public/js/airtime/preferences/preferences.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/airtime_mvc/public/js/airtime/preferences/preferences.js b/airtime_mvc/public/js/airtime/preferences/preferences.js index dae344b70..8a4c619c6 100644 --- a/airtime_mvc/public/js/airtime/preferences/preferences.js +++ b/airtime_mvc/public/js/airtime/preferences/preferences.js @@ -82,8 +82,9 @@ function setMsAuthenticationFieldsReadonly(ele) { } function setCollapsibleWidgetJsCode() { - $('#thirdPartyApi-element input').click(function() { - if ($(this).first().attr("value") == '1') { + var x = function() { + var val = $('input:radio[name=thirdPartyApi]:checked').val(); + if (val == "1") { //show js textarea $('#widgetCode-label').show("fast"); $('#widgetCode-element').show("fast"); @@ -92,7 +93,9 @@ function setCollapsibleWidgetJsCode() { $('#widgetCode-label').hide("fast"); $('#widgetCode-element').hide("fast"); } - }); + } + x(); + $('#thirdPartyApi-element input').click(x); } function createWidgetHelpDescription() { From c57e19983c1cbfa37eaac5c6aa5af1e998c0978e Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Tue, 15 Jan 2013 14:06:02 -0500 Subject: [PATCH 022/113] -fix merge mistakes from devel --- .../application/views/scripts/form/preferences_general.phtml | 5 +++++ airtime_mvc/public/js/airtime/preferences/preferences.js | 1 + 2 files changed, 6 insertions(+) diff --git a/airtime_mvc/application/views/scripts/form/preferences_general.phtml b/airtime_mvc/application/views/scripts/form/preferences_general.phtml index 96d7fb607..3a75aed95 100644 --- a/airtime_mvc/application/views/scripts/form/preferences_general.phtml +++ b/airtime_mvc/application/views/scripts/form/preferences_general.phtml @@ -64,6 +64,11 @@ element->getElement('widgetCode')->hasErrors()) : ?>
    element->getElement('widgetCode')->getMessages() as $error): ?> +
  • + +
+ +
diff --git a/airtime_mvc/public/js/airtime/preferences/preferences.js b/airtime_mvc/public/js/airtime/preferences/preferences.js index 595881ca8..0c50762b0 100644 --- a/airtime_mvc/public/js/airtime/preferences/preferences.js +++ b/airtime_mvc/public/js/airtime/preferences/preferences.js @@ -121,6 +121,7 @@ function createWidgetHelpDescription() { at: "right center" }, }); +} function setSoundCloudCheckBoxListener() { var subCheckBox= $("#UseSoundCloud,#SoundCloudDownloadbleOption"); From e46ba0eb776ecbce3e9cff9fe5224d22462d5f60 Mon Sep 17 00:00:00 2001 From: denise Date: Tue, 15 Jan 2013 15:46:07 -0500 Subject: [PATCH 023/113] Changed version number in UpgradeCommon.php --- .../upgrades/airtime-2.3.0/common/UpgradeCommon.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install_minimal/upgrades/airtime-2.3.0/common/UpgradeCommon.php b/install_minimal/upgrades/airtime-2.3.0/common/UpgradeCommon.php index 496a576a2..ee7c9fe09 100644 --- a/install_minimal/upgrades/airtime-2.3.0/common/UpgradeCommon.php +++ b/install_minimal/upgrades/airtime-2.3.0/common/UpgradeCommon.php @@ -11,8 +11,8 @@ class UpgradeCommon{ const CONF_PYPO_GRP = "pypo"; const CONF_WWW_DATA_GRP = "www-data"; - const CONF_BACKUP_SUFFIX = "220"; - const VERSION_NUMBER = "2.2.0"; + const CONF_BACKUP_SUFFIX = "230"; + const VERSION_NUMBER = "2.3.0"; public static function SetDefaultTimezone() { From 6fe4840e3277b34c4dcb9c6e08f408e3148b6314 Mon Sep 17 00:00:00 2001 From: denise Date: Tue, 15 Jan 2013 16:22:17 -0500 Subject: [PATCH 024/113] CC-4797: Generate localization locales on install -check if locale exists before writing it to /etc/locale.gen on Debian --- install_minimal/include/airtime-initialize.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/install_minimal/include/airtime-initialize.sh b/install_minimal/include/airtime-initialize.sh index d07320c80..623daa9de 100755 --- a/install_minimal/include/airtime-initialize.sh +++ b/install_minimal/include/airtime-initialize.sh @@ -11,7 +11,10 @@ dist=`lsb_release -is` echo "Generating locales" for i in `ls /usr/share/airtime/locale | grep ".._.."`; do if [ "$dist" = "Debian" ]; then - echo "$i.UTF-8 UTF-8" >> /etc/locale.gen + grep -q "$i" /etc/locale.gen + if [ $? -ne 0 ]; then + echo "$i.UTF-8 UTF-8" >> /etc/locale.gen + fi else locale-gen "$i.utf8" fi From 4d3f5e1ba4a9233531e327423fb4a0e251d2be9b Mon Sep 17 00:00:00 2001 From: denise Date: Tue, 15 Jan 2013 16:27:50 -0500 Subject: [PATCH 025/113] Reverting last commit --- install_minimal/include/airtime-initialize.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/install_minimal/include/airtime-initialize.sh b/install_minimal/include/airtime-initialize.sh index 623daa9de..d07320c80 100755 --- a/install_minimal/include/airtime-initialize.sh +++ b/install_minimal/include/airtime-initialize.sh @@ -11,10 +11,7 @@ dist=`lsb_release -is` echo "Generating locales" for i in `ls /usr/share/airtime/locale | grep ".._.."`; do if [ "$dist" = "Debian" ]; then - grep -q "$i" /etc/locale.gen - if [ $? -ne 0 ]; then - echo "$i.UTF-8 UTF-8" >> /etc/locale.gen - fi + echo "$i.UTF-8 UTF-8" >> /etc/locale.gen else locale-gen "$i.utf8" fi From 712df8b12d5efb0d3e15499f073a80e404f5a19b Mon Sep 17 00:00:00 2001 From: denise Date: Wed, 16 Jan 2013 11:10:23 -0500 Subject: [PATCH 026/113] Removed extra style element --- .../application/views/scripts/form/preferences_general.phtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airtime_mvc/application/views/scripts/form/preferences_general.phtml b/airtime_mvc/application/views/scripts/form/preferences_general.phtml index 3a75aed95..880ba1d54 100644 --- a/airtime_mvc/application/views/scripts/form/preferences_general.phtml +++ b/airtime_mvc/application/views/scripts/form/preferences_general.phtml @@ -27,7 +27,7 @@ -
+
From bd3d12bd263a81568e5a78a0a3624c9e56c5b962 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Wed, 16 Jan 2013 12:34:20 -0500 Subject: [PATCH 027/113] CC-4849: 2.3.x-saas: Empty page for Support feedback -fixed --- .../application/views/scripts/form/support-setting.phtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airtime_mvc/application/views/scripts/form/support-setting.phtml b/airtime_mvc/application/views/scripts/form/support-setting.phtml index aeadecfa1..6ec97da13 100644 --- a/airtime_mvc/application/views/scripts/form/support-setting.phtml +++ b/airtime_mvc/application/views/scripts/form/support-setting.phtml @@ -1,5 +1,5 @@
-
;"> +
;">