Forum Discussion
8 Replies
- Arnaud_LemaireEmployee
Hello,
You have in the VPE (Visual Policy Editor) the ability to specify date and hour ranges to your policy. Is it what you are looking for or do you want to specify a duration ? like having access during x minutes to a site ?
- Rise_77519Nimbostratus
Hi Amaud, Actually i am looking for a user only access the local network between a time range. Example a user only access the network between 19:00 - 21:00 . Thanks,
- Stanislas_Piro2Cumulonimbus
I guess the need is to logout at 5:00 which is not available in VPE.
the only way is to evaluate the max session timeout (variable session.max_session_timeout) based on start time (session.user.starttime) like :
max timeout = 17:00 - starttime
- Cody_GreenEmployee
If you want all session to terminate at 5:00 I would recommend a cron job that will run at 5 to terminate all APM session.
- Stanislas_Piro2Cumulonimbus
or assign to variable session.max_session_timeout the following expression:
set endhour 17; set endmin 00; set starthour [clock format [mcget {session.user.starttime}] -format %H]; set startmin [clock format [mcget {session.user.starttime}] -format %M]; return [expr {( $endhour * 3600 ) + ( $endmin * 60 ) - ( $starthour * 3600 ) - ( $startmin * 60 )}]
- Walter_KacynskiCirrostratus
Do you happen to know if this assignment must occur within the VPE (before the session transitions to allow)? Or is ACCESS_POLICY_COMPLETED safe?
I assume that the timeout is enforced in tmm (not apmd) so it shouldn't matter.
- Stanislas_Piro2Cumulonimbus
Hi Walter,
This code is to be used in VPE variable assign box. The optimized code is:
expr { [clock scan "17:00"] - [mcget {session.user.starttime}] }
You can find more examples of variable assign expressions here