|
|
|
|
|
|
|
|
|
|
|
|
|
|
Coding Domino server tasks in C: the adventure continues (continued)
ACLHelp doesn't break the normal rules of Domino security because it only works if you have administrator's rights to the system. If you can't already shut the server down remotely, you can't run ACLHelp. In fact it would be a good addition to the standard administration tools. Hmmm…maybe I should start a petition on behalf of all administrators.
To run ACLHelp, you need to install the naclhelp.exe (for Windows) program in the server program directory. To run it, you type the following on the server console:
load aclhelp docs\mydb.nsf Ian Cherrill/4NF
|
You'll find that Ian Cherrill/4NF is now an unspecified manager in the ACL of the mydb.nsf database, located in the docs folder.
ACLHelp source code The source code can be found at http://www.4nf.co.uk/aclhelp, and you need to set up your compiler environment as described in last month's article. You must create the ACLHelp project and compile both the Win32 Debug and Win32 Release builds in MS Visual C++ 6.0 to make sure everything is working correctly.
By the way, if you're little confused by the error-handling code in these programs, you're not alone. When I first saw the following construct, I wondered what it meant:
if (error = NSFDbOpen (path, &hDb))
{
LogError (error);
return NOERROR;
}
|
Like a lot of C, there's a long way and a short way of writing the code. The error code returned is either zero (for no error) or a number relating to the problem. What the "if" statement does is execute the function and assign the error code to a variable called error and test the value of error all at once. And the statement:
is the same as:
So it could be written as:
error = NSFDbOpen (path, &hDb);
if (error != 0)
{
LogError (error);
return NOERROR;
}
|
This is definitely more readable. However, I've adopted the shorthand that Lotus uses, so don't blame me!
Stepping through Let's step through the ACLHelp program.
Build the code using the "Win32 Debug" as the active configuration. To run the program successfully, you must add some extra information to the Project Settings page under the Debug tab, as pictured in Figure A.
FIGURE A
 
You must add some extra information to the Project Settings page. Roll over picture for a larger image.
As you can see, under Working directory, you must specify "d:\notes" (or whatever your local Notes program directory is), and under Program arguments, you must specify "test.nsf, Mickey Mouse."
This tells the compiler to run the program from the Notes program directory (Domino server or Notes client) on your workstation. It also adds some test arguments that you would normally add on the console command line. Now in the Notes client, add a new database to match the program arguments called test.nsf using any design template you like. Check the ACL before you start so you know what's in it already.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- Advertisement --
Learn Notes and Domino 8 at your place and pace!
Learn Notes and Domino in your office and/or home! TLCC's highly acclaimed distance learning courses for users, developers, and admins will enhance your career and your resume.
The many included activities and demos will make you a pro! Expert instructor help is a click away.
Click here to try a FREE demo course!! |
-- Advertisement --
Teamstudio Edition 25 has shipped
It's finally here! Now that Teamstudio Edition 25 has shipped, listen to our latest Tool Time audio program to find out what's changed. Updates to all your favorite Teamstudio tools will be discussed.
Plus, you'll get an introduction to Teamstudio Undo (formerly known as Teamstudio Snapper).
Tap here to get started! |
|
|
|
|
|
|
|
|
|
|