Returns the site ID of the current user

@return string|null Site ID of the current user
162865
protected function getUserSiteId()
	{
		$context = $this->getContext();
		$manager = \Aimeos\MShop::create( $context, 'customer' );

		return $manager->getItem( $context->getUserId() )->getSiteId();
	}
270545
public static function get_site_identifier() {
        global $CFG;
        if (!is_null(self::$siteidentifier)) {
            return self::$siteidentifier;
        }
        // If site identifier hasn't been collected yet attempt to get it from the cache config.
        $factory = cache_factory::instance();
        // If the factory is initialising then we don't want to try to get it from the config or we risk
        // causing the cache to enter an infinite initialisation loop.
        if (!$factory->is_initialising()) {
            $config = $factory->create_config_instance();
            self::$siteidentifier = $config->get_site_identifier();
        }
        if (is_null(self::$siteidentifier)) {
            // If the site identifier is still null then config isn't aware of it yet.
            // We'll see if the CFG is loaded, and if not we will just use unknown.
            // It's very important here that we don't use get_config. We don't want an endless cache loop!
            if (!empty($CFG->siteidentifier)) {
                self::$siteidentifier = self::update_site_identifier($CFG->siteidentifier);
            } else {
                // It's not being recorded in MUC's config and the config data hasn't been loaded yet.
                // Likely we are initialising.
                return 'unknown';
            }
        }
        return self::$siteidentifier;
    }
894997
protected function get_cache_identifier() {
        $identifiers = array();
        if ($this->selectedsharingoption & self::SHARING_ALL) {
            // Nothing to do here.
        } else {
            if ($this->selectedsharingoption & self::SHARING_SITEID) {
                $identifiers[] = cache_helper::get_site_identifier();
            }
            if ($this->selectedsharingoption & self::SHARING_VERSION) {
                $identifiers[] = cache_helper::get_site_version();
            }
            if ($this->selectedsharingoption & self::SHARING_INPUT && !empty($this->userinputsharingkey)) {
                $identifiers[] = $this->userinputsharingkey;
            }
        }
        return join('/', $identifiers);
    }
1105744
private function fetchUserId()
  {
    $pool = Registry::getStash();

    $cache = $pool->getItem('nyaa/user/'.$this->getTorrentId());

    if ($cache->isMiss()) {
      // sadly we have to use the site since nothing provides the user id
      $userId = false;
      $html = file_get_contents($this->siteUrl);

      // lets not depend on the actual domain
      if(preg_match('~\/\?user\=([0-9]+)~i', $html, $match)) {
        $userId = intval($match[1]);
      }

      $cache->set($userId);
    }

    return $cache->get();
  }
296591
public function getSitesIdWithAtLeastViewAccess()
    {
        $this->loadSitesIfNeeded();

        return array_unique(array_merge(
                $this->idsitesByAccess['view'],
                $this->idsitesByAccess['write'],
                $this->idsitesByAccess['admin'],
                $this->idsitesByAccess['superuser'])
        );
    }
556135
public function getUserIp()
    {
        if (\Yii::$app === null || $this->getIsConsoleRequest()) {
            return null;
        }

        return \Yii::$app->getRequest()->getUserIP();
    }
1003266
public function getId() {
		$options = $this->getOptions();
		$id = elgg_extract('list_id', $options);
		if (!$id) {
			$id = md5($this->getBaseURL());
		}
		return $id;
	}
882667
protected function getUserId()
    {
        try {
            if (Auth::check()) {
                return Auth::user()->getAuthIdentifier();
            }
        } catch (Exception $e) {
            Log::emergency($e);
            return;
        }

        return;
    }
1171506
public function id()
	{
		if ( $this->loggedOut )
			return null;

		$id = $this->session->get( $this->getName() );

		if ( is_null( $id ) && $this->acct() )
			$id = $this->acct()->getId();

		return $id;
	}
235543
public function getId()
    {
        $tmp = (array) $this->getHeaderFieldModel($this->getIdField());

        return $this->headers->has($this->getIdField()) ? current($tmp) : $this->id;
    }
1012035
public static function getAuthorUserId()
    {
        return (Yii::$app instanceof \luya\web\Application) ? Yii::$app->adminuser->getId() : self::$_authorUserId;
    }
1216123
public function get_user_id()
    {
        if (is_object($this->user)) {
            return $this->user->ID;
        }
        else if (isset($_SESSION['user_id'])) {
            return $_SESSION['user_id'];
        }

        return null;
    }
1137350
public function getCurrentUser()
    {
        if ($this->currentuser === null) {
            $this->currentuser = $this->app['session']->isStarted() ? $this->app['session']->get('authentication') : null;
            if ($this->currentuser instanceof AccessControl\Token\Token) {
                $this->currentuser = $this->currentuser->getUser()->toArray();
            }
        }

        return $this->currentuser;
    }
898658
public function getCurrentRequestId()
    {
        if ($this->requestId === null) {
            $this->requestId = $this->getRequestIdGenerator()->generate();
        }
        return $this->requestId;
    }
422200
public function getUserId()
    {
        $id = $this->getAttribute('userId');
        if (null === $id && null !== $this->user) {
            $id = $this->userId = $this->user->id;
        }

        return $id;
    }
531838
public function getUserId()
    {
        /* @var $session \Mage_Customer_Model_Session */
        $session = Mage::getSingleton('customer/session');
        $customer = $session->getCustomer();
        if ($customer !== null) {
            return $session->getCustomer()->getId();
        } else {
            return null;
        }
    }
276120
private function getUserId()
    {
        $id = null;

        if (null !== $this->tokenStorage && null !== $this->tokenStorage->getToken()) {
            $user = $this->tokenStorage->getToken()->getUser();

            if ($user instanceof UserInterface) {
                $id = $user->getId();
            }
        }

        return $id;
    }