From 29bec002862a78bf255e83b9b2d1bb47b086971b Mon Sep 17 00:00:00 2001 From: Andreas Westermaier Date: Sun, 25 Jan 2026 02:20:30 +0100 Subject: [PATCH] Respect pre-set Service-Type in accessRequest --- src/Radius.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Radius.php b/src/Radius.php index 2867443..376fae2 100644 --- a/src/Radius.php +++ b/src/Radius.php @@ -1681,7 +1681,7 @@ public function decodeVendorSpecificContent($rawValue) * @param string $username Username to authenticate as * @param string $password Password to authenticate with using PAP * @param int $timeout The timeout (in seconds) to wait for a response packet - * @param string $state The state of the request (default is Service-Type=1) + * @param string $state The state of the request (default is Service-Type=1 unless already set) * @return boolean true if the server sent an Access-Accept packet, false otherwise */ public function accessRequest($username = '', $password = '', $timeout = 0, $state = null) @@ -1701,7 +1701,9 @@ public function accessRequest($username = '', $password = '', $timeout = 0, $sta if ($state !== null) { $this->setAttribute(24, $state); } else { - $this->setAttribute(6, 1); // 1=Login + if ($this->getAttributesToSend(6) === null) { + $this->setAttribute(6, 1); // 1=Login + } } if (intval($timeout) > 0) {