Sets the user info of the URL to userInfo.

@param string|null $userInfo
@return \MToolkit\Network\MUrl
10694
public function setUserInfo( $userInfo )
    {
        $userInfoParts = explode( ":", $userInfo );
        $this->user = $userInfoParts[0];
        $this->password = $userInfoParts[1];

        return $this;
    }
409656
public function setUserAndGroup()
    {
        // Get uid.
        $user_info = posix_getpwnam($this->user);
        if (!$user_info) {
            static::log("Warning: User {$this->user} not exsits");
            return;
        }
        $uid = $user_info['uid'];
        // Get gid.
        if ($this->group) {
            $group_info = posix_getgrnam($this->group);
            if (!$group_info) {
                static::log("Warning: Group {$this->group} not exsits");
                return;
            }
            $gid = $group_info['gid'];
        } else {
            $gid = $user_info['gid'];
        }

        // Set uid and gid.
        if ($uid != posix_getuid() || $gid != posix_getgid()) {
            if (!posix_setgid($gid) || !posix_initgroups($user_info['name'], $gid) || !posix_setuid($uid)) {
                static::log("Warning: change gid or uid fail.");
            }
        }
    }
1260614
public function getUserInfo()
    {
        if (!isset($this->userInfo) || empty($this->userInfo)) {
            $this->userInfo = $this->makeRequest('GET', 'userInfo');
        }

        return $this->userInfo;
    }
304613
protected function parseUserInfo()
    {
        // No user information? we're done
        if (null === $this->userInfo) {
            return;
        }

        // If no ':' separator, we only have a username
        if (false === strpos($this->userInfo, ':')) {
            $this->setUser($this->userInfo);

            return;
        }

        // Split on the ':', and set both user and password
        list($user, $password) = explode(':', $this->userInfo, 2);
        $this->setUser($user);
        $this->setPassword($password);
    }
664139
public function initUrl($url, $username = null, $password = null, $userAgent = null)
    {
        if (!is_null($username) && !is_null($password)) {
            $this->httpBasicAuth['username'] = $username;
            $this->httpBasicAuth['password'] = $password;
        }

        if (!is_null($userAgent)) {
            $this->httpUserAgent = $userAgent;
        }

        $this->initFile($url);

        return $this;
    }
908067
public function getUserField($field = null, $userInfo = null) {
		if (empty($field)) {
			return null;
		}

		if (!empty($userInfo) && is_array($userInfo)) {
			$targetUserInfo = $userInfo;
		} else {
			$targetUserInfo = $this->_userInfo;
		}

		if (empty($targetUserInfo) || !is_array($targetUserInfo)) {
			return null;
		}

		$result = Hash::get($targetUserInfo, $field);

		return $result;
	}
767971
public function userInfo(string $username): Lastfm
    {
        $this->query = array_merge($this->query, [
            'method' => 'user.getInfo',
            'user' => $username,
        ]);

        $this->pluck = 'user';

        return $this;
    }
449738
public function setUser( UserStructure $user = null )
    {
        if ( null === $user )
        {
            $this->_user    = null;
            $this->userId   = null;

        }
        else
        {
            $this->_user    = $user;
            $this->userId   = $user->id;
        }

        return $this;
    }
82939
public function setInfo(string $info)
  {
    if ( false === ($step=$this->currentStep()) ){
      throw new \Exception('No current step');
    }
    
    $step->setInfo($info);
    return $this;
  }
1019498
protected static function buildAuthority(?string $userInfo, ?string $host, ?int $port): ?string
    {
        if ($host === null) {
            return null;
        }

        $authority = '';

        if ($userInfo !== null) {
            $authority .= sprintf('%s@', $userInfo);
        }
        $authority .= $host;
        if ($port !== null) {
            $authority .= sprintf(':%d', $port);
        }

        return $authority;
    }
491142
protected function setUserInfo($user = '', $password = '')
    {
        $this->uriString = null;

        if (! $user) {
            $this->userInfo = '';

            return $this;
        }
        $this->userInfo = rtrim($user, '@');

        if ($password) {
            $this->userInfo .= ':' . $password;
        }

        return $this;
    }
392616
private function getUri($pathinfo, $urlType = RouteCollection::DEFAULT_URL)
    {
        return $this->routeCollection->getUri($pathinfo, null, null, $urlType);
    }
301100
public function match($pathinfo)
    {
        $urlMatcher = new UrlMatcher(
            $this->getRouteCollection(),
            $this->getContext()
        );

        $result = $urlMatcher->match($pathinfo);
        if (!empty($result)) {
            // Remap locale for front-end requests
            if ($this->isMultiDomainHost() &&
                $this->isMultiLanguage() &&
                !$result['preview']
            ) {
                $localeMap = $this->getLocaleMap();
                $locale = $result['_locale'];
                $result['_locale'] = $localeMap[$locale];
            }

            $nodeTranslation = $this->getNodeTranslation($result);
            if (is_null($nodeTranslation)) {
                throw new ResourceNotFoundException(
                    'No page found for slug ' . $pathinfo
                );
            }
            $result['_nodeTranslation'] = $nodeTranslation;
        }

        return $result;
    }
448767
protected function setSiteInfo( $siteInfo )
    {
        $setAllowOverride   = false;
        $serviceManager     = $this->getServiceManager();

        if ( $serviceManager->has( 'SiteInfo' ) &&
             ! $serviceManager->getAllowOverride() )
        {
            $serviceManager->setAllowOverride( $setAllowOverride = true );
        }

        $serviceManager->setService( 'SiteInfo', $siteInfo );

        if ( $setAllowOverride )
        {
            $serviceManager->setAllowOverride( false );
        }

        return $siteInfo;
    }
1068365
final public function findUser(Userinfo $userinfo)
	{
		$userloopup = $this->lookupUser($userinfo);
		if ($userloopup instanceof Userinfo) {
			$user = $this->getUser($userloopup);
		} else {
			$user = $this->getUser($userinfo);
			if ($user instanceof Userinfo) {
				/**
				 * TODO: determine if the update lookup should really be here or not.
				 */
				$this->updateLookup($user, $userinfo);
			}
		}
		return $user;
	}
1314523
public function getUserInfo()
    {
        $userInfo = $this->getUser();

        $pass = $this->getPassword();
        if ('' != $pass) {
            $userInfo .= ":$pass";
        }

        return $userInfo;
    }
1273131
function checkPassword(Userinfo $userinfo) {
		return $this->comparePassword($userinfo->password, $this->generateEncryptedPassword($userinfo));
	}