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
271536b0
authored
2023-03-02 11:01:43 -0500
by
Jeff Balicki
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
ssss
Signed-off-by: Jeff <jeff@gotenzing.com>
1 parent
d285fbac
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
23 deletions
wp-content/themes/understrap-child/functions.php
wp-content/themes/understrap-child/functions.php
View file @
271536b
...
...
@@ -150,14 +150,12 @@ add_action( 'um_submit_form_errors_hook__registration', 'um_validate_email_domai
function
is_valid_email_domain
(
$login
,
$email
,
$errors
){
$
vali
d_email_domains
=
array
(
"gotenzing.com"
,
"ekccu.com"
,
"stellervista.com"
);
// allowed domains
$
allowe
d_email_domains
=
array
(
"gotenzing.com"
,
"ekccu.com"
,
"stellervista.com"
);
// allowed domains
$valid
=
false
;
// sets default validation to false
foreach
(
$valid_email_domains
as
$d
){
$d_length
=
strlen
(
$d
);
$current_email_domain
=
strtolower
(
substr
(
$email
,
-
(
$d_length
),
$d_length
));
if
(
$current_email_domain
==
strtolower
(
$d
)
){
if
(
isset
(
$email
)
&&
is_email
(
$email
)
)
{
$email_domain
=
array_pop
(
explode
(
'@'
,
trim
(
$email
)
)
);
if
(
in_array
(
$email_domain
,
$allowed_email_domains
)
)
{
$valid
=
true
;
break
;
}
}
// Return error message for invalid domains
...
...
@@ -170,20 +168,3 @@ function is_valid_email_domain($login, $email, $errors ){
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