How to

Hi,

I have a little/big problem.

I want to create a database that can be accessed from the web, the users that do this should login in with a password and username that will be stored on a doc that represents the user in the same database.

The login proccess should look like this-

the form that is visible on the web has just two fields username and password

user enters the username and the pass who are compared with the usrnm and pswrd on the document that represents the user

(here lies the first problem i dont know how to access the fields in the doc with javascript).

then a inputbox comes up which ask the user for a number and if the number matches with a number of a doc in a database he gets the field values of that doc.

And that is all that is needed.

And i am not sure how to logut?

Please help it is urgent.

Branimir

Subject: How to

Refer to your earlier discussion thread for login process.

To logout replace ?login with ?logout in the url like -

http://servername/databasename.nsf?logout

Can you explain more about -

then a inputbox comes up which ask the user for a number and if the number matches with a number of a doc in a database he gets the field values of that doc.

–Phani

Subject: RE: How to

It doesnt have to be an inputbox, it can be a form that has one field that asks for a contract number, if a contract with a number exists in the database than the form (or i can open another form) or a messagebox apears with data from few fields from the contract.

Then he can use the data and the proccess is over.

Thank you

Subject: RE: How to

For this -

  1. Create a form with a field which will hold contract number. All the other fields (which you want to show the details also could be on the same form). Name that field as “ContractNo”.

  2. On click on button run an agent which will populate all the field values.


Before that create a view with the Contract number as the first column Sorted (either Ascending or Descending)


Then create an agent with the following code -

Dim s as new notessession

Dim db as notesdatabase

Dim vw as notesview

Dim curdoc as notesdocument

Dim vwdoc as notesdocument

set db = s.currentdatabase

set vw = db.getview(“set the view name here”) ’ Make sure that Contract number is the first column for this view sorted either ascending or descending

set curdoc = s.documentcontext

'If user doesn’t enter contract number then exit from the code

if curdoc.ContractNo(0) = “” then exit sub

set vwdoc = vw.getdocumentbykey(curdoc.ContractNo(0))

if not vwdoc is nothing then

currdoc.fieldname = vwdoc.fieldname(0)

…

…

end if

Run the above agent using @command(ToolsRunMacro).

–Phani

Subject: RE: How to

OK I will try this, then i will write back. Do i have to create the person in names.nsf or just a person document. Does the person needs an idfile, and do i have to add her to the access list of the database?

Thanks

Subject: RE: How to

  1. Yes, you need to create the person in names.nsf.2. For internet use, id file is not required. It is only required for client applications.

  2. Yes, you need to add the user to ACL and give appropriate access.

Dont forget to set Anonymous entry in ACL. Read more about Anonymous in Lotus Help file.

–Phani

Subject: RE: How to

One more question about the logout!

I have created a button logut with this JS code :

var f = document.forms[0];

top.location.href =“http://servername/databasename.nsf?logout”

But when logout and press the back button i dont have to login again!

Example!

If someone uses a pc from another person and leaves the person could press back and wouldn have to login?

How can i avoid this?

Thank you