You are not logged in.
Pages: 1
Hello there.
I was figuring out how to change an user's entity automatically, do it from php code or something else.
Currently, I am coding a plugin that adds a new page with a table to show the user's tickets, in this table there are tickets from five different entities, so, when the user clic on a ticket's link, I would like to change his entity to the ticket's one.
For our users is very hard to change entity between tickets, so if there is a way to do that it would be very helpful.
Thank you.
Last edited by Johan Romo (2023-09-15 19:41:34)
Offline
Plugins can call the "changeActiveEntities" static method in the Session class to change the current user's entity. The first parameter is the new entity ID and the second is a boolean to indicate if it should be recursive or not (see child entities).
GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.
Offline
Thank you cconard96
Offline
Pages: 1