From 6bc423f5d026ecec9d765098966edf8ff9cbbe7c Mon Sep 17 00:00:00 2001 From: damikael Date: Fri, 21 Jul 2023 18:01:43 +0200 Subject: [PATCH] feat: add getIdPList --- setup/sdk/spid-php.tpl | 37 +++++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/setup/sdk/spid-php.tpl b/setup/sdk/spid-php.tpl index 14fe2f2..0653b18 100644 --- a/setup/sdk/spid-php.tpl +++ b/setup/sdk/spid-php.tpl @@ -20,14 +20,28 @@ {{IDPS}} } - public function isSPIDEnabled() { - return self::SPID_ENABLED; - } - - public function isCIEEnabled() { - return self::CIE_ENABLED; - } - + public function isSPIDEnabled() { + return self::SPID_ENABLED; + } + + public function isCIEEnabled() { + return self::CIE_ENABLED; + } + + public function getIdPList() { + require_once("vendor/simplesamlphp/simplesamlphp/metadata/saml20-idp-remote.php"); + $list = array(); + foreach($this->idps as $code=>$entity_id) { + array_push($list, array( + 'name' => $metadata[$entity_id]['name']['it'], + 'code' => $code, + 'image' => $metadata[$entity_id]['icon'] + )); + } + + return $list; + } + public function getIdP() { return $this->spid_auth->getAuthData('saml:sp:IdP'); } @@ -153,11 +167,11 @@ } } } - + public function getLogoutURL($returnTo = null) { return $this->spid_auth->getLogoutURL($returnTo); } - + public function getAttributes() { return $this->spid_auth->getAttributes(); } @@ -516,8 +530,7 @@ return $button_li; } - - + public function insertCIEButton($size='default') { echo "