Set user browser

@return Visitor
326816
private function setBrowser()
    {
        $client = parse_user_agent($this->detector->getUserAgent());
        $this->browser = $client['browser'];
        $this->setPlatform($client['platform']);

        return $this;
    }
456597
public function setUser($user)
    {

        // Clear cache
        $this->user = null;

        // Find element
        if (!$user = $this->findUserElement($user)) {
            // Clear property / cache
            $this->userId = $this->user = null;
        } else {
            // Set property
            $this->userId = $user->getId();

            // Set cache
            $this->user = $user;
        }

        return $this;
    }
484235
protected function setPagerListUser()
    {
        $options = $this->query_filter;
        $options['count'] = true;

        $pager = array(
            'query' => $this->query_filter,
            'total' => (int) $this->user->getList($options)
        );

        return $this->data_limit = $this->setPager($pager);
    }
266605
protected function getBrowserId(string $userAgent) : int
    {
        if ($this->browserId === null) {
            $this->findBrowser($userAgent);
        }

        return $this->browserId;
    }
787851
public function setUserAgent($userAgent = '')
    {
        $this->userAgent = $userAgent;
        $this->debug->info(__FUNCTION__, 'setUserAgent: ', $this->userAgent);

        return $this;
    }
1196918
public function visitorGetUserIP()
	{
	    $UserIP = \Environment::get('ip');
	    if (strpos($UserIP, ',') !== false) //first IP
	    {
	        $UserIP = trim( substr($UserIP, 0, strpos($UserIP, ',') ) );
	    }
	    if ( true === $this->visitorIsPrivateIP($UserIP) &&
	        false === empty($_SERVER['HTTP_X_FORWARDED_FOR'])
	        )
	    {
	        //second try
	        $HTTPXFF = $_SERVER['HTTP_X_FORWARDED_FOR'];
	        $_SERVER['HTTP_X_FORWARDED_FOR'] = '';
	
	        $UserIP = \Environment::get('ip');
	        if (strpos($UserIP, ',') !== false) //first IP
	        {
	            $UserIP = trim( substr($UserIP, 0, strpos($UserIP, ',') ) );
	        }
	        $_SERVER['HTTP_X_FORWARDED_FOR'] = $HTTPXFF;
	    }
	    return $UserIP;
	}
265285
public function getUserClient()
    {
        if (!$this->userClient) {
            $this->userClient = Factory::getUserClient(
                null, $this->configuration->getApiKey(), [Factory::API_BASE_URL => $this->configuration->getApiUri()]
            );
        }

        return $this->userClient;
    }
1346918
public function login()
    {
        $this->setTokenFromCookies();

        if (!empty($this->csrfToken)) {
            $this->loggedIn = true;
        }

        return $this;
    }
297774
function setCurrentUser(UserInterface $user)
    {
        $this->currentUser = $user;

        // accessing the current user from the
        // DI container is deprecated
        $this->app['user'] = $user;

        return $this;
    }
866898
def _init_browser(self):
        """"""
        self.browser = splinter.Browser('phantomjs')
        self.browser.visit(self.server_url + "/youraccount/login")
        try:
            self.browser.fill('nickname', self.user)
            self.browser.fill('password', self.password)
        except:
            self.browser.fill('p_un', self.user)
            self.browser.fill('p_pw', self.password)
        self.browser.fill('login_method', self.login_method)
        self.browser.find_by_css('input[type=submit]').click()
915205
public function browser()
    {
        //Gets the type from the query and the supported types from configuration
        $type = $this->request->getQuery('type');
        $types = $this->KcFinder->getTypes();

        //If there's only one type, it automatically sets the query value
        if (!$type && count($types) < 2) {
            $type = array_key_first($types);
            $this->request = $this->request->withQueryParams(compact('type'));
        }

        //Checks the type, then sets the KCFinder path
        if ($type && array_key_exists($type, $types)) {
            //Sets locale
            $locale = substr(I18n::getLocale(), 0, 2);
            $locale = empty($locale) ? 'en' : $locale;

            $this->set('kcfinder', sprintf('%s/kcfinder/browse.php?lang=%s&type=%s', Router::url('/vendor', true), $locale, $type));
        }

        $this->set('types', array_combine(array_keys($types), array_keys($types)));
    }
120527
public function setDefaultUserAgent()
    {
        $user_agent = 'PHP-Curl-Class/' . self::VERSION . ' (+https://github.com/php-curl-class/php-curl-class)';
        $user_agent .= ' PHP/' . PHP_VERSION;
        $curl_version = curl_version();
        $user_agent .= ' curl/' . $curl_version['version'];
        $this->setUserAgent($user_agent);
    }
1198591
def setUser(request):
    """"""

    if not settings.PIAPI_STANDALONE or settings.PIAPI_REALUSERS:
        raise Http404

    request.session['plugit-standalone-usermode'] = request.GET.get('mode')

    return HttpResponse('')
592376
protected function setPagerListUserRole()
    {
        $options = $this->query_filter;
        $options['count'] = true;

        $pager = array(
            'query' => $this->query_filter,
            'total' => (int) $this->role->getList($options)
        );

        return $this->data_limit = $this->setPager($pager);
    }
1103260
protected function setUser() {
		if (!empty($this->getSiteConfig()['USER_CLASS'])) {
			$className = "{$this->getSiteConfig()['NAMESPACE_APP']}Classes\\Data\\{$this->getSiteConfig()['USER_CLASS']}";
			if (class_exists($className)) {
				$this->setGlobalUser(new $className());
			} else {
				$this->getLogger()->error("Configured User class not found: {$className}");
			}
		} else if (isset($this->getSiteConfig()['USECAS']) && $this->getSiteConfig()['USECAS']) {
			$this->setGlobalUser(new Data\UserCAS($this->getSanitizedInputData(),$this->getDataRepository('Users')));
		} else {
			$this->setGlobalUser(new Data\UserDB());
		}
	}
828873
function setActiveUser (user) {
    var button = $('<button>')
                    .addClass ('btn btn-default')
                    .attr ('data-toggle', 'tooltip')
                    .attr ('data-placement', 'bottom')
                    .attr ('title', user.id)
                    .attr ('id', 'active-user-' + user.id)
                    .html ('<span class="glyphicon glyphicon-user" aria-hidden="true"></span>')
                    .css  ('color', user.color);

    $('#active-users-indicator').append (button);
    $('[data-toggle="tooltip"]').tooltip ({
      container: 'body'
    });
  }
830422
public function user()
    {

        if ($this->hasInvalidState())
            throw new InvalidStateException;

        $tokens = $this->getAccessTokenResponse($this->getCode());

        $user = $this->mapUserToObject(
            array_merge(
                $this->getUserByToken($tokens['access_token']), [
                    'RefreshToken' => $tokens['refresh_token'],
                ]
            )
        );

        return $user->setToken($tokens['access_token']);
    }