Returns the main user associated with the network.

@author Vova Feldman (@svovaf)
@since  2.0.0

@return FS_User
168635
function get_network_user() {
            if ( ! $this->_is_network_active ) {
                return null;
            }

            return FS_User::is_valid_id( $this->_storage->network_user_id ) ?
                self::_get_user_by_id( $this->_storage->network_user_id ) :
                null;
        }
377435
public function getUser()
    {
        $token = $this->getToken();

        if (!$token) {
            return false;
        }

        $user = $token->getUser();

        if (is_object($user)) {
            return $user;
        }

        return;
    }
685684
public function getUser()
    {
        if ($this->_user === false) {
            $this->_user = User::findByUsernameOrEmail($this->identifier);
        }

        return $this->_user;
    }
425059
public static function user()
    {
        if (self::check()) {
            if (is_null(static::$user)) {
                $data = Session::get(static::resource('session'));

                $data = static::query($data);

                static::$user = static::orm($data[0]);
            }

            return static::$user;
        }
    }
630379
public function currentUser()
    {

        // Already initialized
        if (!is_null(static::$currentUser)) {
            return static::$currentUser;
        }

        // Find the current user
        if (!isset($_SESSION['Staq']['loggedUser'])) {
            $user = FALSE;
        } else {
            $user = $this->getUserEntity()->fetchById($_SESSION['Staq']['loggedUser']);
            if (!$user->exists()) {
                $user = FALSE;
            }
        }
        static::$currentUser = $user;
        return static::$currentUser;
    }
163327
function getUserFromPHPSession() {
		if ($this->user == null) {
            $sid = $this->request->session('usersid', '');
            if ($sid == '') {
                // try with a get key
                $sid = $this->request->get('sessionid', '');
            }
			$this->user = $this->getUserFromSession($sid);
		}
        return $this->user;
    }
888804
public function getUser()
    {
        if ($this->_user === false) {
            $customerClass = Yincart::$container->customerClass;
            $this->_user = $customerClass::findByUsername($this->username);
        }

        return $this->_user;
    }
468251
public function current() {
        $user = \core_user::get_user($this->userids[$this->iteratorposition]);

        if (false === $user) {
            // This user was not found.
            unset($this->userids[$this->iteratorposition]);

            // Check to see if there are any more users left.
            if ($this->count()) {
                // Move the pointer to the next record and try again.
                $this->next();
                $user = $this->current();
            } else {
                // There are no more context ids left.
                return;
            }
        }

        return $user;
    }
19702
public function getUser() {

        if($this->user === false) {

            $this->session->remove(self::KEY);
            $this->session->set(self::KEY, parent::getUser());
        }

        return $this->user;
    }
1194988
public function getUser(): User
    {
        if ($this->sender !== null) {
            return $this->sender;
        }

        $userId = (string) $this->request->getParameter('object.user_id');
        $request = $this->http->get(self::API_URL.'users.get', [
            'query' => [
                'user_ids' => $userId,
                'v' => self::API_VERSION,
            ],
        ]);
        $response = json_decode($request->getBody()->getContents(), true);
        $user = $response['response'][0];

        return $this->sender = new User(
            (string) $user['id'],
            $user['first_name'].' '.$user['last_name']
        );
    }
1096791
public function getCurrentUser() {
    if (empty($this->currentUser)) {
      $this->currentUser = \Drupal::service('current_user');
    }
    return $this->currentUser;
  }
423251
public function user()
    {
        // If we've already retrieved the user for the current request we can just
        // return it back immediately. We do not want to fetch the user data on
        // every call to this method because that would be tremendously slow.
        if (!is_null($this->user)) {
            return $this->user;
        }
        $user = NULL;
        $token = $this->getTokenForRequest();
        if (!empty($token)) {
            $user = $this->retrieveByToken($token);
        }

        return $this->user = $user;
    }
796348
public function user()
    {
        if (!$user = Auth::getUser()) {
            return null;
        }

        if (!Auth::isImpersonator()) {
            $user->touchLastSeen();
        }

        return $user;
    }
795065
public function getUser()
    {
        if (! $this->_user) {
            $request = $this->getRequest();

            $this->_user = $this->loader->getUser($request->getParam($this->usernameFieldName), $request->getParam($this->organizationFieldName));
        }
        return $this->_user;
    }
769606
public function user()
    {
        // If we've already retrieved the user for the current request we can just
        // return it back immediately. We do not want to fetch the user data on
        // every call to this method because that would be tremendously slow.
        if (! is_null($this->user)) {
            return $this->user;
        }

        return $this->user = call_user_func($this->callback, $this->request);
    }
958358
public static function getCurrentUser() {
    $email = UserServiceUtil::getUserEnvironmentVariable('USER_EMAIL');
    $userId = UserServiceUtil::getUserEnvironmentVariable('USER_ID');
    $federatedIdentity =
        UserServiceUtil::getUserEnvironmentVariable('FEDERATED_IDENTITY');
    $federatedProvider =
        UserServiceUtil::getUserEnvironmentVariable('FEDERATED_PROVIDER');

    if (!$email && !$federatedIdentity) {
      return null;
    }

    if (!$federatedIdentity) {
      $federatedIdentity = null;
    }

    if (!$federatedProvider) {
      $federatedProvider = null;
    }

    // We set this to maintain compatibility with the
    // datastore_types.FromPropertyPb creation of a User object, which will set
    // an empty string for the email (since it is a required field of the
    // underlying data representation of this class in the datastore.
    if ($email === false) {
      $email = '';
    }

    // User.user_id() should only return a
    // string of length > 0 or null.
    if (!$userId || $userId == '') {
      $userId = null;
    }

    return new User($email, $federatedIdentity, $federatedProvider, $userId);
  }
433162
public function user()
	{
		if ($this->loggedOut)
		{
			return null;
		}

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

		return $this->user = wp_get_current_user();
	}