how to handle a Inactive user logging in?

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
Jaymer
Posts: 2430
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

how to handle a Inactive user logging in?

Post by Jaymer »

if I have an ActiveYN field in my user table,
whats the easiest way to prevent them logging in?

I have an init process.
In that I'm doing a IF LoggedInSystemuser.ActiveYN = 'No' THEN xxxxx

If I do a LOGOUT, then it still shows the VP they came in on, but pops up the "Session has timed out" msg. Kinda fugly
I tried doing a DISPLAY URL after that, but according to the Logger, it appends "IN NEW WINDOW" to that and Chrome will block a popup window attempt. After allowing popup, it shows the URL in a new tab, but now a spinner in the original window.

I could create another VP and a more friendly screen, but was hoping for something more straightforward right there after the "THEN"

Ideas?
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
himanshu
Posts: 722
Joined: Thu Jun 19, 2008 6:24 am
Location: India
Contact:

Re: how to handle a Inactive user logging in?

Post by himanshu »

Hi Jaymer,

Here is my suggestion..

- create a blank VP
- create a process which will check the LoggedInUser Active status, if yes then move to main VP else logout with DISPLAY MESSAGE if you care.
- place the process on the blank VP initialising setting area

Let me know if it help.
From,
Himanshu Jain


AwareIM Consultant (since version 4.0)
OS: Windows 10.0, Mac
DB: MYSQL, MSSQL
hpl123
Posts: 2579
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

Re: how to handle a Inactive user logging in?

Post by hpl123 »

I do something similar where I have VP which is used only for "logout" operations and that VP only has the "Logout" command where you can also set a exit URL the user is then directed to (i.e I would have a fancy message first upon initial logon and then open up the logout VP to logout/redirect the user to the main system/company website).
Henrik (V8 Developer Ed. - Windows)
BobK
Posts: 544
Joined: Thu Jan 31, 2008 2:14 pm
Location: Cincinnati, Ohio, USA

Re: how to handle a Inactive user logging in?

Post by BobK »

Jaymer wrote: Thu Jun 10, 2021 4:41 am I have an init process.
In that I'm doing a IF LoggedInSystemuser.ActiveYN = 'No' THEN xxxxx
For the xxxxx do a REPORT ERROR

Something like:
IF LoggedInSystemuser.ActiveYN = 'No' THEN
REPORT ERROR 'User inactive'

What will happen:
The VP displays along with the error message which also has an "OK" button
When the "OK" button is pressed, the VP is replaced with the login page.
Bob
Jaymer
Posts: 2430
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: how to handle a Inactive user logging in?

Post by Jaymer »

YES @BobK !!!
Thats the perfect solution.
Perhaps undocumented, but doing a REPORT ERROR in an InitializationProcess after login produces a clean message, logout & return to login page.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
Post Reply