3
* Xibo - Digital Signage - http://www.xibo.org.uk
4
* Copyright (C) 2009-13 Daniel Garner
6
* This file is part of Xibo.
8
* Xibo is free software: you can redistribute it and/or modify
9
* it under the terms of the GNU Affero General Public License as published by
10
* the Free Software Foundation, either version 3 of the License, or
13
* Xibo is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
* GNU Affero General Public License for more details.
18
* You should have received a copy of the GNU Affero General Public License
19
* along with Xibo. If not, see <http://www.gnu.org/licenses/>.
23
defined('XIBO') or die("Sorry, you are not allowed to directly access this page.<br /> Please press the back button in your browser.");
25
include_once('lib/data/schedule.data.class.php');
27
class DisplayGroupSecurity extends Data {
29
* Links a Display Group to a Group
31
* @param $displayGroupID Object
32
* @param $groupID Object
34
public function Link($displayGroupId, $groupId, $view, $edit, $del)
36
Log::notice('IN', 'DisplayGroupSecurity', 'Link');
39
$dbh = \Xibo\Storage\PDOConnect::init();
41
$sth = $dbh->prepare('INSERT INTO lkdisplaygroupgroup (DisplayGroupID, GroupID, View, Edit, Del) VALUES (:displaygroupid, :groupid, :view, :edit, :del)');
43
'displaygroupid' => $displayGroupId,
44
'groupid' => $groupId,
50
Log::notice('OUT', 'DisplayGroupSecurity', 'Link');
54
catch (Exception $e) {
56
Log::error($e->getMessage());
58
if (!$this->IsError())
59
$this->SetError(25005, __('Could not Link Display Group to User Group'));
66
* Unlinks a display group from a group
68
* @param $displayGroupID Object
69
* @param $groupID Object
71
public function Unlink($displayGroupId, $groupId)
73
Log::notice('IN', 'DisplayGroupSecurity', 'Unlink');
76
$dbh = \Xibo\Storage\PDOConnect::init();
78
$sth = $dbh->prepare('DELETE FROM lkdisplaygroupgroup WHERE DisplayGroupID = :displaygroupid AND GroupID = :groupid');
80
'displaygroupid' => $displayGroupId,
84
Log::notice('OUT', 'DisplayGroupSecurity', 'Unlink');
88
catch (Exception $e) {
90
Log::error($e->getMessage());
92
if (!$this->IsError())
93
$this->SetError(25007, __('Could not Unlink Display Group from User Group'));
100
* Unlinks a display group from a group
102
* @param $displayGroupID Object
103
* @param $groupID Object
105
public function UnlinkAll($displayGroupId)
107
Log::notice('IN', 'DataSetGroupSecurity', 'Unlink');
110
$dbh = \Xibo\Storage\PDOConnect::init();
112
$sth = $dbh->prepare('DELETE FROM lkdisplaygroupgroup WHERE DisplayGroupID = :displaygroupid');
114
'displaygroupid' => $displayGroupId
117
Log::notice('OUT', 'DataSetGroupSecurity', 'Unlink');
121
catch (Exception $e) {
123
Log::error($e->getMessage());
125
if (!$this->IsError())
126
$this->SetError(25007, __('Could not Unlink All Display Groups from User Group'));
b'\\ No newline at end of file'