diff --git a/lib/GenieACS/GenieACS.php b/lib/GenieACS/GenieACS.php index 335036e0d..5688745e9 100644 --- a/lib/GenieACS/GenieACS.php +++ b/lib/GenieACS/GenieACS.php @@ -243,10 +243,27 @@ class GenieACS { * @throws Exception */ public function setParameterValues($deviceId, $parameterValues) { + // Convert associative array to GenieACS format: [["paramName", value, "type"], ...] + $formattedParams = []; + foreach ($parameterValues as $name => $value) { + // Determine XSD type based on value type + $xsdType = 'xsd:string'; // default + if (is_bool($value)) { + $xsdType = 'xsd:boolean'; + $value = $value ? true : false; // ensure proper boolean + } elseif (is_int($value)) { + $xsdType = 'xsd:int'; + } elseif (is_float($value)) { + $xsdType = 'xsd:double'; + } + + $formattedParams[] = [$name, $value, $xsdType]; + } + $tasks = [ [ "name" => "setParameterValues", - "parameterValues" => $parameterValues + "parameterValues" => $formattedParams ] ]; return $this->createTask($deviceId, $tasks); diff --git a/public/js/pages/Radius/RadiusUsers.js b/public/js/pages/Radius/RadiusUsers.js index 5058a1deb..a9a5cc108 100644 --- a/public/js/pages/Radius/RadiusUsers.js +++ b/public/js/pages/Radius/RadiusUsers.js @@ -1451,9 +1451,9 @@ Vue.component('radius-users', { try { const params = { - 'InternetGatewayDevice.User.1.Enable': 1, + 'InternetGatewayDevice.User.1.Enable': true, 'InternetGatewayDevice.User.1.Password': password, - 'InternetGatewayDevice.User.1.RemoteAccessCapable': 1, + 'InternetGatewayDevice.User.1.RemoteAccessCapable': true, 'InternetGatewayDevice.User.1.Username': timestamp };