Manage Learn to apply best practices and optimize your operations.

Log Out Users When There Is No Activity On A Database

You have seen in secure web sites that if there is no activity on the form for
certain time you are logged out.Similiar results can be acheived by using the
following code below.

How to Log out user's when there is no activity on a database?
----GLOBAL DECLARATIONS ------

Dim elapsedTime As Integer
Dim elapsedTimer As NotesTimer
%INCLUDE "lsconst.lss"

------POSTOPEN FORM EVENT ------
Sub Postopen(Source As Notesuidocument)
Dim session As New NotesSession
Set elapsedTimer = session.CreateTimer()
elapsedTimer.Interval = 1
elapsedTimer.Comment = "Elapsed time since opening document"
elapsedTime = 0
On Event Alarm From elapsedTimer Call elapsedTimerHandler

End Sub


-----ELAPSEDTIME SUBROUTINE-------


Sub elapsedTimerHandler(Source As NotesTimer)
Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Set uidoc = workspace.CurrentDocument

elapsedTime = elapsedTime + 1
Print elapsedtime

If elapsedtime=4 Then

If uidoc.EditMode Then
Call uidoc.FieldSetText( "SaveOptions", "0" )
uidoc.close
Messagebox ("Temp-1")
Else
uidoc.close

twoLiner = |This message is on two lines-2|
Messagebox twoLiner, MB_OK, "Demo"
End If



End If

End Sub

Dig Deeper on Domino Resources - Part 6

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchDataCenter

SearchContentManagement

Close