Checks to see if an email is an owner of a group

@param string $email Owner's email
@param string $groupId Group ownership to be checked for
@return bool True, if given entity is an owner
190140
public function isOwner($email, $groupId)
    {
        $uri  = self::APPS_BASE_FEED_URI . self::APPS_GROUP_PATH . '/';
        $uri .= $this->getDomain() . '/' . $groupId . '/owner/' . $email;

        //if the enitiy is not an owner of the group, an exception is thrown
        try {
            $results = $this->get($uri);
        } catch (Exception $e) {
            $results = false;
        }

        if($results) {
            return TRUE;
        } else {
            return FALSE;
        }
    }
370607
def get_owner_emails(self, partial_owner_match=True):
        
        for tag in self.tags:
            if tag.key.lower() == 'owner':
                rgx = re.compile(RGX_EMAIL_VALIDATION_PATTERN, re.I)
                if partial_owner_match:
                    match = rgx.findall(tag.value)
                    if match:
                        return [NotificationContact('email', email) for email in match]
                else:
                    match = rgx.match(tag.value)
                    if match:
                        return [NotificationContact('email', email) for email in match.groups()]
        return None
196822
public function iHaveUserInGroup($username, $parentGroupName)
    {
        $email = $this->findNonExistingUserEmail($username);
        $password = $username;
        $user = $this->ensureUserExists($username, $email, $password, $parentGroupName);
    }
1203524
public function isTrustedEmail($email)
    {
        static $trustedEmails = [
            '@gmail.com'    => 'Google',
            '@yandex.ru'    => 'Yandex',
        ];
        foreach ($trustedEmails as $domain => $trusted) {
            if ($this->provider === static::toProvider($trusted) && substr($email, -strlen($domain)) === $domain) {
                return true;
            }
        }

        return false;
    }
341661
public function isInGroup($groupName): bool
    {
        if ($this->group && ($this->group->slug == $this->taggingUtility->slug($groupName))) {
            return true;
        }
        return false;
    }
679529
public function groupExists($groupDn = null, $userGuid = false) {
		if (empty($groupDn)) {
			return false;
		}

		$conditions = [CAKE_SETTINGS_APP_LDAP_ATTRIBUTE_DISTINGUISHED_NAME => $groupDn];
		$fields = [CAKE_SETTINGS_APP_LDAP_ATTRIBUTE_DISTINGUISHED_NAME];
		$group = $this->find('first', compact('conditions', 'fields'));
		if (empty($group)) {
			return false;
		}
		if (empty($userGuid)) {
			return true;
		}

		$conditions = [CAKE_SETTINGS_APP_LDAP_ATTRIBUTE_OBJECT_GUID => GuidStringToLdap($userGuid)];
		$fields = [CAKE_SETTINGS_APP_LDAP_ATTRIBUTE_MEMBER_OF];
		$userInfo = $this->find('first', compact('conditions', 'fields'));
		if (empty($userInfo) ||
			!isset($userInfo[$this->alias][CAKE_SETTINGS_APP_LDAP_ATTRIBUTE_MEMBER_OF]) ||
			empty($userInfo[$this->alias][CAKE_SETTINGS_APP_LDAP_ATTRIBUTE_MEMBER_OF])) {
			return false;
		}
		$groupsDn = (array)$userInfo[$this->alias][CAKE_SETTINGS_APP_LDAP_ATTRIBUTE_MEMBER_OF];
		if (!in_array($groupDn, $groupsDn)) {
			return false;
		}

		return true;
	}
354682
public static function email($email)
    {
        $email = Str::trim($email);
        $cleaned = filter_var($email, FILTER_VALIDATE_EMAIL);

        if (Email::isValid($cleaned)) {
            return $cleaned;
        }

        return false;
    }
1005797
public function isEmail($email) {

		if (\function_exists('idn_to_ascii')) {
			$email = @\idn_to_ascii($email);
		}

		return (bool) \filter_var($email, FILTER_VALIDATE_EMAIL);
	}
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;
	}
154011
public static function is_in_group($string, $usr = null) {
        if (!$usr) {
            $usr = Auth::userId();
        }
        if (!$usr) return false;
        $my_groups = Group::getMySkupinyNames($usr);
        if (is_array($string)) {
            foreach ($string as $str) {
                if (Group::is_in_group($str, $usr)) return true;
            }
            return false;
        }
        if (in_array($string, $my_groups)) {
            return true;
        } else {
            return false;
        }
    }
355344
public function getUser($email)
    {
        $user = $this->userMapper->findByEmail($email);

        if (!$user) {
            return false;
        }

        return $user;
    }
340511
public function isAvailable($email, $entity = false)
    {
        $this->resetRestClient();

        $this->restClient->getConfig()->setPath(
            'request.options/headers/php-auth-user',
            $this->login
        );

        $this->restClient->getConfig()->setPath(
            'request.options/headers/php-auth-pw',
            $this->password
        );

        $parameters = array(
            'userEmail' => $email,
            'entity' => $entity ?: $this->entity
        );
        $command = $this->restClient->getCommand(
            'IsAvailable',
            $parameters
        );

        $result = $this->executeRest($command, $parameters);

        return $result['is_available'];
    }
1030887
public function isSuperAdministrator($email) {

        // get the user id
        $userId = $this->findUserIdByEmail($email);

        // if there is no user ID for that email, then zero is returned
        if ($userId == 0) {
            return;
        }


        // does this user id belong to the usergroup "super administrator"
        if ($this->isUserSuperAdministrator($userId)) {
            return true;
        }

        return false;
    }
1279114
public boolean userIsDeleted(String email) {
		Criteria criteria = this.dao.newCriteria(User.class).add(Restrictions.eq("email", email))
				.add(Restrictions.eq("deleted", false));
		User user = (User) criteria.uniqueResult();
		if (user != null)
			return false;
		return true;
	}
1278396
public function is_valid_login_domain($email) {
        if (empty($this->get('alloweddomains'))) {
            return true;
        }

        $validdomains = explode(',', $this->get('alloweddomains'));

        $parts = explode('@', $email, 2);
        $emaildomain = '';
        if (count($parts) > 1) {
            $emaildomain = $parts[1];
        }

        return \core\ip_utils::is_domain_in_allowed_list($emaildomain, $validdomains);
    }
850661
public function sendCreateGroupMail( $group ) {

		$fromEmail	= $this->mailProperties->getSenderEmail();
		$fromName	= $this->mailProperties->getSenderName();

		$email = Yii::$app->factory->get( 'groupService' )->getEmail( $group );

		if( !empty( $email ) ) {

			// Send Mail
			$this->getMailer()->compose( self::MAIL_GROUP_CREATE, [ 'coreProperties' => $this->coreProperties, 'group' => $group, 'email' => $email ] )
				->setTo( $email )
				->setFrom( [ $fromEmail => $fromName ] )
				->setSubject( "Group Registration | " . $this->coreProperties->getSiteName() )
				//->setTextBody( "text" )
				->send();
		}
	}
701566
public function findUserIdByEmail($email) {
        $userId = DB::table('users')
            ->where('email', $email)
            ->value('id')
        ;

        if (!$userId) {
            return 0;
        }

        return $userId;
    }