user session > 2hrs will terminate.
Hi
KumarRahul605332 Just a few guidelines on this.
1 - You can query AUSR and AH to get the list of active users:SELECT AH_NAME
FROM AH
WHERE AH_IDNR IN (SELECT AUSR_AH_Idnr FROM AUSR)
AND AH_Client='&$CLIENT#';
Use this SQL in a SQLI object - let's call it '
VARA.SQLI.ACT.USR'.
2 - You may use some scripting - preferably activated recursively in an EVNT.TIME - that will :- pull the list of active users from 'VARA.SQLI.ACT.USR'
- get their activation times with GET_STATISTIC_DETAIL (this could also be done via the SQL statement by querying 'AH_Timestamp1', but you'll need to convert the timestamp)
- calculate the actual connection time and disconnect the user if it's exceeded
Here is a script that does what is listed above:
:SET &HND#=PREP_PROCESS_VAR(VARA.SQLI.ACT.USR)
:PROCESS &HND#
: SET &USER# = GET_PROCESS_LINE(&HND#,1)
: SET &ACT_TIME#= GET_STATISTIC_DETAIL(,"ACTIVATION_TIME", "&USER#")
: P &USER# is active since &ACT_TIME#
: SET &ACT_TIME# = STR_CUT(&ACT_TIME#,12)
: SET &DURATION# = DIFF_TIME("HH:MM:SS;&$PHYS_TIME_HH_MM_SS#","HH:MM:SS;&ACT_TIME#")
: IF &DURATION# GE 20000
: P Maximum connection time has been exceeded. User &USER# will be disconnected.
: DISCONNECT "USER","&USER#"
: ENDIF
:ENDPROCESS
Please note however that this is a very simplified method, as it will affect all users in the current client, which may not be what you are looking for. In which case you will need to be more specific on which sessions should be killed and which ones shouldn't.
I am attaching an xml export of the used objects (generated under User Interface 11.2.4+hf.1.build.739).
Best regards,
Antoine