Skip to content

Commit

Permalink
Fix missing variables. Fix conditions checks
Browse files Browse the repository at this point in the history
  • Loading branch information
carlitorweb committed May 7, 2018
1 parent 02d71e1 commit 8afdb43
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions administrator/components/com_admin/models/profile.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,13 @@ public function save($data)

if (!empty(array_filter($listMailDomainTLD)))
{
if ($optionRestriction === 2 && !empty(array_intersect($needles, $blackListMailDomain)))
if ($optionRestriction === '2' && !empty(array_intersect($needles, $listMailDomainTLD)))
{
$this->setError(JText::sprintf('COM_USERS_MSG_USER_MAIL_DOMAIN_NOT_ALLOWED', $userMailDomain[1]));

return false;
}
elseif ($optionRestriction === 1 && empty(array_intersect($needles, $whiteListMailDomain)))
elseif ($optionRestriction === '1' && empty(array_intersect($needles, $listMailDomainTLD)))
{
$this->setError(JText::sprintf('COM_USERS_MSG_USER_MAIL_DOMAIN_NOT_ALLOWED', $userMailDomain[1]));

Expand Down
4 changes: 2 additions & 2 deletions administrator/components/com_users/models/user.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,13 +232,13 @@ public function save($data)

if (!empty(array_filter($listMailDomainTLD)))
{
if ($optionRestriction === 2 && !empty(array_intersect($needles, $blackListMailDomain)))
if ($optionRestriction === '2' && !empty(array_intersect($needles, $listMailDomainTLD)))
{
$this->setError(JText::sprintf('COM_USERS_REGISTRATION_USER_MAIL_DOMAIN_NOT_ALLOWED_MESSAGE', $userMailDomain[1]));

return false;
}
elseif ($optionRestriction === 1 && empty(array_intersect($needles, $whiteListMailDomain)))
elseif ($optionRestriction === '1' && empty(array_intersect($needles, $listMailDomainTLD)))
{
$this->setError(JText::sprintf('COM_USERS_REGISTRATION_USER_MAIL_DOMAIN_NOT_ALLOWED_MESSAGE', $userMailDomain[1]));

Expand Down

0 comments on commit 8afdb43

Please sign in to comment.