Check if user is admin

@param string $email user email

@return boolean if the user is an admin
545164
public function isAdmin($redirect = false)
    {

        if (!$this->isLoggedIn()) {
            $this->di->get("response")->redirect("user/login");
            return false;
        }

        $email = $this->di->get("session")->get("user");
        $user = new User();
        $user->setDb($this->di->get("db"));
        $user->find("email", $email);
        $isAdmin = $user->admin;

        if (!$isAdmin) {
            if ($redirect) {
                $this->di->get("response")->redirect("user");
            }
            return false;
        }

        return true;
    }
461575
public function findUserByEmail($email)
    {
        $qb = $this->createQueryBuilder('user')
            ->where('user.email=:email');

        $query = $qb->getQuery();
        $query->setParameter('email', $email);

        return $query->getSingleResult();
    }
800646
public function accountExists($email)
	{
		// E-Mail check
		$stmntEmailCheck = $this->db->prepare("SELECT ID FROM " . $this->settings['db_login_table'] . " WHERE email = ?");
		$resEmailCheck = $this->db->select($stmntEmailCheck, array($email));

		return (count($resEmailCheck) > 0)?$resEmailCheck[0]->ID:false;
	}
74762
private function getUser()
	{
		if ($this->_user === false) {
			$this->_user = Administrator::findByEmail($this->email);
		}
		return $this->_user;
	}
1238709
public function validateEmail($email)
    {
        if (empty($email)) {
            $this->addError('email', 'Email cannot be empty');
            return false;
        }

        if (mb_strlen($email, 'UTF-8') > 255) {
            $this->addError('email', 'Email length has to be less or equal to 255');
            return false;
        }

        $emailValidator = new EmailValidator();
        if (!$emailValidator->isValid($email, new RFCValidation())) {
            $this->addError('email', 'Email must be an email address');
            return false;
        }

        return true;
    }
101196
public function isEmailBanned($email)
    {
        $emailTemplates = $this->getEmailTemplates();

        foreach ($emailTemplates as $emailTemplate) {
            $emailRule = new Email($emailTemplate);
            if ($emailRule->check($email)) {
                return true;
            }
        }
        return false;
    }
457356
public function isValidEmail(string $email): bool
    {
        return filter_var(filter_var($email, FILTER_SANITIZE_EMAIL), FILTER_VALIDATE_EMAIL) !== false;
    }
539349
public function isEmail($checkDNS = true)
    {
        $isValid = filter_var($this->returnValue, FILTER_VALIDATE_EMAIL) !== false;
        if ($isValid && $checkDNS) {
            $domain  = substr(strrchr($this->returnValue, "@"), 1);
            // domain not found in DNS
            $isValid = checkdnsrr($domain, "MX") && checkdnsrr($domain, "A");
        }
        return $isValid;
    }
742171
public function validateEmail($email)
    {
        $person = $this->getService('repos:people.person')->find(array('email' => $email));

        if ($person) {
            $this->setMessage('Email is already in use');
            return false;
        }

        return true;
    }
1092757
public function isEmailTaken($email)
    {
        $query = "SELECT count(*) FROM {$this->config->table_users} WHERE email = :email";
        $query_prepared = $this->dbh->prepare($query);
        $query_prepared->execute(['email' => $email]);

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

        return true;
    }
33361
public function isEmailUnique($email)
    {
        if ($email) {
            try {
                $this->userRepository->findUserByEmail($email);
            } catch (NoResultException $exc) {
                return true;
            }
        }

        return false;
    }
898772
public static function isEmail($email)
    {
        $pattern = "/^([0-9A-Za-z\\-_\\.]+)@([0-9a-z]+\\.[a-z]{2,3}(\\.[a-z]{2})?)$/i";
        if (is_string($email) && preg_match($pattern, $email)) {
            return true;
        }

        return false;
    }
377892
public static function isMail($email)
    {
        $parts = explode('@', $email);

        if (!is_string($email) || count($parts) != 2) {
            return false;
        }

        return (bool) filter_var($email, FILTER_VALIDATE_EMAIL);
    }
594883
public static function verify_email_address($email) {
		$email = trim($email);
		if (!$email || strlen($email) > 64)
			return false;
		return filter_var($email, FILTER_VALIDATE_EMAIL);
	}
852036
public function exists($email)
    {
        $url = $this->gravatar->buildGravatarURL($email);
        $headers = get_headers($url, 1);
	    
        return (boolean) strpos($headers[0], '200');
    }
365026
public function checkEmail($user, $email)
    {
        // missing email address (user login name) ?
        if (!$email) {
            $exception = oxNew(\OxidEsales\Eshop\Core\Exception\InputException::class);
            $exception->setMessage(\OxidEsales\Eshop\Core\Registry::getLang()->translateString('ERROR_MESSAGE_INPUT_NOTALLFIELDS'));

            return $this->addValidationError("oxuser__oxusername", $exception);
        }

        // invalid email address ?
        if (!oxNew(\OxidEsales\Eshop\Core\MailValidator::class)->isValidEmail($email)) {
            $exception = oxNew(\OxidEsales\Eshop\Core\Exception\InputException::class);
            $exception->setMessage(\OxidEsales\Eshop\Core\Registry::getLang()->translateString('ERROR_MESSAGE_INPUT_NOVALIDEMAIL'));

            return $this->addValidationError("oxuser__oxusername", $exception);
        }
    }
1240637
public static function isEmail($email = null)
    {
        if (is_null($email) || !$email || !is_string($email)) {
            return false;
        }
        return (bool) (preg_match('/^[^0-9][A-z0-9_]+([.][A-z0-9_]+)*[@][A-z0-9_]+([.][A-z0-9_]+)*[.][A-z]{2,4}$/', $email) > 0);
    }