Skip to content
This repository was archived by the owner on Sep 19, 2022. It is now read-only.

Commit 1509743

Browse files
committed
Use new object perunFacility in LDAP to search information about facility
1 parent 970e6da commit 1509743

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ All notable changes to this project will be documented in this file.
2020
#### Changed
2121
- RpcConnector now stores cookie into file
2222
- Set CONNECTTIMEOUT and TIMEOUT in RpcConnector
23+
- Use new object perunFacility in LDAP to search information about facility
2324

2425
## [v3.2.1]
2526
#### Fixed

lib/AdapterLdap.php

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,16 @@ public function getMemberGroups($user, $vo)
118118

119119
public function getSpGroups($spEntityId)
120120
{
121+
$facility = $this->connector->searchForEntity(
122+
$this->ldapBase,
123+
"(&(objectClass=perunFacility)(entityID=$spEntityId))",
124+
['perunFacilityId']
125+
);
126+
127+
$id = $facility['perunFacilityId'][0];
121128
$resources = $this->connector->searchForEntities(
122129
$this->ldapBase,
123-
"(&(objectClass=perunResource)(entityID=$spEntityId))",
130+
"(&(objectClass=perunResource)(perunFacilityDn=perunFacilityId=$id,$this->ldapBase))",
124131
["perunResourceId", "assignedGroupId", "perunVoId"]
125132
);
126133

@@ -270,9 +277,16 @@ public function setUserExtSourceAttributes($userExtSourceId, $attributes)
270277

271278
public function getUsersGroupsOnFacility($spEntityId, $userId)
272279
{
280+
$facility = $this->connector->searchForEntity(
281+
$this->ldapBase,
282+
"(&(objectClass=perunFacility)(entityID=$spEntityId))",
283+
['perunFacilityId']
284+
);
285+
286+
$id = $facility['perunFacilityId'][0];
273287
$resources = $this->connector->searchForEntities(
274288
$this->ldapBase,
275-
"(&(objectClass=perunResource)(entityID=$spEntityId))",
289+
"(&(objectClass=perunResource)(perunFacilityDn=perunFacilityId=$id,$this->ldapBase))",
276290
["perunResourceId"]
277291
);
278292
Logger::debug("Resources - " . var_export($resources, true));

0 commit comments

Comments
 (0)