Validates an email and checks the responding user enabled
@return boolean|null
182864
protected function validateEmailExistsUser()
    {
        $field = 'email';
        $value = $this->getSubmitted($field);

        if ($this->isError($field) || !isset($value)) {
            return null;
        }

        $user = $this->user->getByEmail($value);

        if (empty($user['status'])) {
            $this->setErrorUnavailable($field, $this->translation->text('E-mail'));
            return false;
        }

        $this->setSubmitted($field, $user);
        return true;
    }
1142551
public function isValid()
    {
        if (!filter_var($this->email, FILTER_VALIDATE_EMAIL)) {
            return false;
        }

        if (empty($this->userAgent)) {
            return false;
        }

        if (empty($this->series)) {
            return false;
        }

        if (empty($this->token)) {
            return false;
        }

        return true;
    }
1162448
public function validate()
    {
        if (!$this->validationHash) {
            return false;
        }
        $db = Database::connection();
        $row = $db->GetRow("select * from MailValidationHashes where mHash = ? order by mDateGenerated desc limit 1", $this->validationHash);
        if ($row['mvhID'] > 0) {
            // Can't do this even though it's a good idea
            //if ($row['email'] != $this->sender) {
            //	return false;
            //} else {
                return $row['mDateRedeemed'] == 0;
            //}
        }
    }
1054528
public function sendEmail()
    {
        $user = User::findOne([
            'email' => $this->email,
            'status' => User::STATUS_INACTIVE
        ]);

        if ($user === null) {
            return false;
        }

        return Yii::$app
            ->mailer
            ->compose(
                ['html' => 'emailVerify-html', 'text' => 'emailVerify-text'],
                ['user' => $user]
            )
            ->setFrom([Yii::$app->params['supportEmail'] => Yii::$app->name . ' robot'])
            ->setTo($this->email)
            ->setSubject('Account registration at ' . Yii::$app->name)
            ->send();
    }
101522
public function ValidateUserInput()
    {
        $bValid = parent::ValidateUserInput();

        $bValid = ($bValid && $this->CheckIncomingHash(TGlobal::instance()->GetUserData()));

        return $bValid;
    }
720463
private function hasEmail()
    {
        $email = $this->_scopeConfig->getValue('payment/pagseguro/email');

        // check for a e-mail
        if (!isset($email))
            return false;

        // check is the e-mail is valid
        if ($this->isValidEmail($email))
            return true;
        return false;
    }
1197601
protected function validateUser()
    {
        $id = $this->getUpdatingId();

        if ($id === false) {
            return null;
        }

        $data = $this->user->get($id);

        if (empty($data)) {
            $this->setErrorUnavailable('update', $this->translation->text('User'));
            return false;
        }

        $this->setUpdating($data);
        return true;
    }
50331
protected function validateAddress()
    {
        $id = $this->getUpdatingId();

        if ($id === false) {
            return null;
        }

        $data = $this->address->get($id);

        if (empty($data)) {
            $this->setErrorUnavailable('update', $this->translation->text('Address'));
            return false;
        }

        $this->setUpdating($data);
        return true;
    }
1356513
protected function validateRoleUser()
    {
        $field = 'role_id';
        $value = $this->getSubmitted($field);

        if (empty($value)) {
            return null;
        }

        $label = $this->translation->text('Role');

        if (!is_numeric($value)) {
            $this->setErrorNumeric($field, $label);
            return false;
        }

        $role = $this->role->get($value);

        if (empty($role)) {
            $this->setErrorUnavailable($field, $label);
            return false;
        }

        return true;
    }
1317781
protected function validatePasswordUser()
    {
        $field = 'password';

        if ($this->isExcluded($field)) {
            return null;
        }

        $value = $this->getSubmitted($field);

        if ($this->isUpdating() && (!isset($value) || $value === '')) {
            return null;
        }

        if (empty($value)) {
            $this->setErrorRequired($field, $this->translation->text('Password'));
            return false;
        }

        return true;
    }
817176
protected function validateEditUser()
    {
        $this->setSubmitted('user');
        $this->setSubmittedBool('status');
        $this->setSubmitted('update', $this->data_user);

        $this->validateComponent('user', array('admin' => $this->access('user_edit')));

        return !$this->hasErrors();
    }
765313
public function isValid()
    {
        $status = $this->response->body['result'];
        $reason = $this->response->body['reason'];

        switch($status):
            case 'valid':
                return [true, $this->getReason($reason)];
                break;
            case 'invalid':
            case 'unknown':
                return [false, $this->getReason($reason)];
                break;
            default:
                throw new InvalidArgumentException('Invalid Response');
        endSwitch;
    }

    /**
     * Get the reason whether the email is valid, invalid or unknown
     * @param  string $reason
     * @return string
     */
    public function getReason($reason)
    {
        return $this->serverResponses[$reason];
    }

    /**
     * Returns true or false if the email address uses a disposable domain
     * @return boolean
     */
    public function isDisposable()
    {
        return $this->response->body['disposable'];
    }

    /**
     * Returns true or false if the API request was successful
     * @return boolean
     */
    public function apiRequestStatus()
    {
        return $this->response->body['success'];
    }

    /**
     * Get the domain of the provided email address
     * @return string
     */
    public function getDomainName()
    {
        return $this->response->body['domain'];
    }

    /**
     * Get the local part of an email address
     * Example: prosperotemuyiwa@gmail.com returns prosperotemuyiwa
     * @return string
     */
    public function getUser()
    {
        return $this->response->body['user'];
    }

    /**
     * Gets a normalized version of the email address
     * Example: ProsperOtemuyiwa@gmail.com returns prosperotemuyiwa@gmail.com
     * @return string
     */
    public function getEmailAddress()
    {
        return $this->response->body['email'];
    }

    /**
     * Returns true if the domain appears to accept all emails delivered to that domain
     * @return boolean
     */
    public function acceptEmailsDeliveredToDomain()
    {
        return $this->response->body['accept_all'];
    }

    /**
     * Returns true or false if email address is a role address
     * Example manager@example.com , ceo@example.com will return true
     * @return boolean
     */
    public function isRole()
    {
        return $this->response->body['role'];
    }
}
482627
private function checkMail()
    {
        $this->configureMail();

        try {
            $this->sendMail();

            $result = $this->makeHealthyResult();
        } catch (\Exception $exception) {
            report($exception);

            $result = $this->makeResultFromException($exception);
        }

        $this->restoreMailConfiguration();

        return $result;
    }
372330
protected function validateEmailReview()
    {
        $field = 'email';
        $value = $this->getSubmitted($field);

        if (!isset($value)) {
            $this->unsetSubmitted($field);
            return null;
        }

        $label = $this->translation->text('Email');

        if (empty($value)) {
            $this->setErrorRequired($field, $label);
            return false;
        }

        $user = $this->user->getByEmail($value);

        if (empty($user['user_id'])) {
            $this->setErrorUnavailable($field, $label);
            return false;
        }

        $this->setSubmitted('user_id', $user['user_id']);
        return true;
    }
136561
public function ValidateUserInput()
    {
        $bIsValid = parent::ValidateUserInput();

        if ($bIsValid) {
            $oMsgManager = TCMSMessageManager::GetInstance();

            $aDefaultVals = $this->GetDefaultUserPaymentData();

            foreach (array_keys($aDefaultVals) as $sField) {
                if (!array_key_exists($sField, $this->aPaymentUserData) || empty($this->aPaymentUserData[$sField])) {
                    $oMsgManager->AddMessage(self::MSG_MANAGER_NAME.'-'.$sField, 'ERROR-USER-REQUIRED-FIELD-MISSING');
                    $bIsValid = false;
                }
            }
        }

        return $bIsValid;
    }
550109
protected function validateEmailAsPdfFields()
    {
        // Check for valid email address if no token syntax is used.
        $regexpEmail = '/^[^@<>,; "\']+@([^.@ ,;]+\.)+[^.@ ,;]+$/';
        if (!empty($this->submittedValues['emailTo']) && strpos($this->submittedValues['emailTo'], '[') === false && !preg_match($regexpEmail, $this->submittedValues['emailTo'])) {
            $this->errorMessages['emailTo'] = $this->t('message_validate_email_5');
        }

        // Check for valid email addresses if no token syntax is used.
        $regexpMultiEmail = '/^[^@<>,; "\']+@([^.@ ,;]+\.)+[^.@ ,;]+([,;][^@<>,; "\']+@([^.@ ,;]+\.)+[^.@ ,;]+)*$/';
        if (!empty($this->submittedValues['emailBcc']) && strpos($this->submittedValues['emailBcc'], '[') === false && !preg_match($regexpMultiEmail, $this->submittedValues['emailBcc'])) {
            $this->errorMessages['emailBcc'] = $this->t('message_validate_email_3');
        }

        // Check for valid email address if no token syntax is used.
        if (!empty($this->submittedValues['emailFrom']) && strpos($this->submittedValues['emailFrom'], '[') === false && !preg_match($regexpEmail, $this->submittedValues['emailFrom'])) {
            $this->errorMessages['emailFrom'] = $this->t('message_validate_email_4');
        }
    }
715091
public function checkEmailAction()
    {
        $session = $this->container->get('session');
        $email = $session->get(static::SESSION_EMAIL);
        $session->remove(static::SESSION_EMAIL);

        if (empty($email)) {
            // the user does not come from the sendEmail action
            return new RedirectResponse($this->container->get('router')->generate('sonata_user_resetting_request'));
        }

        $template = $this->container->get('bruery_core.template_loader')->getTemplates();
        return $this->container->get('templating')->renderResponse($template['bruery_user.template.resetting.check_email'], array(
            'email' => $email,
        ));
    }