Deactivate User by Script not working

Moderator: crythias

Post Reply
dsepeur
Znuny newbie
Posts: 19
Joined: 30 Sep 2019, 15:05
Znuny Version: 6 community edition
Real Name: Daniel Sepeur
Company: TREND Service GmbH

Deactivate User by Script not working

Post by dsepeur »

Hi,

today I have a question related to a kind of automation here.
I host many instances of OTRS on VHosts.
To have an overview about the configured users in each system, I wrote a little script.
Via this script, I need to have the capability to activate or deactivate users by one click action.
To do this, I found out, that I can set field valid_id in table users to either 1, 2 or 3. Depending on the action I want to perform.

This is working so far. But if I look to the user management in the admin page, the user I deactivated is always shown as active.
Is there another thing I have to do in my script to show the users actual state in the admin page?

Maybe someone can tell me where I find the PERL script which is responsible for this switch so I can learn from it. Or, if possible, point me in the right way.

Thank you very much.

Daniel
jojo
Znuny guru
Posts: 15019
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Deactivate User by Script not working

Post by jojo »

Hi,

please never change things directly via database. I suggest to use the Perl API to maintain users (UserUpdate)

Please check:
perldoc Kernel/System/User.pm
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
Post Reply