Link to home
Start Free TrialLog in
Avatar of jaggernat
jaggernat

asked on

$$Loginuserform

hi all,

I am developing a login for website using $$Loginuserform. When the user enters a username and password , i want a process to run in the back ground and check if the username and password exist. If it does exist, take the user to their user profile...

Was curious to know how to do this?

Any help greatly appreciated,
Jay
Avatar of madheeswar
madheeswar
Flag of Singapore image

copy login form from domcfg.ntf

and in the $$return field place the redirect URL to person's document
Setup the customized login form.  The customization of the $$Return field is not something I would suggest, because this means you will always to to the user profile, for every appl. on your server.

Other possibilities include
- create an agent to open the correct profile document.  Call the agent using http://server/db.nsf/myAgent?Openagent&login  .  The user will be prompted to login, the agent executes under the correct user, and can redirect to the userprofile (or not)
- create a form , that retrieves the data of the correct user profile using @dblookups.  Also use the &login notation, to let your user login.
- ...

cheers,

Tom
Avatar of Zvonko
Tom already mention it: it is a bad idea to change the logon behaviour for ALL user logins.

I understood your question like this:
1.) You have an application databas: Staff.nsf
2.) That database has a Form or a Page: Employment
3.) On that Form you have a link "Existing User: [LOG IN]"
4.) Clicking on that link or button or image should accept userid and password and open Users Profile Document.

Are those assumptions correct?

Avatar of jaggernat
jaggernat

ASKER

yes , perfect..
Then the link in the "Existing user: log in" button should point to
 http://server/db.nsf/myAgent?Openagent&login

The agent should have code like this:

dim s as new notessession
dim db as notesdatabase
dim profiledoc as notesdocument
set db = s.currentdatabase
'Set notesDocument = notesDatabase.GetProfileDocument( profilename$ [, uniqueKey$ ] )
set profiledoc = db.getprofiledocument( "TheProfileName", s.effectiveusername )
' profile will be created if it doesn't exist
print "[/" + db.filepath + "/_/"+profiledoc.universalid +"?Editdocument]"




The agent should have the "Run as webuser" property enabled for this to work.
Tom, why Agent?
Well, because it's a profile document (I assume it's an actual profile document)

Opening a form is of course also possible ...
When someone say Profile document it does not mean always the Profile documents hidden from views. It can be any sort of Configuration documents.

My intention was to open a Page at LOGIN click and decide in that Page where to redirect the user (after he correctly logged in). For example if a Profile Document does not exist for that user, then we can offer a Form to create a new Profile Document. If Profile is found, then simply open his personal Profile document.

Basicaly does the user never see the Page which contains the decision formulas for logged in users.

The loging can be a Session login or a browser BasicAuthentication login, it does not matter.

yeaa  thats a good idea zvonko...but  bozzie's solution sounds good too.


any idea ,,how we do the login authentication ??

thanks,
J

The login authentication is done by Domino. You have not to add anything to the login process.
When the user clicks on your LOGIN link, then he gets redirected to a Form with the ?openForm&login parameter. This parameter ensures that the user is logged in.
Anyway, if he was already logged in or he needs to log in, you have nothing to do with the login process.
The only thing you can trust is when the user reaches your Form that he is already logged in.
In that form you can run a formula and lookup its Profile document based on his @UserName. If the document is NOT found in that database where you manage the user Profiles, then you offer to the user a Form for creating a new Profile document.
If the Profile document is found for that user name, then simply do forward the user to his Profile document.
Basicaly does the user never see the document with the lookup and decission formula.

The Form can also be a Page because no user input is required in that decission formula.

If taht process is OK for you, then I can make the neccessary @Formula for you.

this is what i did exactly:

on the login.jpg ,i created a hotspot and pointed it to $$Loginuserfom (from domcfg.nsf).

now ,,once user logs in where should he go ..

thanks,
J
No no no.

The $$LoginUserForm is for ALL user authentication. That is wrong and dangerous approach.

so where do i point the login.jpg to?  once the user clicks login.jpg where should it go and what should it do?


thanks,
J
ASKER CERTIFIED SOLUTION
Avatar of Zvonko
Zvonko
Flag of North Macedonia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If you create a user.id for me and send it to the address in my EE profile, then I can support you directly in your database.
i can understand what you are saying..

lets break this down into chunks...

how do i proceed  with writing an Agent which lookups your server's names.nsf for such a UserName, and if not already present, then create a Person document for that user, encrypt his InternetPassword in his Person document??

thanks,
J
Is it possible for you to allow me to access your Server?
no zvonko...i am just a developer working on the client machine...i dont have access to server except for my login and password...

J
Ok, send me your email address and I can send you an example.
Or do you prefer doing it here on EE?
email is fine          :        jaggernat@yahoo.com

Here the detail answer:
The image hotspot link contained this URL: SelectUser?OpenPage&login

The page SelectUser contained only this one ComputedText formula:
"[<script>window.location='/"+@ReplaceSubstring(@Subset(@DbName;-1);"\\";"/")+"/UserProfiles/"+@ProperCase(@Name([CN];@UserName))+"?EditDocument'</script>]"

Of course has the View "UserProfiles" to be sorted by first column where the UserNames were contained in @ProperCase