Kbase P130330: 4GL/ABL: Is there a way to end an OpenEdge/Progress client session after a specified period of user
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  23/01/2009 |
|
Status: Verified
GOAL:
4GL/ABL: How to end an OpenEdge/Progress client session after a specified period of user inactivity?
GOAL:
How to terminate an OpenEdge/Progress graphical (GUI) client session after it has been idle for a specified period time?
GOAL:
How to close an OpenEdge/Progress character(CHUI) (TTY) client session after it has been idle for a specified period time?
GOAL:
How to close a Progress 4GL GUI session if there is no user activity for 15 or more minutes?
GOAL:
Can a Progress GUI session be ended if the application is inactive for a specific period of time?
FACT(s) (Environment):
Windows
Progress 8.x
Progress 9.x
OpenEdge 10.x
FIX:
The following is one solution to end a Progress GUI session after 15 minutes of inactivity. Inactivity in this example is defined by the defined by the lack of the 'ANY-KEY', 'MOUSE-SELECT-DOWN' and 'MOUSE-SELECT-CLICK' events. This inactivity definition may be expanded to include other mouse events as desired.
This sample solution sets the maximum idle time allowed for the user to be 15 minutes. Every 10 minutes, the PSTimer OCX.Tick trigger examines whether the session has been idle for 15 or more units. If so, the session is closed.
1. In the Definition section, define a variable for the maximum idle time allowed.
DEFINE VARIABLE iMaxIdleTime AS INTEGER NO-UNDO.
2. In the Main Block section define the following event trigger:
ON 'ANY-KEY':U, 'MOUSE-SELECT-DOWN':U, 'MOUSE-SELECT-CLICK':U ANYWHERE DO:
RUN ResetTimer.
END.
3. In the ResetTimer procedure, put the code:
ETIME(YES).
END PROCEDURE.
4. In the Main Block section add the statement:
RUN InitializeObject.
After the
RUN enable_UI.
Statement.
5. In the InitializeObject procedure, put the code:
RUN ResetTimer.
ASSIGN
iMaxIdleTime = 900000 /* 15 minutes */
chCtrlFrame:PSTimer:Interval = 600000. /* 10 minutes */
END PROCEDURE.
6. In the OCX.Tick trigger of the PSTimer, put the code:
IF ETIME GE iMaxIdleTime THEN DO:
APPLY 'CLOSE':U TO THIS-PROCEDURE.
QUIT.
END.
END PROCEDURE.