SilverStripe Domain Specific Member Profile Pages Module
This module is a simple extension to the SilverStripe Member Profile Pages Module. It adds the ability to limit user
registrations to specific domains., (*1)
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., (*2)
You can define a single allowed domain or many. You can also explictely disallow domains., (*3)
Requirements
This module is not a fork of the Member Profile Pages Module. It's an extension., (*4)
Installation Instructions
composer require firebrandhq/domain-specific-memberprofiles
Make sure to run a dev/build
after installing the module., (*5)
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., (*6)