I wish to create a basic website which I am fine doing. I want this site to allow either:
-
A website administrator to set up an account for people so that they can then login.
-
Allow new users to create their own account.
The kind of information people will be allowed to post is business information.
I do not want this to be done via a notes logon which will require a new ID for each user. I need some method of validation for each user but I can’t think how.
I may also want it to be the case that new users have to pay for an account - how would this be done and integrated with some payment method e.g. PayPal?
Has anyone any ideas on how this can be done. If Javascript needs to be used then please describe this in some detail as my Javascripting is poor.
Non notes IDs and validation has been a bane of mine for years and I’ve not come up with a way of resolving this problem. Therefore help will be greatly appreciated.
Thanks
Subject: non-Notes ID logins
I have worked with apps that require non-Notes ID logins. It generally involves the use of “user profile” documents being kept in the database and each record containing the login name and password for a user. When the application is accessed via the browser a user is given a custom login screen and when submitted the backend process attempts to find a user profile document that matches the name and password. If a match is found then certain info about the user is placed into either cookies (for a traditional Notes web app) or scope variables (for an XPage app) and the user is then allowed to access the application. Pages in the application then always check to make sure that the necessary cookies or scope variables are appropriately set otherwise a user is redirected to the login screen.
Subject: non notes ID logons
Thanks. Using cookies is something I’ve looked at before but could never get to work. Storing cookies and retrieving them is something I’ve failed spectacularly with. I’m also now looking in xpages but this represents a massive learning curve.
Have you any demo databases that use cookies for this job or at least some very explicit instructions?
Subject: Cookies example
Your login page would obviously run a WQS agent when submitted. Assuming the agent finds a matching user profile for the user name and password that was submitted you would then set a cookie and open a post-login page for the user by using something like this at the end of the agent process:
Print |Set-Cookie:UserID=JohnDoe|
Print |Location: /MyDB.nsf/MyForm?openform|
Then in your other web pages check to make sure that the cookie has an appropriate value or else redirect the user to the login page. You can use something like the following, placing the cookie test in the onLoad event and the getCookie() function in the JS Header.
var cookie = getCookie(“UserID”);
if(cookie==null){
window.location.href="Login?OpenForm";
}
function getCookie(cookieName)
{
if(document.cookie)
{
var index = document.cookie.indexOf(cookieName);
if (index != -1)
{
var countbegin = (document.cookie.indexOf(cookieName+“=”, index) + 1);
var countend = document.cookie.indexOf(“;”, index);
if (countend == -1)
{
countend = document.cookie.length;
}
return document.cookie.substring(countbegin + cookieName.length, countend);
}
}
return null;
}