firebrandhq / domain-specific-memberprofiles
Extends the Member Profile page to limit who can register based on their email address
Installs: 183
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 3
Open Issues: 0
Type:silverstripe-module
Requires
This package is auto-updated.
Last update: 2024-10-14 09:44:46 UTC
README
This module is a simple extension to the SilverStripe Member Profile Pages Module. It adds the ability to limit user registrations to specific domains.
Example use case
Let's say you only want employees of a specific organisation organisation to be able to create a user profile, you can limit registration to users with a @example.com email address. Or let's say you only want New Zealand students or their teachers to have an account, you can restrict registrations to users with a *.school.nz account.
You can define a single allowed domain or many. You can also explictely disallow domains.
Requirements
This module is not a fork of the Member Profile Pages Module. It's an extension.
Installation Instructions
composer require firebrandhq/domain-specific-memberprofiles
Make sure to run a dev/build
after installing the module.
Usage Overview
- Create your profile page like you normally would.
- Under the Profile > Fields tab, edit the Email profile field. At the bottom of the page, under the Vlaidation header, there should now be a Domain Validation subsection.
- In the apropriate textarea field, provide a list of allowed and/or disallowed domains.
- If you leave a field blank, it will be ignored.
- If you leave both fields blank, there's not going to be any domain validation on the email.
- You can use wildcards to whitelist or blacklist subdomains. (e.g.:
*.example.com
)
- If you want the error message to include the list of allowed or disallowed domains, check Show Domains On Error.
- Save your email profile field.
Although not strictly required, you probably want to enable Email Validation for you profile page otherwise users can pretend to have access to a valid email.