About This Code
Brief Description:
Call notes password prompt from lotusscript
Contributor:
Davy Vanherbergen
Notes Version:
R5.x, R6.x
Last Modified:
11 Jul 2003
OpenNTF Disclaimer
All of the program code and information presented in the OpenNTF.org Code Bin are provided "as-is", and should be used at your own risk. OpenNTF.org make no express or implied warranty about anything in the Code Bin, and OpenNTF.org will not be responsible or liable for any damage caused by the use or misuse of anything from this site. OpenNTF.org makes no guarantees about anything. Please thoroughly test all of the knowledge and code you find here before you attempt to use them in your production environment.
Code / Description
You can use this script to verify that active user is the logged in user by forcing them to re-enter their notes password.
This script has some major advantages over the well know @command([ToolsUserLogoff]):
1. you can use lotusscript
2. you can use lotusscript !!
3. it does NOT log off the user, so if he/she fails to enter the correct password or cancels the password prompt, they can continue with whatever
4. you can execute different code when the user enters the wrong password
Drawbacks: current implementation is windoze only. Please feel free to donate a Mac :-)
Usage / Example
Option Public
Use "LSPasswordPrompt"
Sub Initialize
If VerifyActiveUser Then
Print "Hey, you know the magic word."
Else
Print "Doh.. wrong answer.."
End If
End Sub
Code Attachments
Comments
Posted by Davy Vanherbergen on 07/05/2003 03:24:19 PMtest
test
Posted by Achim Hecht on 01/21/2004 09:25:18 AMcool stuff !!!
... I coded a script using NotesRegistration-Class. But your solution is much more better because need to restart Notes if the user enters a wrong password.
Posted by David J Seifert on 05/22/2006 02:44:59 PMSlight problem in debug mode
I needed to be able to verify the identity of a user entering my app and your password script works great! Thank you. I did find one little problem though. If a user goes into "Debug Lotusscript" mode, and clicks CANCEL DEBUGGER when they enter the script that executes the "If VerifyActiveUser Then" piece of code, that bit of code is not executed. Consequently, the person is able to get into my app without having to enter a password.
Any suggestions on how to tighten that down? I perform the "If VerifyActiveUser Then" check in the PostOpen event of the Page that get executed when the App starts up.
Thanks!
Posted by Ian bob on 05/28/2006 05:47:30 PMhelp
All the user hast to do is hit cancel and they get in what am I doing wrong?
Posted by David J Seifert on 05/29/2006 06:46:35 AMRE: help
This is my IF statement in the POSTOPEN event of the initial page that is opened in my application:
'Prompt user to enter their Notes Password.
If VerifyActiveUser Then
Else
' 0=MB_OK and 16=MB_ICONSTOP
boxtype& = 0 + 16
ans% = Messagebox("Failed Authentication. Exiting Password Manager.", boxtype&, "Error")
Set uidb = ws.GetCurrentDatabase
Call uidb.Close
End If
The "Call uidb.Close" closes the app if verification fails. Hope that helps.
Posted by Laura Wise on 03/29/2011 04:23:35 PMCheers
Thanks for posting this!