-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Email Domain Restrictions #20383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Email Domain Restrictions #20383
Conversation
|
On the backend, text not translated |
|
Added strings. Thanks. |
brianteeman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Surely we have a string for this already
|
For the Rule, how about making it a radio type with the red/green switcher instead of a list? |
| { | ||
| if ($domain->rule == 0) | ||
| { | ||
| $allowed = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put a break here since there is no point in processing additional rules if any.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, this would prevent other rules from overwriting the first matched rule.
| COM_USERS_CONFIG_FIELD_CAPTCHA_LABEL="Captcha" | ||
| COM_USERS_CONFIG_FIELD_CHANGEUSERNAME_DESC="Allow users to change their Username when editing their profile." | ||
| COM_USERS_CONFIG_FIELD_CHANGEUSERNAME_LABEL="Change Username" | ||
| COM_USERS_CONFIG_FIELD_DOMAIN_NAME_DESC="Enter a domain name. Wildcards (*) are supported. For example:<br /><b>*</b> allows or disallows all domains;<br /><b>*.com</b> allows or disallows all .com domains;<br /><b>*.joomla.org</b> allows or disallows all joomla.org subdomains." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use strong instead of b
| JGLOBAL_EDIT_ITEM="Edit item" | ||
| JGLOBAL_EDIT_PREFERENCES="Edit Preferences" | ||
| JGLOBAL_EMAIL="Email" | ||
| JGLOBAL_EMAIL_DOMAIN_NOT_ALLOWED="The email domain <b>%s</b> is not allowed. Please enter another email address." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment
language/en-GB/en-GB.ini
Outdated
| JGLOBAL_EDIT="Edit" | ||
| JGLOBAL_EDIT_TITLE="Edit article" | ||
| JGLOBAL_EMAIL="Email" | ||
| JGLOBAL_EMAIL_DOMAIN_NOT_ALLOWED="The email domain <b>%s</b> is not allowed. Please enter another email address." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment
|
@brianteeman previously this was used:
Although we could update it to read "The email address you entered is already in use, not allowed or invalid. Please enter another email address.", a change in this PR allows to output a different message based on which part of validation fails. This is more user friendly, IMO. |
|
All domains are allowed by default and rules are executed in order, starting at the top. To allow only specific domain, you must first block all other domains. So to allow only |
|
re-started travis |
|
Travis failure is correct. This needs new unit tests. |
That's why I've asked because I've tested both orderings and could not register with example.org. I tested also without captcha => same result. |
|
Tested also unsuccessfully without dot, just |
|
Yes, wildcards currently work on full segments only as per comments #20383 (comment). But this can be improved. Any suggestions welcome (especially for fixing tests). |
|
To clarify: I could not allow Joomla 3.8.11-dev nightly of yesterday. |
|
@ReLater |
Thank you. Maybe I have to install a new staging. I'm using the Joomla upload/update feature for a longer time now with nightly update packages for 3.8.x. Or maybe a conflict with an installed 3rd extension. I will see. |
Forget this comment:
I've tried it also with other rules/domains than PHP 7.1 and 7.2
|
|
After 2 coffees => "Stupid me!" For allowed email |
|
I have tested this item ✅ successfully on c7a8282 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/20383. |
|
I have tested this item ✅ successfully on c7a8282 Applied the patch and checked various rulesets and rule sorting to check if sorting has the expected behavior. Works for me This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/20383. |
|
Ready to Commit after 4 successful tests. |
|
But that's the expected behavior... if the last action is "disallow all" than all is disallowed |
This comment was marked as abuse.
This comment was marked as abuse.
|
Fixed via 1ddb06d |
|
Try deleting the row. |
|
nothing happend when I click on - |










Pull Request for Issue # .
Summary of Changes
This PR adds user email domain restrictions. This is an alternative to #20164 with more flexibility added.
Testing Instructions
Apply patch.
Go to Users configuration.
In Email Domain Options add some rules.
a) Try to register with disallowed email.
b) Try to register with an email that isn't disallowed.
c) Try to change email in user profile to a disallowed email.
d) Try to change email in user profile to an allowed email.
e) Remove all rules and try to register again.
Expected result
a) Registration fails.
b) Registration successful.
c) Changes not saved.
d) Changes saved.
e) Registration successful.
Documentation Changes Required
Document the new option.
Document validDomains attribute usage in EmailRule.
Document message property in FormRule.