From cd375cd8f375a9960cc5f9812381e9eda37c9a20 Mon Sep 17 00:00:00 2001 From: Dick Visser Date: Wed, 30 Nov 2022 15:47:44 +0100 Subject: [PATCH] Add remote addr and user agent --- lib/AccountLinker/Store/SQLStore.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/AccountLinker/Store/SQLStore.php b/lib/AccountLinker/Store/SQLStore.php index abaf931..18965bd 100644 --- a/lib/AccountLinker/Store/SQLStore.php +++ b/lib/AccountLinker/Store/SQLStore.php @@ -393,17 +393,23 @@ public function saveSpEntityId() user_id, account_id, spentityid, - idp_entityid + idp_entityid, + ip_addr, + user_agent ) VALUES ( :user_id, :account_id, :spentityid, - :idp_entityid)"); + :idp_entityid, + :ip_addr, + :user_agent)"); $stmt->execute(array( ':user_id' => $userId, ':idp_entityid' => $this->getEntityId(), ':account_id' => $this->_getAccountId(), - ':spentityid' => $this->_spEntityId + ':spentityid' => $this->_spEntityId, + ':ip_addr' => $_SERVER['REMOTE_ADDR'] ?? '::1', + ':user_agent' => $_SERVER['HTTP_USER_AGENT'] ?? '' )); SimpleSAML_Logger::stats('AccountLinker: Returning user_id '.$userId);