Skip to content

Commit

Permalink
Merge pull request #25 from xibosignage/develop
Browse files Browse the repository at this point in the history
Release Hotfixes
  • Loading branch information
dasgarner committed Feb 9, 2015
2 parents e235044 + 781bd8d commit 0c7aec9
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 16 deletions.
3 changes: 3 additions & 0 deletions install/database/84.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ VALUES (
'CALENDAR_TYPE', 'Gregorian', 'dropdown', 'Which Calendar Type should the CMS use?', 'Gregorian|Jalali', 'regional', 1, 'Calendar Type', '', '50', 'Gregorian', '1', 'string'
);

INSERT INTO `module` (`ModuleID`, `Module`, `Name`, `Enabled`, `RegionSpecific`, `Description`, `ImageUri`, `SchemaVersion`, `ValidExtensions`, `PreviewEnabled`, `assignable`, `render_as`) VALUES
(NULL, 'clock', 'Clock', '1', '1', 'Display a Clock', 'forms/library.gif', '1', '', '1', '1', 'html');

INSERT INTO `displayprofile` (`name`, `type`, `config`, `isdefault`, `userid`)
VALUES ('Windows', 'windows', '[]', '1', '1'), ('Android', 'android', '[]', '1', '1');

Expand Down
3 changes: 0 additions & 3 deletions install/database/85.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
INSERT INTO `module` (`ModuleID`, `Module`, `Name`, `Enabled`, `RegionSpecific`, `Description`, `ImageUri`, `SchemaVersion`, `ValidExtensions`, `PreviewEnabled`, `assignable`, `render_as`) VALUES
(NULL, 'clock', 'Clock', '1', '1', 'Display a Clock', 'forms/library.gif', '1', '', '1', '1', 'html');

ALTER TABLE `display` ADD `storageAvailableSpace` INT NULL ,
ADD `storageTotalSpace` INT NULL;

Expand Down
2 changes: 1 addition & 1 deletion lib/data/dataset.data.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ public function DataSetResults($dataSetId, $columnIds, $filter = '', $ordering =
$order .= ' :order' . $i . ' DESC,';
}
else {
$order .= ' :order,' . $i;
$order .= ' :order' . $i . ',';
}

$params['order' . $i] = $orderPair;
Expand Down
16 changes: 6 additions & 10 deletions lib/data/region.data.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1027,12 +1027,6 @@ public function AddFromLibrary($user, $layoutId, $regionId, $mediaList) {

$mediaId = Kit::ValidateParam($mediaId, _INT);

// Check we have permissions to use this media (we will use this to copy the media later)
$mediaAuth = $user->MediaAuth($mediaId, true);

if (!$mediaAuth->view)
return $this->SetError(__('You have selected media that you no longer have permission to use. Please reload Library form.'));

// Get the type from this media
$sth = $dbh->prepare('SELECT type FROM media WHERE mediaID = :mediaid');
$sth->execute(array(
Expand All @@ -1046,11 +1040,15 @@ public function AddFromLibrary($user, $layoutId, $regionId, $mediaList) {

try {
// Create the media object without any region and layout information
$module = ModuleFactory::createForMedia($mod, $mediaId);
$module = ModuleFactory::createForMedia($mod, $mediaId, null, $user);
}
catch (Exception $e) {
return $this->SetError($e->getMessage());
}

// Check we have permissions to use this media (we will use this to copy the media later)
if (!$module->auth->view)
return $this->SetError(__('You have selected media that you no longer have permission to use. Please reload Library form.'));

if (!$module->SetRegionInformation($layoutId, $regionId))
return $this->SetError($module->GetErrorMessage());
Expand All @@ -1059,13 +1057,11 @@ public function AddFromLibrary($user, $layoutId, $regionId, $mediaList) {
return $this->SetError($module->GetErrorMessage());

// Need to copy over the permissions from this media item & also the delete permission
Kit::ClassLoader('layoutmediagroupsecurity');
$security = new LayoutMediaGroupSecurity($this->db);
$security->Link($layoutId, $regionId, $mediaId, $user->getGroupFromID($user->userid, true), $mediaAuth->view, $mediaAuth->edit, 1);
$security->Link($layoutId, $regionId, $mediaId, $user->getGroupFromID($user->userid, true), $module->auth->view, $module->auth->edit, 1);
}

// Update layout status
Kit::ClassLoader('Layout');
$layout = new Layout($this->db);
$layout->SetValid($layoutId, true);

Expand Down
2 changes: 0 additions & 2 deletions lib/modules/module.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,6 @@ final private function SetMediaInformation($layoutid, $regionid, $mediaid, $lkid
$this->assignedMedia = false;

try {
$dbh = PDOConnect::init();

// Load what we know about this media into the object
// this is unauthenticated at this point
$rows = Media::Entries(NULL, array('mediaId' => $mediaid, 'allModules' => 1));
Expand Down

0 comments on commit 0c7aec9

Please sign in to comment.