Merge branch 'saas' into cc-5709-airtime-analyzer-cloud-storage-saas

This commit is contained in:
drigato 2015-01-13 14:23:51 -05:00
commit d99147bad4
10 changed files with 60 additions and 35 deletions

View File

@ -164,8 +164,12 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
&& strpos($_SERVER['REQUEST_URI'], $baseUrl.'audiopreview/playlist-preview') === false && strpos($_SERVER['REQUEST_URI'], $baseUrl.'audiopreview/playlist-preview') === false
&& strpos($_SERVER['REQUEST_URI'], $baseUrl.'audiopreview/block-preview') === false) { && strpos($_SERVER['REQUEST_URI'], $baseUrl.'audiopreview/block-preview') === false) {
if (Application_Model_Preference::GetLiveChatEnabled()) { if (Application_Model_Preference::GetLiveChatEnabled()) {
$client_id = Application_Model_Preference::GetClientId(); $client_id = strval(Application_Model_Preference::GetClientId());
$view->headScript()->appendScript("var livechat_client_id = '$client_id';"); $plan_level = strval(Application_Model_Preference::GetPlanLevel());
$station_url = $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
$view->headScript()->appendScript("var livechat_client_id = '$client_id';\n".
"var livechat_plan_type = '$plan_level';\n".
"var livechat_station_url = 'http://$station_url';");
$view->headScript()->appendFile($baseUrl . 'js/airtime/common/livechat.js?'.$CC_CONFIG['airtime_version'], 'text/javascript'); $view->headScript()->appendFile($baseUrl . 'js/airtime/common/livechat.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
} }
} }

View File

@ -114,6 +114,11 @@ $pages = array(
'uri' => '#', 'uri' => '#',
'resource' => 'dashboard', 'resource' => 'dashboard',
'pages' => array( 'pages' => array(
array(
'label' => _('Help Center'),
'uri' => "http://help.sourcefabric.org/",
'target' => "_blank"
),
array( array(
'label' => _('Getting Started'), 'label' => _('Getting Started'),
'module' => 'default', 'module' => 'default',

View File

@ -572,6 +572,7 @@ class BillingController extends Zend_Controller_Action {
try { try {
$ch = curl_init(); $ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 ); // WHMCS IP whitelist doesn't support IPv6
curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 5); //Aggressive 5 second timeout curl_setopt($ch, CURLOPT_TIMEOUT, 5); //Aggressive 5 second timeout
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
@ -598,4 +599,4 @@ class BillingController extends Zend_Controller_Action {
throw new Exception("Invalid client ID: " . Application_Model_Preference::GetClientId()); throw new Exception("Invalid client ID: " . Application_Model_Preference::GetClientId());
} }
} }
} }

View File

@ -439,6 +439,7 @@ class ShowbuilderController extends Zend_Controller_Action
$ch = curl_init(); $ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 ); // WHMCS IP whitelist doesn't support IPv6
curl_setopt($ch, CURLOPT_TIMEOUT, 5); //Aggressive 5 second timeout curl_setopt($ch, CURLOPT_TIMEOUT, 5); //Aggressive 5 second timeout
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $query_string); curl_setopt($ch, CURLOPT_POSTFIELDS, $query_string);

View File

@ -155,6 +155,7 @@ class WHMCS_Auth_Adapter implements Zend_Auth_Adapter_Interface {
$ch = curl_init(); $ch = curl_init();
curl_setopt($ch, CURLOPT_URL, WHMCS_API_URL); curl_setopt($ch, CURLOPT_URL, WHMCS_API_URL);
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 ); // WHMCS IP whitelist doesn't support IPv6
curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 30); curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_FAILONERROR, 1); curl_setopt($ch, CURLOPT_FAILONERROR, 1);
@ -164,7 +165,8 @@ class WHMCS_Auth_Adapter implements Zend_Auth_Adapter_Interface {
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$jsondata = curl_exec($ch); $jsondata = curl_exec($ch);
if (curl_error($ch)) { if (curl_error($ch)) {
die(curl_getinfo($ch, CURLINFO_EFFECTIVE_URL)); Logging::error("Failed to reach WHMCS server in " . __FUNCTION__ . ": "
. curl_errno($ch) . ' - ' . curl_error($ch) . ' - ' . curl_getinfo($ch, CURLINFO_EFFECTIVE_URL));
//die("Connection Error: ".curl_errno($ch).' - '.curl_error($ch)); //die("Connection Error: ".curl_errno($ch).' - '.curl_error($ch));
} }
curl_close($ch); curl_close($ch);
@ -201,6 +203,7 @@ class WHMCS_Auth_Adapter implements Zend_Auth_Adapter_Interface {
$ch = curl_init(); $ch = curl_init();
curl_setopt($ch, CURLOPT_URL, WHMCS_API_URL); curl_setopt($ch, CURLOPT_URL, WHMCS_API_URL);
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 ); // WHMCS IP whitelist doesn't support IPv6
curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 30); curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_FAILONERROR, 1); curl_setopt($ch, CURLOPT_FAILONERROR, 1);
@ -210,7 +213,8 @@ class WHMCS_Auth_Adapter implements Zend_Auth_Adapter_Interface {
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$jsondata = curl_exec($ch); $jsondata = curl_exec($ch);
if (curl_error($ch)) { if (curl_error($ch)) {
die(curl_getinfo($ch, CURLINFO_EFFECTIVE_URL)); Logging::error("Failed to reach WHMCS server in " . __FUNCTION__ . ": "
. curl_errno($ch) . ' - ' . curl_error($ch) . ' - ' . curl_getinfo($ch, CURLINFO_EFFECTIVE_URL));
//die("Connection Error: ".curl_errno($ch).' - '.curl_error($ch)); //die("Connection Error: ".curl_errno($ch).' - '.curl_error($ch));
} }
curl_close($ch); curl_close($ch);
@ -255,4 +259,4 @@ class WHMCS_Auth_Adapter implements Zend_Auth_Adapter_Interface {
} }
return false; return false;
} }
} }

View File

@ -94,7 +94,7 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm
// //
// Add the description element // Add the description element
$this->addElement('textarea', 'widgetCode', array( $this->addElement('textarea', 'widgetCode', array(
'label' => 'Javascript Code:', 'label' => _('HTML Code:'),
'required' => false, 'required' => false,
'readonly' => true, 'readonly' => true,
'style' => 'font-family: Consolas, "Liberation Mono", Courier, 'style' => 'font-family: Consolas, "Liberation Mono", Courier,
@ -134,10 +134,14 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm
$host = $_SERVER['SERVER_NAME']; $host = $_SERVER['SERVER_NAME'];
$code = <<<CODE $code = <<<CODE
<script src="http://$host/widgets/js/jquery-1.6.1.min.js" type="text/javascript"></script> <!-- READ THESE INSTRUCTIONS CAREFULLY:
<script src="http://$host/widgets/js/jquery-ui-1.8.10.custom.min.js" type="text/javascript"></script> Step 1 of 2: Paste these next 4 lines in the <head> section of your HTML page -->
<script src="http://$host/widgets/js/jquery.showinfo.js" type="text/javascript"></script> <script src="https://$host/widgets/js/jquery-1.6.1.min.js" type="text/javascript"></script>
<script src="https://$host/widgets/js/jquery-ui-1.8.10.custom.min.js" type="text/javascript"></script>
<script src="https://$host/widgets/js/jquery.showinfo.js" type="text/javascript"></script>
<link rel="stylesheet" href="https://$host/widgets/css/airtime-widgets.css"></link>
<!-- Step 2 of 2: Paste these remaining lines in the <body> section of your HTML page -->
<div id="headerLiveHolder" style="border: 1px solid #999999; padding: 10px;"></div> <div id="headerLiveHolder" style="border: 1px solid #999999; padding: 10px;"></div>
<div id="onAirToday"></div> <div id="onAirToday"></div>
<div id="scheduleTabs"></div> <div id="scheduleTabs"></div>
@ -159,6 +163,8 @@ $(document).ready(function() {
sourceDomain:"http://$host", sourceDomain:"http://$host",
updatePeriod: 600 //seconds updatePeriod: 600 //seconds
}); });
var d = new Date().getDay();
$('#scheduleTabs').tabs({selected: d === 0 ? 6 : d-1, fx: { opacity: 'toggle' }});
}); });
</script> </script>
CODE; CODE;

View File

@ -309,7 +309,7 @@ class Application_Model_Webstream implements Application_Model_LibraryEditable
$media_url = self::getXspfUrl($url); $media_url = self::getXspfUrl($url);
} elseif (preg_match("/pls\+xml/", $mime) || preg_match("/x-scpls/", $mime)) { } elseif (preg_match("/pls\+xml/", $mime) || preg_match("/x-scpls/", $mime)) {
$media_url = self::getPlsUrl($url); $media_url = self::getPlsUrl($url);
} elseif (preg_match("/(mpeg|ogg|audio\/aacp)/", $mime)) { } elseif (preg_match("/(mpeg|ogg|audio\/aacp|audio\/aac)/", $mime)) {
if ($content_length_found) { if ($content_length_found) {
throw new Exception(_("Invalid webstream - This appears to be a file download.")); throw new Exception(_("Invalid webstream - This appears to be a file download."));
} }

View File

@ -5,7 +5,9 @@ function setupLiveChat() {
// this is where we pass custom variables to livechat; // this is where we pass custom variables to livechat;
// only pass the client id assigned by WHMCS for now // only pass the client id assigned by WHMCS for now
__lc.params = [ __lc.params = [
{ name: 'client_id', value: livechat_client_id } { name: 'client_id', value: livechat_client_id },
{ name: 'plan_type', value: livechat_plan_type},
{ name: 'station_url', value: livechat_station_url}
]; ];
var lc = document.createElement('script'); lc.type = 'text/javascript'; lc.async = true; var lc = document.createElement('script'); lc.type = 'text/javascript'; lc.async = true;
@ -15,4 +17,4 @@ function setupLiveChat() {
$(document).ready(function() { $(document).ready(function() {
setupLiveChat(); setupLiveChat();
}); });

View File

@ -1,24 +1,24 @@
if bitrate == 24 then if bitrate == 24 then
ignore(output_stereo(%fdkaac(bitrate = 24, aot="mpeg4_he_aac_v2"), !source)) ignore(output_stereo(%fdkaac(bitrate = 24, aot="mpeg4_he_aac_v2", afterburner=false, sbr_mode=true), !source))
elsif bitrate == 32 then elsif bitrate == 32 then
ignore(output_stereo(%fdkaac(bitrate = 32, aot="mpeg4_he_aac_v2"), !source)) ignore(output_stereo(%fdkaac(bitrate = 32, aot="mpeg4_he_aac_v2", afterburner=false, sbr_mode=true), !source))
elsif bitrate == 48 then elsif bitrate == 48 then
ignore(output_stereo(%fdkaac(bitrate = 48, aot="mpeg4_he_aac_v2"), !source)) ignore(output_stereo(%fdkaac(bitrate = 48, aot="mpeg4_he_aac_v2", afterburner=false, sbr_mode=true), !source))
elsif bitrate == 64 then elsif bitrate == 64 then
ignore(output_stereo(%fdkaac(bitrate = 64, aot="mpeg4_he_aac_v2"), !source)) ignore(output_stereo(%fdkaac(bitrate = 64, aot="mpeg4_he_aac_v2", afterburner=false, sbr_mode=true), !source))
elsif bitrate == 96 then elsif bitrate == 96 then
ignore(output_stereo(%fdkaac(bitrate = 96, aot="mpeg4_he_aac_v2"), !source)) ignore(output_stereo(%fdkaac(bitrate = 96, aot="mpeg4_he_aac_v2", afterburner=false, sbr_mode=true), !source))
elsif bitrate == 128 then elsif bitrate == 128 then
ignore(output_stereo(%fdkaac(bitrate = 128, aot="mpeg4_he_aac_v2"), !source)) ignore(output_stereo(%fdkaac(bitrate = 128, aot="mpeg4_he_aac_v2", afterburner=false, sbr_mode=true), !source))
elsif bitrate == 160 then elsif bitrate == 160 then
ignore(output_stereo(%fdkaac(bitrate = 160, aot="mpeg4_he_aac_v2"), !source)) ignore(output_stereo(%fdkaac(bitrate = 160, aot="mpeg4_he_aac_v2", afterburner=true, sbr_mode=true), !source))
elsif bitrate == 192 then elsif bitrate == 192 then
ignore(output_stereo(%fdkaac(bitrate = 192, aot="mpeg4_he_aac_v2"), !source)) ignore(output_stereo(%fdkaac(bitrate = 192, aot="mpeg4_he_aac_v2", afterburner=true, sbr_mode=true), !source))
elsif bitrate == 224 then elsif bitrate == 224 then
ignore(output_stereo(%fdkaac(bitrate = 224, aot="mpeg4_he_aac_v2"), !source)) ignore(output_stereo(%fdkaac(bitrate = 224, aot="mpeg4_he_aac_v2", afterburner=true, sbr_mode=true), !source))
elsif bitrate == 256 then elsif bitrate == 256 then
ignore(output_stereo(%fdkaac(bitrate = 256, aot="mpeg4_he_aac_v2"), !source)) ignore(output_stereo(%fdkaac(bitrate = 256, aot="mpeg4_he_aac_v2", afterburner=true, sbr_mode=true), !source))
elsif bitrate == 320 then elsif bitrate == 320 then
ignore(output_stereo(%fdkaac(bitrate = 320, aot="mpeg4_he_aac_v2"), !source)) ignore(output_stereo(%fdkaac(bitrate = 320, aot="mpeg4_he_aac_v2", afterburner=true, sbr_mode=true), !source))
end end

View File

@ -150,20 +150,22 @@ def output_to(output_type, type, bitrate, host, port, pass, mount_point, url, de
end end
%endif %endif
%ifencoder %aac # FDK-AAC is the only good AAC encoder. libvoaac is deprecated and aacplus is subpar.
if type == "aac" then # The difference in compression quality is clearly audible. -- Albert
%include "aac.liq" # %ifencoder %aac
end # if type == "aac" then
%endif # %include "aac.liq"
# end
# %endif
%ifencoder %aacplus # %ifencoder %aacplus
if type == "aacplus" then # if type == "aacplus" then
%include "aacplus.liq" # %include "aacplus.liq"
end # end
%endif # %endif
%ifencoder %fdkaac %ifencoder %fdkaac
if type == "fdkaac" then if type == "aac" then
%include "fdkaac.liq" %include "fdkaac.liq"
end end
%endif %endif