summaryrefslogtreecommitdiffstats
path: root/library/Director/Restriction
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 13:17:47 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 13:17:47 +0000
commit5419d4428c86c488a43124f85e5407d7cbae6541 (patch)
tree772c4221a20fd7d1b3e7e67c6e21755a50e80fd7 /library/Director/Restriction
parentAdding upstream version 1.10.2. (diff)
downloadicingaweb2-module-director-upstream.tar.xz
icingaweb2-module-director-upstream.zip
Adding upstream version 1.11.1.upstream/1.11.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--library/Director/Restriction/FilterByNameRestriction.php2
-rw-r--r--library/Director/Restriction/HostgroupRestriction.php8
2 files changed, 5 insertions, 5 deletions
diff --git a/library/Director/Restriction/FilterByNameRestriction.php b/library/Director/Restriction/FilterByNameRestriction.php
index 8c3b256..aef28c4 100644
--- a/library/Director/Restriction/FilterByNameRestriction.php
+++ b/library/Director/Restriction/FilterByNameRestriction.php
@@ -30,7 +30,7 @@ class FilterByNameRestriction extends ObjectRestriction
protected function setNameForType($type)
{
- $this->name = "director/${type}/filter-by-name";
+ $this->name = "director/{$type}/filter-by-name";
}
public function allows(IcingaObject $object)
diff --git a/library/Director/Restriction/HostgroupRestriction.php b/library/Director/Restriction/HostgroupRestriction.php
index 1a6792b..f2face4 100644
--- a/library/Director/Restriction/HostgroupRestriction.php
+++ b/library/Director/Restriction/HostgroupRestriction.php
@@ -2,7 +2,7 @@
namespace Icinga\Module\Director\Restriction;
-use Icinga\Exception\ProgrammingError;
+use Icinga\Module\Director\Auth\Restriction;
use Icinga\Module\Director\Db\IcingaObjectFilterHelper;
use Icinga\Module\Director\Objects\IcingaHost;
use Icinga\Module\Director\Objects\IcingaHostGroup;
@@ -11,7 +11,7 @@ use Zend_Db_Select as ZfSelect;
class HostgroupRestriction extends ObjectRestriction
{
- protected $name = 'director/filter/hostgroups';
+ protected $name = Restriction::FILTER_HOSTGROUPS;
public function allows(IcingaObject $object)
{
@@ -93,7 +93,7 @@ class HostgroupRestriction extends ObjectRestriction
['id']
)->where('id = ?', $hostgroup->id);
- $this->filterHostGroupsQuery($query);
+ $this->filterHostGroupsQuery($query, 'h');
return (int) $this->db->fetchOne($query) === (int) $hostgroup->get('id');
}
@@ -141,7 +141,7 @@ class HostgroupRestriction extends ObjectRestriction
if (empty($groups)) {
$query->where('(1 = 0)');
} else {
- $query->where("${tableAlias}.object_name IN (?)", $groups);
+ $query->where("{$tableAlias}.object_name IN (?)", $groups);
}
}