Forum Discussion

Rise_77519's avatar
Rise_77519
Icon for Nimbostratus rankNimbostratus
Aug 03, 2015

schedule user access on the apm

Hi, Is it possible to set a schedule time on the APM? I would like to do that users only access internal resource for a spesific time. Thanks,

 

8 Replies

  • 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 ?

     

  • 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,

     

  • 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

     

  • 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.

     

  • 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_Kacynski's avatar
      Walter_Kacynski
      Icon for Cirrostratus rankCirrostratus

      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_Piro2's avatar
        Stanislas_Piro2
        Icon for Cumulonimbus rankCumulonimbus

        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