Find a user by unverified email address.

@param string $email The email to check for.
@return User mixed
549416
public function findNotVerified($email)
    {
        return $this->find()
            ->where([
                $this->aliasField('email') => $email,
                $this->aliasField('verified') => 0
            ])
            ->first();
    }
144911
public function withVerifiedEmail($email)
    {
        $request = clone $this;
        $request->email = $email instanceof Email ? $email : new Email($email);
        $request->emailIsVerified = true;

        return $request;
    }
316246
public static function addressValidate($email)
    {
        // $this->debug->groupCollapsed(__CLASS__.'->'.__FUNCTION__);
        $return = false;
        $regex = '/^'
            .'[a-z0-9_]+([_\.-][a-z0-9]+)*'     // user
            .'@'
            .'([a-z0-9]+([\.-][a-z0-9]+)*)+'    // domain
            .'(\.[a-z]{2,})'                    // sld, tld
            .'$/i';
        $email = trim($email);
        if (preg_match($regex, $email, $matches)) {
            // $this->debug->log('properly formatted');
            $hostname   = strtolower($matches[2].$matches[4]);
            $ipaddress  = gethostbyname($hostname);     // A record
            // $this->debug->log('hostname', $hostname);
            // $this->debug->log('ipaddress', $ipaddress);
            $return = $email;
            if ($ipaddress != $hostname) {
                // $this->debug->log('A record', $ipaddress);
            } elseif ($mxrecord = getmxrr($hostname, $mxhosts)) {
                // $this->debug->log('getmxrr('.$hostname.')', $mxrecord, $mxhosts);
            } elseif (strpos($_SERVER['SERVER_NAME'], $hostname)) {
                // $this->debug->log('email domain matches server domain');
            } else {
                // $this->debug->log('warn', 'unable to verify');
                $return = false;
            }
        }
        // $this->debug->groupEnd();
        return $return;
    }
410709
public function findUserOrCreateByEmail($email)
    {
        $user = $this->getUserMapper()->findByEmail($email);
        if (empty($user)) {
            // Pas d'utilisateur playground : alors on en crée un
            $user = new UserEntity();
            $user->setEmail($email);
            $rand = \Zend\Math\Rand::getString(8);
            $bcrypt = new Bcrypt;
            $zfcUserOptions = $this->getServiceManager()->get('zfcuser_module_options');
            $bcrypt->setCost($zfcUserOptions->getPasswordCost());
            $pass = $bcrypt->create($rand);
            $user->setPassword($pass);
            $user = $this->getUserMapper()->insert($user);
        }

        return $user;
    }
932878
public static function validateEmail($email)
    {
        $email = trim($email);

        if (false === filter_var($email, FILTER_VALIDATE_EMAIL)) {
            throw new \InvalidArgumentException(sprintf('The Email "%s" is invalid.', $email));
        }

        return $email;
    }
1019836
public function findTokenByEmail($email)
    {
        $user = $this->users->where('email', $email)->first();

        if (! is_null($user)) {
            return $user->getActivationToken();
        }

        return null;
    }
1374654
public static function find_by_email($email)
	{
		if (empty($email))
		{
			return false;
		}

		$db = \App::get('db');
		$db->setQuery("SELECT username FROM `#__xprofiles` WHERE `email`=" . $db->quote($email));

		$result = $db->loadColumn();

		if (empty($result))
		{
			return false;
		}

		return $result;
	}
615712
public function getUID($email)
    {
        $query = "SELECT id FROM {$this->config->table_users} WHERE email = :email";
        $query_prepared = $this->dbh->prepare($query);
        $query_prepared->execute(['email' => $email]);

        if ($query_prepared->rowCount() == 0) {
            return false;
        }

        return $query_prepared->fetchColumn();
    }
484482
static function fetchByEmail( $email )
    {
        $cond = array( 'email' => $email );
        $return = eZPersistentObject::fetchObject( self::definition(), null, $cond );
        return $return;
    }
297009
private function getEmailObject($emails)
    {
        // Try to find an email address which is primary and verified.
        foreach ($emails as $email) {
            if ($email[ 'primary' ] && $email[ 'verified' ]) {
                return $email;
            }
        }

        // Try to find an email address which is primary.
        foreach ($emails as $email) {
            if ($email[ 'primary' ]) {
                return $email;
            }
        }

        return $emails[ 0 ];
    }
377645
protected function validateEmail($email) {
        $state['error'] = true;

        if (strlen($email) < (int)$this->config->verify_email_min_length ) {
            $state['message'] = $this->__lang("email_short", (int)$this->config->verify_email_min_length);

            return $state;
        } elseif (strlen($email) > (int)$this->config->verify_email_max_length ) {
            $state['message'] = $this->__lang("email_long", (int)$this->config->verify_email_max_length);

            return $state;
        } elseif (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
            $state['message'] = $this->__lang("email_invalid", $email);

            return $state;
        }
        
        if ((int)$this->config->verify_email_use_banlist && $this->isEmailBanned($email)) {
            $this->addAttempt();
            $state['message'] = $this->__lang("email_banned");

            return $state;
        }

        $state['error'] = false;

        return $state;
    }
42842
private function userFromEmail($email)
    {
        $parts = explode('@', $email);

        if (count($parts) == 2) {
            return strtolower($parts[0]);
        }

        return null;
    }
405487
public function email($email = null) {
		$this->out('Email:');
		while (empty($email) || !Validation::email($email)) {
			$email = $this->in('New email address (must have a valid form at least)');
		}

		/** @var \App\Model\Table\UsersTable $Users */
		$Users = TableRegistry::get(CLASS_USERS);
		$this->Users = $Users;
		if (!$this->Users->hasField('email')) {
			$this->abort(CLASS_USERS . ' table doesnt have an email field!');
		}

		$this->hr();
		$this->out('Resetting...');

		if (empty($this->params['dry-run'])) {
			$count = $this->Users->updateAll(['email' => $email . ''], ['email !=' => $email]);
		} else {
			$count = $this->Users->find('all', ['conditions' => [CLASS_USERS . '.email !=' => $email]])->count();
		}
		$this->out($count . ' emails resetted - DONE');
	}
305019
private function hostnameFromEmail($email)
    {
        $parts = explode('@', $email);

        if (count($parts) == 2) {
            return strtolower($parts[1]);
        }

        return null;
    }
1262287
private function emailToUsername($email = null)
    {
        if ($user = get_user_by('email', $email)) {
            if (isset($user->user_login)) {
                return $user->user_login;
            }
        }

        return null;
    }
737597
public function verifyEmailIdentity($email)
    {
        $this->_action = 'VerifyEmailIdentity';
        $this->_method = 'GET';
        $this->_refreshDate();

        if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
            throw new Exception('Invalid email');
            return;
        }

        $parameters = array(
            'EmailAddress' => $email
        );

        $this->_generateSignature($parameters);
        $res = $this->_request();
        if ($res['code'] == 200) {
            return (string) $res['body']->ResponseMetadata->RequestId;
        } else {
            return new SimpleEmailServiceError((string) $res['body']->Error->Code);
        }
    }
983590
public function getGoogleServiceGmailForEmail(string $email)
    {
        if (array_key_exists($email, $this->googleServiceGmails)) {
            return $this->googleServiceGmails[$email];
        }

        $googleServiceGmail = new \Google_Service_Gmail($this->serviceAccount->getGoogleClientForEmail($email));
        $this->googleServiceGmails[$email] = $googleServiceGmail;

        return $googleServiceGmail;
    }