Modify setting api

gmp

#1

Hi all,
I tried to change a user’s timezone using the xml modify_setting API in the following way:

<modify_setting>
<name>Timezone</name>
<value>Europe/Rome</value>
</modify_setting>

but once done, with that user I can not log in anymore.

In openvasmd.log I saw that the modification of the timezone is done by executing the string xml:

<modify_setting>
<name>Timezone</name>
<value>RXVyb3BlL1JvbWU=</value>
</modify_setting>

but the documentation (https://docs.greenbone.net/API/GMP/gmp.html#command_modify_setting) says that “Timezone” can be modified by name".

Can you help me? Thank you in advance


#2

Hi,

you have spotted a inconvenience in our api docs. All values of modify_settings must be base64 encoded. I could reproduce your issues and did successfully locked out my own user. To fix this you have to update the user timezone directly in the database via

update users set timezone='$base64encode(timezone)' where name='$username';

or just

update users set timezone='' where name = '$username';

to reset the timezone. The $stuff are only placeholders for your specific settings.


#3

thank you bricks!