Thanks Nicolas
That is very clear, I'll take a look :)
cheers
Edd
Nicolas Lafaury wrote:
Hi again
I am trying to be clearest
On a JahiaPage I have a input Box that allow a user to enter an email.
/<form method="post"//
a//ction="<%=((PageBean)pageNewsletter).getJahiaPage().getURL(jParams)%>">/
/<input name="textfield" type="text" value="Votre email"/>/
/<input type="image" src="<%=theURL%>/images/cg_21/bt_ok.gif"
style="width:21px;height:20px;padding : 2px;position:relative; top:
8px;border:0;" alt="ok"/>/
/</form>///
This html code send the email to the page.
The page check if the email has a correct syntax.
To do that I use java regular expression.
<%String/ textfield/ =request.getParameter("/textfield/ ");%>
/chaineExprMail="[EMAIL PROTECTED]";///
/if (java.util.regex.Pattern.matches(chaineExprMail,textfield))
{ /
/ // /
Then you send an email by using the API java with a link to the
validating page.
/<a href="<%=//jData.params().getSiteURL(jData.page().getID(),
false,false)//%>?//validateEmail=//<%=texfield%>//">//validate</a>///
The guy click on the link and send to the page the parameter. Then you
catch this parameter.
<%String/ validateEmail/ =request.getParameter("/validateEmail/");%>
And you register the user in Jahia y using API.
_JahiaUserManagerService_
<http://www.jahia.org/javadoc-dev/org/jahia/services/usermanager/JahiaUserManagerService.html>
I do something like that but I use a database to store the email which
is waiting validation. Then when the page receive a parameter I check
if the user is in database.
Another point is that I encode the parameter to not allow a person to
add lot of user by just writing an email in the URL.
I hope this will help you, do not hesitate to contact me today if you
want more explanations, because I am going in holiday tomorrow.
Nicolas
For exemple : _www.mySite.fr/jahia/Jahia/pid/XXX_
<http://www.mySite.fr/jahia/Jahia/pid/XXX>
Use the standard API Jahia
-----Message d'origine-----
De : Edd Dawson [mailto:[EMAIL PROTECTED]
Envoyé : vendredi 19 août 2005 12:32
À : [email protected]
Objet : Re: Confirming users email address when they register
Hi Nicolas
What you explain is exactly what I wish to acheive.
How complex was it to do? Any clues on how you acheived it would be
really good :)
thanks
Edd
Nicolas Lafaury wrote:
Hello
I don't understand exactly what you want to do?
You mean in administration mode or the user register to the site with
the HTML code then you check its email?
I have createn a template to do simimlar things.
On a page the user enter his email.
I check by regex if the syntax of the email is correct =>
chaineExprMail="[EMAIL PROTECTED]";
then I send an email to the customer with a link to a special page of
my site.
Ex: myJahiasite/.../pid/...?mail=monemailvalidating
When he click on this link, I register the User in Jahia.
I hope this will help you.
Nicolas
-----Message d'origine-----
De : Edd Dawson [mailto:[EMAIL PROTECTED]
Envoyé : vendredi 19 août 2005 12:05
À : [email protected]
Objet : Confirming users email address when they register
Hi Everyone
Has anyone any experience of validating users email addresses who
register with a jahia site before activating their account..
I am thinking by the usual method of emailing them a url to activate
meaning their account is locked until such a link is visited.
Any idea on complexity of acheiving this with Jahia would be appreciated.
cheers
Edd