Gossamer Forum
Home : Products : Gossamer Mail : Discussion :

2.0.2 - Required Password Issue

Quote Reply
2.0.2 - Required Password Issue
Hi,

I have turned off the requirement for a password to be entered when a user registers. To do this I also had to remove the REGEX for the email, or it would still check for it and report an error if none was entered.

The problem I have now is that if a user does decide to enter an email address (which is optional), and it isn't in the correct format of an email address, it is still accepted.

Any idea how I can get around this one?

Cheers,
R.


Quote Reply
Re: 2.0.2 - Required Password Issue In reply to
If you want to do that, you can't just remove the regex. You need to make the regex so that it accepts an email OR blank.
changing the regex from:
^.+\@.+\..+$
to:
^(?:.+\@.+\..+)?$
should accomplish that.
The (...)? checks for 0 or 1 matches of the regex inside the () and the ?: makes it so that it doesn't capture/remember the contents of what it matches in the ().

Adrian
Quote Reply
Re: 2.0.2 - Required Password Issue In reply to
Solved!

Thanks again! Why is it always that as soon as you go live you find problems which should have been so obvious before...

Makes life interesting I suppose.

:)

R.

Quote Reply
Re: 2.0.2 - Required Password Issue In reply to
Hi Adrian,

^.+\@.+\..+$
to:
^(?:.+\@.+\..+)?$

What file should i look for, for this sniff code. i like the idea of blank password.


Quote Reply
Re: 2.0.2 - Required Password Issue In reply to
Hi,

I think Regan meant email address not password. Why would you want to allow a blank password?

Cheers,

Alex

--
Gossamer Threads Inc.