OpenNTF.org - Notes Password Hook
My Links (Not logged in)
Code Bin Search
 
Hosted by Prominic.NET
Rate This Code
5 - brilliant stuff
4 - very nice
3 - average
2 - needs work
1 - bad
   OpenNTF Code Bin
About This Code
Brief Description:
Notes Password Hook 
Rating:
Rating: 4.8 , Number of votes: 5 
Contributor:
Davy Vanherbergen 
Category:
C/Cpp 
Type:
Security 
Notes Version:
R5.x, R6.x 
Last Modified:
09 Aug 2004 
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
The password hook allows you to supply notes with passwords from a text file.

This is dll is an adapted version of the sample provided with the notes c api.

Usage / Example
Add the pwdhook.dll to your notes program directory.
In your notes.ini file add an entry: ExtMgr_AddIns=pwdhook.dll
In your notes data directory, create a file pwdhook.txt

In this file you can specify which password to use for which id, for example

C:\lotus\notes\data\idfile_1.id=password_for_id_1
C:\lotus\notes\data\idfile_2.id=password_for_id_2

You can also specify that you do not want to use the password hook for an id file, in that case, just enter the id file with a blank password and it will prompt you for the password when needed.

C:\lotus\notes\data\my_id_file.id=

You don't have to enter the full id file path, you can use a partial path to match multiple id's. If there are multiple possible matches it will use the best match.

For example:

C:\lotus\notes\data\certification\=password_A
C:\lotus\notes\data\certification\id_1.id=password_B

will result in password_B being used for id_1.id, and password_A for all others in this directory.

! Important: When you enter a wrong password for an id in the file, you will not be able to switch to this id.

Once you have set this up, restart your notes client to load the pwdhook.
Code Attachments
pwdhook_src.zip (12 Kbytes)
pwdhook.dll (172 Kbytes)
 Comments
Posted by Manfred STANOSSEK on 09/10/2004 06:53:32 AMProblem with R 6.5.2 German Client
I installed the the files as descripted, created a pwdhoolk.txt in my data-dir but the line with a blank password doesn't work. My client is telling my that my password is incorrect and i can only select change id, restore password or exit notes.
Posted by Davy Vanherbergen on 09/10/2004 08:19:50 AMprobably an error in the txt file
can you post the content of your pwdhook.txt ? (replace your actual pwds with some text) ?
Posted by Manfred STANOSSEK on 09/10/2004 09:24:06 AMMy pwdhook.txt
e:\notes.dta\100650.id=
n:\rbgk\cid\=xxxxxxxxxxxx
Type ErrorMessage is "This ID needs a Password"
I hope the translation is corroect, i use an German Client
regards Manfred
Posted by Davy Vanherbergen on 09/10/2004 10:03:24 AMstrange.. it should work
Now, in your case you don't need the first line, the hook will only intercept the password prompt when it can find a (partial) matching filename in the file.
The blank option is there to exclude a specific file that is in a folder for which you have specified a password, for example:
n:\rbgk\cid\=XXXX
n:\rbgk\cid\100649.id=
That aside, it should still work the way you set it up, is there maybe a copy of the 100650.id in the n:\rbgk\cid folder?
Posted by cheny bin on 06/02/2006 12:19:58 AMin Domino R7's SDK
you can use a dll dialog to accept user's input ,so this dialog is Customized
Posted by Dark Schröder on 01/24/2008 04:43:39 AMPwdHook on Unix/Linux Systems
Hi, is there any chance to run the pwdhook on Unix/Linux Systems? What changes to the source do i have to make? Is there already a Unix/Linux Version of pwdhook, which i can use?
greetings Dirk
 Add your comment!