From: Rob McCool
Newsgroups: netscape.devs-nsapi
Subject: Re: changing log-in dialog box
Date: Wed, 18 Dec 1996 17:16:45 -0800
> I would like to know which articles are you refering to and where I
> can find them, as I think they can help me with my problem.
You can either select "show all articles" and do a find for mccool, or
take a look at http://www.lymehouse.com/devoto/stunt.html where some of
my ramblings are archived.
> My problem is:
>
> Instead of using the browser's log-in dialog box, I want to use my own
> html page. I still want to check the username and password against the
> netscape userdatabase.
>
> I have been unable to find a clear answer to this question. Hope you
> can help me.
If what you want to do is take a username and password such as "robm"
and "bargle", you can call either simple_user() or dbm_user() depending
on whether or not your databases are simple or DBM based.
The simple_user() and dbm_user() functions take a pblock, Session, and
Request as arguments like most NSAPI functions. To use them from your
NSAPI function, you would use func_exec(). An example would be:
...
pblock *newpb = pblock_create(4);
int rv;
pblock_nvinsert("fn", "simple-user", newpb);
pblock_nvinsert("userdb", "/usr/ns-home/userdb/foo", newpb);
pblock_nvinsert("user", the_user_name, newpb);
pblock_nvinsert("pw", the_password, newpb);
rv = func_exec(pb, sn, rq);
If rv is REQ_ABORTED, an error occured. If rv is REQ_NOACTION, the user
didn't exist or the password didn't match. If rv is REQ_PROCEED, the
user and password were valid.
Hope this helps
--Rob
--
Rob McCool, robm@netscape.com http://home.netscape.com/people/robm/
Stunt Programmer, Netscape Communications Corporation
It was working ten minutes ago, I swear...
Reproduced by permission of the author.