Commit 61dfe335 authored by Roman Ondráček's avatar Roman Ondráček

IQRF Net: fix TR configuration writing for nodes

Signed-off-by: Roman Ondráček's avatarRoman Ondráček <ondracek.roman@centrum.cz>
parent 78f82cbf
Pipeline #2108 passed with stages
in 14 minutes and 50 seconds
......@@ -101,9 +101,9 @@ class SecurityFormFactory {
* @param SubmitButton $button Submit button for setting Access Password
*/
public function accessPassword(SubmitButton $button): void {
$address = (int) $this->presenter->getParameter('address', 0);
$values = $button->getForm()->getValues();
try {
$address = $this->presenter->getParameter('address', 0);
$this->manager->setAccessPassword($address, $values->password, $values->format);
$this->presenter->flashSuccess('iqrfnet.security.accessPassword.success');
} catch (DpaErrorException | EmptyResponseException | JsonException | UnsupportedInputFormatException $e) {
......@@ -116,9 +116,9 @@ class SecurityFormFactory {
* @param SubmitButton $button Submit button for setting User Key
*/
public function userKey(SubmitButton $button): void {
$address = (int) $this->presenter->getParameter('address', 0);
$values = $button->getForm()->getValues();
try {
$address = $this->presenter->getParameter('address', 0);
$this->manager->setUserKey($address, $values->password, $values->format);
$this->presenter->flashSuccess('iqrfnet.security.userKey.success');
} catch (DpaErrorException | EmptyResponseException | JsonException | UnsupportedInputFormatException $e) {
......
......@@ -227,7 +227,7 @@ class TrConfigFormFactory {
* @param Form $form Set TR configuration form
*/
public function save(Form $form): void {
$address = $this->presenter->getParameter('address', 0);
$address = (int) $this->presenter->getParameter('address', 0);
$config = $form->getValues('array');
if (array_key_exists('stdAndLpNetwork', $config)) {
$config['stdAndLpNetwork'] = (bool) $config['stdAndLpNetwork'];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment