Skip to content
Snippets Groups Projects
Commit 2341b2e1 authored by Dominik František Bučík's avatar Dominik František Bučík
Browse files

chore: merge branch 'fix_update_ues' into 'main'

fix: :bug: Fix naming error preventing updateUes from working

See merge request perun-proxy-aai/simplesamlphp/simplesamlphp-module-perun!306
parents 74565118 dc5005f1
No related branches found
No related tags found
1 merge request!306fix: 🐛 Fix naming error preventing updateUes from working
Pipeline #258890 passed with warnings
...@@ -5,6 +5,7 @@ namespace SimpleSAML\Module\perun; ...@@ -5,6 +5,7 @@ namespace SimpleSAML\Module\perun;
use Exception; use Exception;
use SimpleSAML\Configuration; use SimpleSAML\Configuration;
use SimpleSAML\Logger; use SimpleSAML\Logger;
use SimpleSAML\Module\perun\Exception as PerunException;
class UESUpdateHelper class UESUpdateHelper
{ {
...@@ -82,15 +83,20 @@ class UESUpdateHelper ...@@ -82,15 +83,20 @@ class UESUpdateHelper
$attrValue = [$attrValue]; $attrValue = [$attrValue];
} }
if (empty($attrValue)) {
continue;
}
foreach ($attrValue as $extLogin) { foreach ($attrValue as $extLogin) {
if (empty($extLogin)) {
continue;
}
$userExtSource = self::getUserExtSource($adapter, $extSourceName, $extLogin); $userExtSource = self::getUserExtSource($adapter, $extSourceName, $extLogin);
if ($userExtSource !== null) { if ($userExtSource !== null) {
Logger::debug( Logger::debug(
self::DEBUG_PREFIX . 'Found user ext source for combination extSourceName \'' self::DEBUG_PREFIX . 'Found user ext source for combination extSourceName \''
. $extSourceName . '\' and extLogin \'' . $extLogin . '\'' . $extSourceName . '\' and extLogin \'' . $extLogin . '\''
); );
return $userExtSource; return $userExtSource;
} }
} }
...@@ -103,7 +109,11 @@ class UESUpdateHelper ...@@ -103,7 +109,11 @@ class UESUpdateHelper
{ {
try { try {
return $adapter->getUserExtSource($extSourceName, $extLogin); return $adapter->getUserExtSource($extSourceName, $extLogin);
} catch (SimpleSAML\Module\perun\Exception $ex) { } catch (PerunException $ex) {
Logger::debug(
self::DEBUG_PREFIX . 'Did not find extSource for combination of parameters extSourceName: \''
. $extSourceName . '\', extLogin: \'' . $extLogin . '\''
);
return null; return null;
} }
} }
...@@ -217,7 +227,7 @@ class UESUpdateHelper ...@@ -217,7 +227,7 @@ class UESUpdateHelper
strpos($attributeType, self::MAP_TYPE); strpos($attributeType, self::MAP_TYPE);
} }
public static function convertToString($newValue) public static function convertToString($newValue): string
{ {
if (!empty($newValue)) { if (!empty($newValue)) {
$newValue = array_unique($newValue); $newValue = array_unique($newValue);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment