Merge branch '2.3.x' into 2.3.x-saas
Conflicts: airtime_mvc/application/models/User.php
This commit is contained in:
commit
0a198ae424
20 changed files with 184 additions and 51 deletions
|
@ -385,6 +385,15 @@ class LibraryController extends Zend_Controller_Action
|
|||
//TODO move this to the datatables row callback.
|
||||
foreach ($r["aaData"] as &$data) {
|
||||
|
||||
foreach ($data as $k => &$v) {
|
||||
if ($k != "image" && $k != "checkbox") {
|
||||
$v = htmlspecialchars($v);
|
||||
}
|
||||
}
|
||||
//TODO: Replace the above foreach loop with the line below when ticket
|
||||
//CC-4896 is completed.
|
||||
//$data = array_map('htmlspecialchars', $data);
|
||||
|
||||
if ($data['ftype'] == 'audioclip') {
|
||||
$file = Application_Model_StoredFile::Recall($data['id']);
|
||||
$scid = $file->getSoundCloudId();
|
||||
|
@ -429,7 +438,7 @@ class LibraryController extends Zend_Controller_Action
|
|||
$formValues = $this->_getParam('data', null);
|
||||
$formdata = array();
|
||||
foreach ($formValues as $val) {
|
||||
$formdata[$val["name"]] = $val["value"];
|
||||
$formdata[$val["name"]] = htmlspecialchars($val["value"]);
|
||||
}
|
||||
$file->setDbColMetadata($formdata);
|
||||
|
||||
|
|
|
@ -238,7 +238,8 @@ class PreferenceController extends Zend_Controller_Action
|
|||
Application_Model_Preference::SetEnableReplayGain($values["enableReplayGain"]);
|
||||
Application_Model_Preference::setReplayGainModifier($values["replayGainModifier"]);
|
||||
$md = array('schedule' => Application_Model_Schedule::getSchedule());
|
||||
Application_Model_RabbitMq::PushSchedule();
|
||||
Application_Model_RabbitMq::SendMessageToPypo("update_schedule", $md);
|
||||
//Application_Model_RabbitMq::PushSchedule();
|
||||
}
|
||||
|
||||
Application_Model_StreamSetting::setOffAirMeta($values['offAirMeta']);
|
||||
|
|
|
@ -115,7 +115,7 @@ class UserController extends Zend_Controller_Action
|
|||
$post = $this->getRequest()->getPost();
|
||||
$users = Application_Model_User::getUsersDataTablesInfo($post);
|
||||
|
||||
die(json_encode($users));
|
||||
$this->_helper->json->sendJson($users);
|
||||
}
|
||||
|
||||
public function getUserDataAction()
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
<div class="personal-block solo">
|
||||
<ul>
|
||||
<li>
|
||||
<a id="current-user" href=<?php echo $baseUrl . "User/edit-user"?>><span class="name"><?php echo $this->loggedInAs()?></span></a> | <a href=<?php echo $baseUrl . "Login/logout"?>><?php echo _("Logout")?></a>
|
||||
<a id="current-user" href=<?php echo $baseUrl . "User/edit-user"?>><span class="name"><?php echo $this->escape($this->loggedInAs()); ?></span></a> | <a href=<?php echo $baseUrl . "Login/logout"?>><?php echo _("Logout")?></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -32,6 +32,8 @@ class Logging {
|
|||
{
|
||||
if (is_array($p_msg) || is_object($p_msg)) {
|
||||
return print_r($p_msg, true);
|
||||
} else if (is_bool($p_msg)) {
|
||||
return $p_msg ? "true" : "false";
|
||||
} else {
|
||||
return $p_msg;
|
||||
}
|
||||
|
|
|
@ -696,6 +696,10 @@ SQL;
|
|||
'replay_gain' => $replay_gain,
|
||||
'independent_event' => $independent_event,
|
||||
);
|
||||
|
||||
if ($schedule_item['cue_in'] > $schedule_item['cue_out']) {
|
||||
$schedule_item['cue_in'] = $schedule_item['cue_out'];
|
||||
}
|
||||
self::appendScheduleItem($data, $start, $schedule_item);
|
||||
}
|
||||
|
||||
|
@ -906,7 +910,6 @@ SQL;
|
|||
self::createScheduledEvents($data, $range_start, $range_end);
|
||||
|
||||
self::foldData($data["media"]);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
|
|
@ -136,13 +136,17 @@ class Application_Model_Scheduler
|
|||
|
||||
if ($type === "audioclip") {
|
||||
$file = CcFilesQuery::create()->findPK($id, $this->con);
|
||||
$storedFile = new Application_Model_StoredFile($file->getDbId());
|
||||
|
||||
if (is_null($file) || !$file->visible()) {
|
||||
throw new Exception(_("A selected File does not exist!"));
|
||||
} else {
|
||||
$data = $this->fileInfo;
|
||||
$data["id"] = $id;
|
||||
$data["cliplength"] = $file->getDbLength();
|
||||
$data["cliplength"] = $storedFile->getRealClipLength(
|
||||
$file->getDbCuein(),
|
||||
$file->getDbCueout());
|
||||
|
||||
$data["cuein"] = $file->getDbCuein();
|
||||
$data["cueout"] = $file->getDbCueout();
|
||||
|
||||
|
@ -438,7 +442,6 @@ class Application_Model_Scheduler
|
|||
}
|
||||
|
||||
foreach ($schedFiles as $file) {
|
||||
|
||||
$endTimeDT = $this->findEndTime($nextStartDT, $file['cliplength']);
|
||||
|
||||
//item existed previously and is being moved.
|
||||
|
|
|
@ -227,7 +227,7 @@ class Application_Model_ShowBuilder
|
|||
$row["endDate"] = $showEndDT->format("Y-m-d");
|
||||
$row["endTime"] = $showEndDT->format("H:i");
|
||||
$row["duration"] = floatval($showEndDT->format("U.u")) - floatval($showStartDT->format("U.u"));
|
||||
$row["title"] = $p_item["show_name"];
|
||||
$row["title"] = htmlspecialchars($p_item["show_name"]);
|
||||
$row["instance"] = intval($p_item["si_id"]);
|
||||
$row["image"] = '';
|
||||
|
||||
|
|
|
@ -1285,6 +1285,14 @@ SQL;
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function getRealClipLength($p_cuein, $p_cueout) {
|
||||
$sql = "SELECT :cueout::INTERVAL - :cuein::INTERVAL";
|
||||
|
||||
return Application_Common_Database::prepareAndExecute($sql, array(
|
||||
':cueout' => $p_cueout,
|
||||
':cuein' => $p_cuein), 'column');
|
||||
}
|
||||
}
|
||||
|
||||
class DeleteScheduledFileException extends Exception {}
|
||||
|
|
|
@ -343,6 +343,8 @@ class Application_Model_User
|
|||
$res['iTotalDisplayRecords']--;
|
||||
$res['iTotalRecords']--;
|
||||
}
|
||||
|
||||
$record = array_map('htmlspecialchars', $record);
|
||||
}
|
||||
|
||||
$res['aaData'] = array_values($res['aaData']);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<h2><? echo sprintf(_("%s's Settings"), $this->currentUser) ?></h2>
|
||||
<h2><? echo sprintf(_("%s's Settings"), $this->escape($this->currentUser)) ?></h2>
|
||||
<div id="current-user-container">
|
||||
<form id="current-user-form" class="edit-user-global" method="post" enctype="application/x-www-form-urlencoded">
|
||||
<dl class="zend_form">
|
||||
|
@ -160,4 +160,4 @@
|
|||
<button type="submit" id="cu_save_user" class="btn btn-small right-floated"><?php echo _("Save")?></button>
|
||||
</dl>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<?php if($this->element->getElement('storageFolder')->hasErrors()) : ?>
|
||||
<ul class='errors'>
|
||||
<?php foreach($this->element->getElement('storageFolder')->getMessages() as $error): ?>
|
||||
<li><?php echo $error; ?></li>
|
||||
<li><?php echo $this->escape($error); ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
|
@ -29,7 +29,7 @@
|
|||
<?php if($this->element->getElement('watchedFolder')->hasErrors()) : ?>
|
||||
<ul class='errors'>
|
||||
<?php foreach($this->element->getElement('watchedFolder')->getMessages() as $error): ?>
|
||||
<li><?php echo $error; ?></li>
|
||||
<li><?php echo $this->escape($error); ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
|
|
|
@ -39,7 +39,7 @@ if (isset($this->obj)) {
|
|||
<input id='obj_type' type='hidden' value='playlist'></input>
|
||||
<div class="playlist_title">
|
||||
<h3 id="obj_name">
|
||||
<a id="playlist_name_display" contenteditable="true"><?php echo $this->obj->getName(); ?></a>
|
||||
<a id="playlist_name_display" contenteditable="true"><?php echo $this->escape($this->obj->getName()); ?></a>
|
||||
</h3>
|
||||
<h4 id="obj_length"><?php echo $this->length; ?></h4>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue