# Switch User Popup based on time

**URL:** <https://forum.inductiveautomation.com/t/switch-user-popup-based-on-time/69412>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [February 3, 2023, 4:03pm UTC](https://forum.inductiveautomation.com/t/switch-user-popup-based-on-time/69412 "2023-02-03T16:03:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dharani\_T](https://avatars.discourse-cdn.com/v4/letter/d/bc8723/32.png) [@Dharani\_T](https://forum.inductiveautomation.com/u/Dharani_T)\
**Post date:** [February 3, 2023, 4:03pm UTC](https://forum.inductiveautomation.com/t/switch-user-popup-based-on-time/69412/1 "2023-02-03T16:03:14Z")

</div>

Hi ,  
I need to implement a scheduling mechanism that opens the "Switch User" window at 5 minutes past the hour during shift changes (7:05 AM, 3:05 PM, 11:05 PM).  
\ I've tried using a scheduled timer, but the popup closes when I try to navigate the screen by clicking other buttons. How can I prevent this from happening and are there any alternative solutions?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [February 3, 2023, 4:38pm UTC](https://forum.inductiveautomation.com/t/switch-user-popup-based-on-time/69412/2 "2023-02-03T16:38:35Z")

</div>

You could call `system.security.lockScreen` on your schedule, which will bring up a username/password input prompt that _must_ be entered before you can interact with the rest of the client:  
[https://docs.inductiveautomation.com/display/DOC81/system.security.lockScreen](https://docs.inductiveautomation.com/display/DOC81/system.security.lockScreen)

---

<div class="post-metadata">

**Author:** ![Dharani\_T](https://avatars.discourse-cdn.com/v4/letter/d/bc8723/32.png) [@Dharani\_T](https://forum.inductiveautomation.com/u/Dharani_T)\
**Post date:** [February 3, 2023, 4:45pm UTC](https://forum.inductiveautomation.com/t/switch-user-popup-based-on-time/69412/3 "2023-02-03T16:45:28Z")

</div>

Thanks for the suggestion Griffith.  
But the customer asked for the customized window as below,  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/4/447787e508dbbd7ff28a239a0df0b2995ce5c7a3.png)  
Any other ideas Griffith?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [February 3, 2023, 4:50pm UTC](https://forum.inductiveautomation.com/t/switch-user-popup-based-on-time/69412/4 "2023-02-03T16:50:20Z")

</div>

Lots of ideas in this thread:

> [@Modal Pop-Up How-To?](https://forum.inductiveautomation.com/t/modal-pop-up-how-to/15211/10):
>
> Alright, who is ready for some hacking? This might get complicated, but here is how I have achieved this in the past. As an example, I will use my custom lock screen, attached in this post. Here is the script. def lockScreen(): from javax.swing import SwingUtilities,JFrame #Import some stuff import system.nav if system.util.getGlobals().has\_key('lockScreen'): #Check if the screen has been locked before. This really just saves the set up code system.util.getGlobals()["app"].getRootPane…

My _personal_ answer would be to tell the customer that `system.security.lockScreen` is the only way to do it. The lockscreen window looks almost identical to that popup, and this is a fairly ridiculous thing to split hairs over. But I'll leave that up to you 🙂

---

<div class="post-metadata">

**Author:** ![Kyle\_Chase](https://avatars.discourse-cdn.com/v4/letter/k/9de0a6/32.png) [@Kyle\_Chase](https://forum.inductiveautomation.com/u/Kyle_Chase)\
**Post date:** [February 6, 2023, 3:15pm UTC](https://forum.inductiveautomation.com/t/switch-user-popup-based-on-time/69412/5 "2023-02-06T15:15:57Z")

</div>

Blast from the past!

I went this route because the implementation would allow for navigation to work from a bottom nav bar, whereas the default lock screen wouldn't. I would also like to note I created the original implementation in the FPMI days, and I am not sure if I would have did the same thing after having 15+ years of experience. It works fine, but it is another thing to maintain.

---

<div class="post-metadata">

**Author:** ![Dharani\_T](https://avatars.discourse-cdn.com/v4/letter/d/bc8723/32.png) [@Dharani\_T](https://forum.inductiveautomation.com/u/Dharani_T)\
**Post date:** [February 8, 2023, 7:18am UTC](https://forum.inductiveautomation.com/t/switch-user-popup-based-on-time/69412/6 "2023-02-08T07:18:43Z")

</div>

Any other idea like, whenever the switch user popup opens,  
clicking the background of the window /navigating should be disabled as in 'system.security.lockScreen()?
