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

Commit 07f472e

Browse files
authored
Merge pull request #17 from pajavyskocil/master_1.15.x
Refractory to work with SimpleSAMLphp v1.15.x
2 parents f39befc + 8983676 commit 07f472e

15 files changed

+31
-31
lines changed

lib/AdapterLdap.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public function isUserOnFacility($spEntityId, $userId)
146146
"(&(objectClass=perunResource)(entityID=$spEntityId))",
147147
array("perunResourceId")
148148
);
149-
SimpleSAML_Logger::debug("Resources - ".var_export($resources, true));
149+
SimpleSAML\Logger::debug("Resources - ".var_export($resources, true));
150150

151151
if (is_null($resources)) {
152152
throw new SimpleSAML_Error_Exception("Service with spEntityId: ". $spEntityId ." hasn't assigned any resource.");
@@ -168,7 +168,7 @@ public function isUserOnFacility($spEntityId, $userId)
168168

169169
}
170170
$resultGroups = $this->removeDuplicateEntities($resultGroups);
171-
SimpleSAML_Logger::debug("Groups - ".var_export($resultGroups, true));
171+
SimpleSAML\Logger::debug("Groups - ".var_export($resultGroups, true));
172172
return $resultGroups;
173173
}
174174

lib/Auth/Process/ForceAup.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function process(&$request)
7272
$request['aupUrl'] = $this->aupUrl;
7373
$request['aupVersion'] = $forceAup;
7474
$id = SimpleSAML_Auth_State::saveState($request, 'perun:forceAup');
75-
$url = SimpleSAML_Module::getModuleURL('perun/force_aup_page.php');
75+
$url = SimpleSAML\Module::getModuleURL('perun/force_aup_page.php');
7676
\SimpleSAML\Utils\HTTP::redirectTrustedURL($url, array('StateId' => $id));
7777
}
7878

lib/Auth/Process/PerunAttributes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public function process(&$request)
7676
"Attribute name: $attrName, Supported types: null, string, array, associative array.");
7777
}
7878

79-
SimpleSAML_Logger::debug("perun:PerunAttributes: perun attribute $attrName was fetched. " .
79+
SimpleSAML\Logger::debug("perun:PerunAttributes: perun attribute $attrName was fetched. " .
8080
"Value ".implode(",", $value)." is being setted to ssp attribute $sspAttr");
8181

8282
$request['Attributes'][$sspAttr] = $value;

lib/Auth/Process/PerunGroups.php

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

3333
if (!isset($config[self::GROUPNAMEPREFIX_ATTR])) {
34-
SimpleSAML_Logger::warning("perun:PerunGroups: optional attribute '". self::GROUPNAMEPREFIX_ATTR . "' is missing, assuming empty prefix");
34+
SimpleSAML\Logger::warning("perun:PerunGroups: optional attribute '". self::GROUPNAMEPREFIX_ATTR . "' is missing, assuming empty prefix");
3535
$this->groupNamePrefix = '';
3636
} else {
3737
$this->groupNamePrefix = (string) $config[self::GROUPNAMEPREFIX_ATTR];
@@ -68,14 +68,14 @@ public function process(&$request)
6868
*/
6969
protected function mapGroupName($request, $groupName) {
7070
if (isset($request["SPMetadata"]["groupMapping"]) && isset($request["SPMetadata"]["groupMapping"][$groupName])) {
71-
SimpleSAML_Logger::debug("Mapping $groupName to " . $request["SPMetadata"]["groupMapping"][$groupName] . " for SP " . $request["SPMetadata"]["entityid"]);
71+
SimpleSAML\Logger::debug("Mapping $groupName to " . $request["SPMetadata"]["groupMapping"][$groupName] . " for SP " . $request["SPMetadata"]["entityid"]);
7272
return $request["SPMetadata"]["groupMapping"][$groupName];
7373
} 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]);
74+
SimpleSAML\Logger::debug("GroupNamePrefix overridden by a SP " . $request["SPMetadata"]["entityid"] . " to " . $request["SPMetadata"][self::GROUPNAMEPREFIX_ATTR]);
7575
return $request["SPMetadata"][self::GROUPNAMEPREFIX_ATTR] . $groupName;
7676
} else {
7777
# No mapping defined, so just put groupNamePrefix in front of the group
78-
SimpleSAML_Logger::debug("No mapping found for group $groupName for SP " . $request["SPMetadata"]["entityid"]);
78+
SimpleSAML\Logger::debug("No mapping found for group $groupName for SP " . $request["SPMetadata"]["entityid"]);
7979
return $this->groupNamePrefix . $groupName;
8080
}
8181
}

lib/Auth/Process/PerunIdentity.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,11 @@ public function process(&$request)
140140
$groups = $this->adapter->isUserOnFacility($spEntityId,$user->getId());
141141

142142
if (empty($groups)) {
143-
SimpleSAML_Logger::warning('Perun user with identity/ies: '. implode(',', $uids) .' is not member of any assigned group for resource (' . $spEntityId . ')');
143+
SimpleSAML\Logger::warning('Perun user with identity/ies: '. implode(',', $uids) .' is not member of any assigned group for resource (' . $spEntityId . ')');
144144
$this->unauthorized($request);
145145
}
146146

147-
SimpleSAML_Logger::info('Perun user with identity/ies: '. implode(',', $uids) .' has been found and SP has sufficient rights to get info about him. '.
147+
SimpleSAML\Logger::info('Perun user with identity/ies: '. implode(',', $uids) .' has been found and SP has sufficient rights to get info about him. '.
148148
'User '.$user->getName().' with id: '.$user->getId().' is being set to request');
149149

150150
if (!isset($request['perun'])) {
@@ -180,7 +180,7 @@ protected function register($request, $registerUrl, $callbackParamName, $vo, $gr
180180
);
181181

182182
$stateId = SimpleSAML_Auth_State::saveState($request, 'perun:PerunIdentity');
183-
$callback = SimpleSAML_Module::getModuleURL('perun/perun_identity_callback.php', array('stateId' => $stateId));
183+
$callback = SimpleSAML\Module::getModuleURL('perun/perun_identity_callback.php', array('stateId' => $stateId));
184184

185185
if ($this->containsMembersGroup($groups) || $this->forceRegistrationToGroups === false) {
186186
$this->registerDirectly($registerUrl, $callbackParamName, $callback, $vo);
@@ -223,7 +223,7 @@ protected function registerDirectly($registerUrl, $callbackParamName, $callback,
223223
*/
224224
protected function registerChooseGroup($registerUrl, $callbackParamName, $callback, $vo, $groups, $interface) {
225225

226-
$chooseGroupUrl = SimpleSAML_Module::getModuleURL('perun/perun_identity_choose_group.php');
226+
$chooseGroupUrl = SimpleSAML\Module::getModuleURL('perun/perun_identity_choose_group.php');
227227

228228
$groupNames = array();
229229
foreach ($groups as $group) {
@@ -275,7 +275,7 @@ private function containsMembersGroup($entities)
275275
protected function unauthorized(&$request) {
276276
$id = SimpleSAML_Auth_State::saveState($request,
277277
'perunauthorize:Perunauthorize');
278-
$url = SimpleSAML_Module::getModuleURL(
278+
$url = SimpleSAML\Module::getModuleURL(
279279
'perunauthorize/perunauthorize_403.php');
280280
if (isset($request['SPMetadata']['InformationURL']['en'])){
281281
\SimpleSAML\Utils\HTTP::redirectTrustedURL($url,

lib/Auth/Process/ProcessTargetedID.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public function process(&$request)
7070
# Construct new eppn
7171
$newEduPersonPrincipalName = $this->prefix . '_' . $hash . '@' . $scope;
7272

73-
SimpleSAML_Logger::info("perun.ProcessTargetedID: Converting eduPersonTargetedID '" . $uid . "' " .
73+
SimpleSAML\Logger::info("perun.ProcessTargetedID: Converting eduPersonTargetedID '" . $uid . "' " .
7474
"to the new ID '" . $newEduPersonPrincipalName . "'");
7575

7676
# Set attributes back to the response

lib/Auth/Process/ProxyFilter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function process(&$request)
6060
$currentSp = $request['Destination']['entityid'];
6161
if ($sp == $currentSp) {
6262

63-
SimpleSAML_Logger::info("perun.ProxyFilter: Filtering out filter $this->nestedClass for SP $currentSp");
63+
SimpleSAML\Logger::info("perun.ProxyFilter: Filtering out filter $this->nestedClass for SP $currentSp");
6464

6565
return;
6666
}

lib/Auth/Process/RetainIdPEntityID.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function process(&$request)
4141
}
4242

4343
$request['Attributes'][$this->attrName] = array($entityId);
44-
SimpleSAML_Logger::debug("perun:RetainIdPEntityID: entityID '$entityId' was extracted to attribute ".$this->attrName);
44+
SimpleSAML\Logger::debug("perun:RetainIdPEntityID: entityID '$entityId' was extracted to attribute ".$this->attrName);
4545
}
4646

4747

lib/Auth/Process/WarningTestSP.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public function process(&$request)
1616
{
1717
if (isset($request["SPMetadata"]["test.sp"]) && $request["SPMetadata"]["test.sp"] === true) {
1818
$id = SimpleSAML_Auth_State::saveState($request, 'perun:warningTestSP');
19-
$url = SimpleSAML_Module::getModuleURL('perun/warning_test_sp_page.php');
19+
$url = SimpleSAML\Module::getModuleURL('perun/warning_test_sp_page.php');
2020
\SimpleSAML\Utils\HTTP::redirectTrustedURL($url, array('StateId' => $id));
2121
}
2222
}

lib/Disco.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function handleRequest()
5656
if (sizeof($idpList) === 1) {
5757
$idp = array_keys($idpList)[0];
5858
$url = sspmod_perun_Disco::buildContinueUrl($this->spEntityId, $this->returnURL, $this->returnIdParam, $idp);
59-
SimpleSAML_Logger::info('perun.Disco: Only one Idp left. Redirecting automatically. IdP: ' . $idp);
59+
SimpleSAML\Logger::info('perun.Disco: Only one Idp left. Redirecting automatically. IdP: ' . $idp);
6060
SimpleSAML\Utils\HTTP::redirectTrustedURL($url);
6161
}
6262

@@ -115,7 +115,7 @@ protected function scoping($list)
115115
}
116116
}
117117
}
118-
//SimpleSAML_Logger::debug('perun.Disco.filterList: Idps after SAML2 Scoping: ' . var_export(array_keys($list), true));
118+
//SimpleSAML\Logger::debug('perun.Disco.filterList: Idps after SAML2 Scoping: ' . var_export(array_keys($list), true));
119119
return $list;
120120
}
121121

@@ -149,7 +149,7 @@ protected function whitelisting($list)
149149
unset($list[$entityId]);
150150
}
151151
}
152-
//SimpleSAML_Logger::debug('perun.Disco.filterList: Idps after Whitelisting: ' . var_export(array_keys($list), true));
152+
//SimpleSAML\Logger::debug('perun.Disco.filterList: Idps after Whitelisting: ' . var_export(array_keys($list), true));
153153
return $list;
154154
}
155155

@@ -162,7 +162,7 @@ protected function greylisting($list)
162162
}
163163
}
164164

165-
//SimpleSAML_Logger::debug('perun.Disco.filterList: Idps after Greylisting: ' . var_export(array_keys($list), true));
165+
//SimpleSAML\Logger::debug('perun.Disco.filterList: Idps after Greylisting: ' . var_export(array_keys($list), true));
166166
return $list;
167167
}
168168

@@ -175,7 +175,7 @@ protected function greylistingPerSP($list, $sp)
175175
}
176176
}
177177

178-
//SimpleSAML_Logger::debug('perun.Disco.filterList: Idps after Greylisting per SP: ' . var_export(array_keys($list), true));
178+
//SimpleSAML\Logger::debug('perun.Disco.filterList: Idps after Greylisting per SP: ' . var_export(array_keys($list), true));
179179
return $list;
180180
}
181181

0 commit comments

Comments
 (0)