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

Commit b7a8e56

Browse files
authored
Merge pull request #4 from CESNET/eduPersonEntitlement
Added optional attribute groupNamePrefix.
2 parents c46509e + 77f6e30 commit b7a8e56

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/Auth/Process/PerunGroups.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ public function __construct($config, $reserved)
3030
}
3131
$this->attrName = (string) $config['attrName'];
3232

33-
if (!isset($config[GROUPNAMEPREFIX_ATTR])) {
34-
SimpleSAML_Logger::warning("perun:PerunGroups: optional attribute '". GROUPNAMEPREFIX_ATTR . "' is missing, assuming empty prefix");
33+
if (!isset($config[self::GROUPNAMEPREFIX_ATTR])) {
34+
SimpleSAML_Logger::warning("perun:PerunGroups: optional attribute '". self::GROUPNAMEPREFIX_ATTR . "' is missing, assuming empty prefix");
3535
$this->groupNamePrefix = '';
3636
} else {
37-
$this->groupNamePrefix = (string) $config[GROUPNAMEPREFIX_ATTR];
37+
$this->groupNamePrefix = (string) $config[self::GROUPNAMEPREFIX_ATTR];
3838
}
3939
}
4040

@@ -70,9 +70,9 @@ protected function mapGroupName($request, $groupName) {
7070
if (isset($request["SPMetadata"]["groupMapping"]) && isset($request["SPMetadata"]["groupMapping"][$groupName])) {
7171
SimpleSAML_Logger::debug("Mapping $groupName to " . $request["SPMetadata"]["groupMapping"][$groupName] . " for SP " . $request["SPMetadata"]["entityid"]);
7272
return $request["SPMetadata"]["groupMapping"][$groupName];
73-
} else if (isset($request["SPMetadata"][GROUPNAMEPREFIX_ATTR])) {
74-
SimpleSAML_Logger::debug("GroupNamePrefix overridden by a SP " . $request["SPMetadata"]["entityid"] . " to " . $request["SPMetadata"][GROUPNAMEPREFIX_ATTR]);
75-
return $request["SPMetadata"][GROUPNAMEPREFIX_ATTR] . $groupName;
73+
} else if (isset($request["SPMetadata"][self::GROUPNAMEPREFIX_ATTR])) {
74+
SimpleSAML_Logger::debug("GroupNamePrefix overridden by a SP " . $request["SPMetadata"]["entityid"] . " to " . $request["SPMetadata"][self::GROUPNAMEPREFIX_ATTR]);
75+
return $request["SPMetadata"][self::GROUPNAMEPREFIX_ATTR] . $groupName;
7676
} else {
7777
# No mapping defined, so just put groupNamePrefix in front of the group
7878
SimpleSAML_Logger::debug("No mapping found for group $groupName for SP " . $request["SPMetadata"]["entityid"]);

0 commit comments

Comments
 (0)