Gossamer Forum
Home : Products : Gossamer Mail : Discussion :

2.0.2 Requiring Pass Q & A

Quote Reply
2.0.2 Requiring Pass Q & A
Hi,

I have entered the following into the Join.pm script to require the user enter more than 2 letters for their username.

if ($cgi->{username} !~ /[a-zA-Z0-9]{2}/) {
$GMail::Template::TAGS{bad_username} = 1;
return $self->error('JOINERR_LOGIN_FMT', 'WARN', $cgi->{username});
}

My question is, what do I need add to this file to require that the user enter a password question and answer?

Cheers,
Regan.


Quote Reply
Re: 2.0.2 Requiring Pass Q & A In reply to
$cgi->{username} !~ /[a-zA-Z0-9]{2}/
shouldn't that regex be /^[a-zA-Z0-9]{2,}$/ ?
With the first one, any username with consecutive [a-zA-Z0-9] will pass (eg. abc!#$!%$), the second one fixes that :)

With requiring a user to enter a password question and answer, I can't really answer since I don't know too much about the admin side/internals of gmail...
You can try adding a line like:
if (!$cgi->{password_question}) { # or whatever the input name is :)
# $GMail::Template::TAGS{bad_...?}; don't know what this is
return $self->error('JOINERR_NO_PASS_QUESTION', 'WARN'); # create a new entry in the language.txt
}
if (!$cgi->{password_answer}) {
# $GMail::Template::TAGS{bad_...?}; don't know what this is
return $self->error('JOINERR_NO_PASS_ANSWER', 'WARN');}

someone fill in the blanks :)

Adrian
Quote Reply
Re: 2.0.2 Requiring Pass Q & A In reply to
Thanks Adrian,

I'll give the regex a go. So, if I wanted the username to have more than 2, but less than 20 characters my regex would be...

/^[a-zA-Z0-9]{2,20}$/

?

Cheers,
REgan.


Quote Reply
Re: 2.0.2 Requiring Pass Q & A In reply to
I wonder if Scott or Alex could tell us what the...

------
# $GMail::Template::TAGS{bad_...?}; don't know what this is
------

...part is. I want to paste this code straight into a live site so if they could lend some help out with exactly what to enter it would be appreciated.

Cheers,
Regan.


Quote Reply
Re: 2.0.2 Requiring Pass Q & A In reply to
Hi Again,

I have just found another bug relating to the Reminder Question and Answer feature, and am VERY keen to get the exact code or how-to that will make these fields required.

If anyone can help me out - adrian, alex, scott, anyone - it would be much appreciated!!

Chees,
Regan.

Quote Reply
Re: 2.0.2 Requiring Pass Q & A In reply to
Yep... Another thing, you may want to allow underscores in their username, in which you could use /^\w{2,22}$/ for the regex.

Adrian
Quote Reply
Re: 2.0.2 Requiring Pass Q & A In reply to
Hello!

If you want to have those fields filled out then change the property of the field and set it to Not NULL. Hence they become required fields. Then resync the def files. Therefore the user is forced to fill them out.

Rajani
Quote Reply
Re: 2.0.2 Requiring Pass Q & A In reply to
Thanks Rajani,

I have made them NOT NULL, but now how do I reset the .def files?

I just went in and manually gave them the not null value, but if there's a way to do it in the admin area I'd be interested to know.

CHeers,
Regan.


Quote Reply
Re: 2.0.2 Requiring Pass Q & A In reply to
Hello!

I do not think there is a direct way from the admin. I did not use it, but I can suggest to use PhpMyAdmin or MySQL Man.

If you know that you have done correctly that the fields do not remain empty than you can re-sync the def files.

Go to Setup from Admin and the SQL Server >>> then Click on

Load table info from an existing set of tables (or resync the def files if you have changed your defs manually).

This will then be re-sync your def files bringing in tune the NOT NULL Field to your installation.

Actually I have the same problem and I think I should have done this earlier!



Rajani