Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Jeremy Groot
/
stellervista-Intranet
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
731eccd9
authored
2023-03-01 16:57:17 -0500
by
Jeff Balicki
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
email domain
Signed-off-by: Jeff <jeff@gotenzing.com>
1 parent
4c19c8b0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
wp-content/themes/understrap-child/functions.php
wp-content/themes/understrap-child/functions.php
View file @
731eccd
...
...
@@ -168,3 +168,22 @@ function is_valid_email_domain($login, $email, $errors ){
}
add_action
(
'register_post'
,
'is_valid_email_domain'
,
10
,
3
);
add_action
(
'um_submit_form_errors_hook__registration'
,
'um_register_email_provider_restrict'
,
99
);
function
um_register_email_provider_restrict
(
$args
)
{
// List the email providers you want to allow
$allowed_domains
=
array
(
"gotenzing.com"
,
"ekccu.com"
,
"stellervista.com"
);
// For each domain provider check if the domain provider is allowed for registration.
foreach
(
$allowed_domains
as
$domain
)
{
if
(
isset
(
$args
[
'user_email'
]
)
)
{
if
(
!
strstr
(
$args
[
'user_email'
],
$domain
)
)
{
$message
=
sprintf
(
__
(
'Only use the email domain %1$s, %2$s for registration'
,
'ultimate-member'
),
$allowed_domains
[
0
],
$allowed_domains
[
1
]
);
UM
()
->
form
()
->
add_error
(
'user_email'
,
$message
);
}
}
}
}
\ No newline at end of file
...
...
Please
register
or
sign in
to post a comment