Get a Users email signature

@param string $domain
@param string $user
@return string|null Signature or null on error
436642
public function getSignature($domain, $user)
    {
        $url = self::BASE_URL . "{$domain}/{$user}/signature";
        $request = new \Google_Http_Request($url, 'GET', null, null);

        $httpRequest = $this->helper->getClient()
           ->getAuth()
           ->authenticatedRequest($request);
        if ($httpRequest->getResponseHttpCode() == 200) {
            $xmlResponse = new \SimpleXMLElement($httpRequest->getResponseBody(), 0, false, 'apps', true);

            return (string)$xmlResponse->children('apps', true)
               ->attributes()->value;
        } else {
            // An error occurred.
            return null;
        }
    }
475580
public function getUserMail(\core_kernel_classes_Resource $user)
    {
        $userMailProperty = new \core_kernel_classes_Property(GenerisRdf::PROPERTY_USER_MAIL);
        $result = (string) $user->getOnePropertyValue($userMailProperty);
        if (!$result || !filter_var($result, FILTER_VALIDATE_EMAIL)) {
            $result = null;
        }
        return $result;
    }
655277
protected function getUserName(User $user): string
    {
        $contentInfo = $this->repository->sudo(
            function (Repository $repository) use ($user): ContentInfo {
                return $this->loadService->loadContent($user->id)->contentInfo;
            }
        );

        return $contentInfo->name;
    }
474823
protected function getNameFromUser($user)
    {
        switch (true) {
            // favour (potentially) unchanging user credentials
            case $user instanceof Contracts\UniversallyIdentifiable:
                return $user->getUuid();

            case $user instanceof AuthenticatableContract:
                return $user->getAuthIdentifier();

            case $user instanceof Contracts\Identifiable:
                return $user->getId();

            case $user instanceof Contracts\Nameable:
                return $user->getName();

            default:
                return null;
        }
    }
77488
protected function getCache($domain)
    {
        if (array_key_exists($domain, $this->cache)) {
            return $this->cache[$domain];
        }

        return null;
    }
1022719
public static function encodeDomainName($domain): string
    {
        if ('.' === $domain) {
            return chr(0);
        }

        $domain = rtrim($domain, '.').'.';
        $res = '';

        foreach (explode('.', $domain) as $label) {
            $res .= chr(strlen($label)).$label;
        }

        return $res;
    }
886724
private function getCurrentUser($required)
    {
        $result = null;
        $id = $this->getCurrentUserID($required);
        if ($id !== null) {
            $result = $this->getEntityManager()->find(UserEntity::class, $id);
        }

        if ($result === null && $required) {
            throw new UserMessageException(t('No logged in user'));
        }

        return $result;
    }
276118
public function getPublisher(User $user)
    {
        foreach ($this->getPublishers() as $publisher) {
            if ($publisher->getUser()->getId() == $user->getId()) {
                return $publisher;
            }
        }

        return null;
    }
40740
public function getFormLabel($domain=null)
    {
        $form = $this->getForm();
        $translationDomain = !is_null($domain) ? $domain : 'forms';
        $translator = $form->getTranslator();

        $id = $form->getName();
        if ($form instanceof FormCollectionInterface) {
            if (!is_int($this->getEntityContainer()->getName())) {
                $id .= '.' . $this->getEntityContainer()->getName();
            }
        }
        $id .= '.' . $this->getName();

        return $translator->trans($id, array(), $translationDomain);
    }
114711
protected function accessBlob( $domain, $lang, $key ) {
		if ( !isset( $this->messageBlob[$domain][$lang][$key] ) ) {
			return null;
		}
		return $this->messageBlob[$domain][$lang][$key];
	}
427745
public function getUser($user)
    {
        $params = [
            'name' => $user,
        ];

        $body = $this->request(self::URI_AUTH_USER_GET, $params);
        if ($this->pretty && isset($body['roles'])) {
            return $body['roles'];
        }

        return $body;
    }
921169
public function sendNotification($user)
  {
    $token = Hash::random(35);

    VerifiedUser::create([
      'email' => $user->email,
      'token' => $token
    ]);

    return $this->sendVerifyEmailNotification($user, $token);
  }
1285800
protected function getScheme(?string $scheme, ?string $domain = null) : string
    {
        if ($scheme === null || $scheme === '//') {
            return $this->tryGuessScheme($domain);
        }

        return $this->trim($scheme, ':/') . '://';
    }
488269
public function getEmailAddressOfUser(UserInterface $user, $useFallback = true)
    {
        // take users email address
        $userEmail = $user->getEmail();
        if ($userEmail) {
            return $userEmail;
        }

        // fallback: get contacts / accounts main-email
        $contact = $user->getContact();
        if ($useFallback && $contact) {
            return $this->getEmailAddressOfContact($contact);
        }

        return null;
    }
572743
public static function getXDomainUserId($domain_username, $domain)
	{
		$db = \App::get('db');

		if (empty($domain) || ($domain == 'hubzero'))
		{
			return $domain_username;
		}

		$query = 'SELECT uidNumber FROM #__xdomain_users,#__xdomains WHERE ' .
				 '#__xdomains.domain_id=#__xdomain_users.domain_id AND ' .
				 '#__xdomains.domain=' . $db->quote($domain) . ' AND ' .
				 '#__xdomain_users.domain_username=' . $db->quote($domain_username);
		$db->setQuery($query);

		$result = $db->loadObject();

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

		return $result->uidNumber;
	}
1122053
public function getSiteByDomain($domain)
    {
        $queryBuilder = $this->_em->createQueryBuilder();
        $queryBuilder->select('domain, site, primaryDomain')
            ->from(\Rcm\Entity\Domain::class, 'domain')
            ->leftJoin('domain.site', 'site')
            ->leftJoin('domain.primaryDomain', 'primaryDomain')
            ->where('domain.domain = :domainName')
            ->setParameter('domainName', $domain);

        try {
            /** @var \Rcm\Entity\Domain $domain */
            $domain = $queryBuilder->getQuery()->getSingleResult();
        } catch (NoResultException $e) {
            return null;
        }

        if ($domain->getPrimary()) {
            $site = $domain->getPrimary()->getSite();
            $this->_em->detach($site);
            $this->_em->detach($domain);
            $site->setDomain($domain);
        } else {
            $site = $domain->getSite();
        }

        return $site;
    }
153360
private function getCommand($user = null)
    {
        $command = $this->executable;

        if ($user) {
            $command .= ' -u' . $user;
        }

        return $command;
    }