Merge branch 'saas' into saas-speedy
This commit is contained in:
commit
2b8e40a12c
18 changed files with 190 additions and 196 deletions
|
@ -150,44 +150,6 @@ class Application_Model_RabbitMq
|
|||
|
||||
|
||||
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();
|
||||
//XXX: This function has been deprecated and is no longer needed
|
||||
}
|
||||
}
|
||||
|
|
|
@ -93,6 +93,7 @@ class Application_Model_Webstream implements Application_Model_LibraryEditable
|
|||
$isAdminOrPM = $user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER));
|
||||
|
||||
if (!$isAdminOrPM) {
|
||||
//Make sure the user has ownership of ALL the selected webstreams before
|
||||
$leftOver = self::streamsNotOwnedByUser($p_ids, $p_userId);
|
||||
if (count($leftOver) == 0) {
|
||||
CcWebstreamQuery::create()->findPKs($p_ids)->delete();
|
||||
|
@ -280,13 +281,22 @@ class Application_Model_Webstream implements Application_Model_LibraryEditable
|
|||
private static function getPlsUrl($url)
|
||||
{
|
||||
$content = self::getUrlData($url);
|
||||
$ini = parse_ini_string($content, true);
|
||||
|
||||
if ($ini !== false && isset($ini["playlist"]) && isset($ini["playlist"]["File1"])) {
|
||||
return $ini["playlist"]["File1"];
|
||||
$matches = array();
|
||||
$numStreams = 0; //Number of streams explicitly listed in the PLS.
|
||||
|
||||
if (preg_match("/NumberOfEntries=([0-9]*)/", $content, $matches) !== FALSE) {
|
||||
$numStreams = $matches[1];
|
||||
}
|
||||
|
||||
throw new Exception(_("Could not parse PLS playlist"));
|
||||
//Find all the stream URLs in the playlist
|
||||
if (preg_match_all("/File[0-9]*=(.*)/", $content, $matches) !== FALSE) {
|
||||
//This array contains all the streams! If we need fallback stream URLs in the future,
|
||||
//they're already in this array...
|
||||
return $matches[1][0];
|
||||
} else {
|
||||
throw new Exception(_("Could not parse PLS playlist"));
|
||||
}
|
||||
}
|
||||
|
||||
private static function getM3uUrl($url)
|
||||
|
|
|
@ -256,6 +256,7 @@ class Application_Service_ShowService
|
|||
}
|
||||
|
||||
$this->adjustSchedule($showData);
|
||||
|
||||
}
|
||||
|
||||
$con->commit();
|
||||
|
|
|
@ -3,12 +3,11 @@
|
|||
font-size: 200px !important;
|
||||
}
|
||||
</style>
|
||||
<?php $upgradeLink = Application_Common_OsPath::getBaseDir() . "billing/upgrade"; ?>
|
||||
<?php if ($this->quotaLimitReached) { ?>
|
||||
<div class="errors quota-reached">
|
||||
Disk quota exceeded. You cannot upload files until you
|
||||
<a target="_parent" href=<?php $baseUrl = Application_Common_OsPath::getBaseDir(); echo $baseUrl . "billing/upgrade"?>>
|
||||
upgrade your storage
|
||||
</a>.
|
||||
<?php printf(_pro("Disk quota exceeded. You cannot upload files until you %s upgrade your storage"),
|
||||
"<a target=\"_parent\" href=$upgradeLink>");?></a>.
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
|
|
@ -13,7 +13,16 @@
|
|||
</div>
|
||||
<h3 class="collapsible-header"><span class="arrow-icon"></span><?php echo _("When") ?></h3>
|
||||
<div id="schedule-show-when" class="collapsible-content">
|
||||
<?php
|
||||
if (!$this->addNewShow) {
|
||||
$this->when->getElement('add_show_timezone')->setOptions(array('disabled' => true));
|
||||
?>
|
||||
<input type="hidden" name="add_show_timezone" id="add_show_timezone" value=<?php echo $this->when->getElement('add_show_timezone')->getValue()?>>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php echo $this->when; ?>
|
||||
|
||||
<?php echo $this->repeats; ?>
|
||||
</div>
|
||||
<h3 class="collapsible-header"><span class="arrow-icon"></span><?php echo _("Live Stream Input") ?></h3>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue