Limit valid email addresses

Asked by Alan Robertson

I was wondering if someone was able to point me to where in the code I could amend the email address verification to force users to only sign up using addresses from a particular domain. This could either be by changing the validation code or by only asking them for the portion of their email address before the @ sign and fixed the bit after it.

Thanks in advance!

Question information

Language:
English Edit question
Status:
Solved
For:
AuthPuppy Edit question
Assignee:
No assignee Edit question
Solved by:
gbastien
Solved:
Last query:
Last reply:
Revision history for this message
Best gbastien (gbastien02) said :
#1

You will want to add this to the apAuthLocalUserPlugin,

You would need to add a validator class in the lib/validator subdirectory, you can copy paste from the other validators to get an idea how it works.

Then, you would merge this validator to the post-validator in the lib/form/doctrine/apAuthLocalUserSignupForm.php like the other post-validator that are there.

Revision history for this message
Alan Robertson (ninewellsdoctorsmess) said :
#2

Just to update - I changed the email validator in the symfony lib/validator plugin and that seemed to work straight away - now only email addresses with the desired suffix are now recognised as valid.

Re. the merging into the post-validator bit - is that necessary since it seems to be working?