Gets current Meteor user info
@return user Info or null if not logged in
979257
public Map<String, Object> getUser() {
        Map<String, Object> userFields = DDPStateSingleton.getInstance()
                .getDocument("users", getUserId());
        if (userFields != null) {
            return userFields;
        }
        return null;
    }
493802
public static String getCurrentUser() {
        ServiceContext ctx = ServiceContextStore.get();
        String currentUser;
        if (ctx == null) {
            currentUser = ServiceContextFactory.SYSTEM_USER;
        } else {
            currentUser = ctx.getUserId();
        }

        if (currentUser == null) {
            currentUser = ServiceContextFactory.UNKNOWN_USER;
        }
        return currentUser;
    }
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;
    }
571919
protected function currentUserInfo($guard = null)
    {
        $response = $this->visit("/_dusk/user/{$guard}");

        return json_decode(strip_tags($response->driver->getPageSource()), true);
    }
1260614
public function getUserInfo()
    {
        if (!isset($this->userInfo) || empty($this->userInfo)) {
            $this->userInfo = $this->makeRequest('GET', 'userInfo');
        }

        return $this->userInfo;
    }
266489
public String getUserID()
    {
        Record recUserInfo = (Record)this.getUserInfo();
        if (recUserInfo != null)
            return Converter.stripNonNumber(recUserInfo.getField(UserInfoModel.ID).toString());
        else
            return super.getUserID();
    }
521273
protected function getUserString()
    {
        $user = $this->core->auth()->user();

        if ( ! $user) return null;

        return $user->getUsername();
    }
392915
public function userInfo()
    {
        $this->startBrokerSession();
        $user = null;

        $username = $this->getSessionData('sso_user');

        if ($username) {
            $user = $this->getUserInfo($username);
            if (!$user) return $this->fail("User not found", 500); // Shouldn't happen
        }

        header('Content-type: application/json; charset=UTF-8');
        echo json_encode($user);
    }
368618
public function userInfo()
    {
        try {
            $this->startBrokerSession();

            $username = $this->getSessionData('sso_user');

            if (!$username) {
                $this->fail('User not authenticated. Session ID: ' . $this->getSessionData('id'));
            }

            if (!$user = $this->getUserInfo($username)) {
                $this->fail('User not found.');
            }
        } catch (SSOServerException $e) {
            return $this->returnJson(['error' => $e->getMessage()]);
        }

        return $this->returnUserInfo($user);
    }
126257
public function get_userinfo() {
        $url = $this->get_issuer()->get_endpoint_url('userinfo');
        $response = $this->get($url);
        if (!$response) {
            return false;
        }
        $userinfo = new stdClass();
        try {
            $userinfo = json_decode($response);
        } catch (\Exception $e) {
            return false;
        }

        $map = $this->get_userinfo_mapping();

        $user = new stdClass();
        foreach ($map as $openidproperty => $moodleproperty) {
            // We support nested objects via a-b-c syntax.
            $getfunc = function($obj, $prop) use (&$getfunc) {
                $proplist = explode('-', $prop, 2);
                if (empty($proplist[0]) || empty($obj->{$proplist[0]})) {
                    return false;
                }
                $obj = $obj->{$proplist[0]};

                if (count($proplist) > 1) {
                    return $getfunc($obj, $proplist[1]);
                }
                return $obj;
            };

            $resolved = $getfunc($userinfo, $openidproperty);
            if (!empty($resolved)) {
                $user->$moodleproperty = $resolved;
            }
        }

        if (empty($user->username) && !empty($user->email)) {
            $user->username = $user->email;
        }

        if (!empty($user->picture)) {
            $user->picture = download_file_content($user->picture, null, null, false, 10, 10, true, null, false);
        } else {
            $pictureurl = $this->issuer->get_endpoint_url('userpicture');
            if (!empty($pictureurl)) {
                $user->picture = $this->get($pictureurl);
            }
        }

        if (!empty($user->picture)) {
            // If it doesn't look like a picture lets unset it.
            if (function_exists('imagecreatefromstring')) {
                $img = @imagecreatefromstring($user->picture);
                if (empty($img)) {
                    unset($user->picture);
                } else {
                    imagedestroy($img);
                }
            }
        }

        return (array)$user;
    }
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;
    }
800223
public function userId()
	{
		if (isset($this->user_id)) {
			return $this->user_id ? $this->user_id : null;
		}
		
		$this->check();
		$this->user_id = false;
		
		if ('user' == $this->type) {
			if ($user_id = Authorizer::getResourceOwnerId()) {
				return $this->user_id = $user_id;
			}
		}
		
		return null;
	}
274330
def get_info(self):
        '''
        
        '''
        self.render()
        info = super(Template, self).get_info()
        res = {}
        res['name'] = self.get_name()
        res['mutation'] = {
            'current_index': self._current_index,
            'total_number': self.num_mutations()
        }
        res['value'] = {
            'rendered': {
                'base64': b64encode(self._current_rendered.tobytes()).decode(),
                'length_in_bytes': len(self._current_rendered.tobytes()),
            }
        }
        res['hash'] = self.hash()
        res['field'] = info
        return res
482373
def current_user(self):
        
        if not hasattr(self, '_serverInfo') or 'username' not in self._serverInfo:

            url = self._get_url('serverInfo')
            r = self._session.get(url, headers=self._options['headers'])

            r_json = json_loads(r)
            if 'x-ausername' in r.headers:
                r_json['username'] = r.headers['x-ausername']
            else:
                r_json['username'] = None
            self._serverInfo = r_json
            # del r_json['self']  # this isn't really an addressable resource
        return self._serverInfo['username']
812634
protected function getUserId() {
        $user = Auth::user();
        if (is_object($user) && !empty($user->id)) {
            return $user->id;
        } else {
            return null;
        }
    }
462063
public function user()
    {
        // if the user was explicitly marked as logged out.
        if ($this->loggedOut) {
            // just return null.
            return null;
        }

        // if the user is already set.
        if ($this->user) {
            return $this->user;
        }

        // detects a token presence.
        $token = $this->detectedToken();

        // if the received token is not actually valid.
        if (!$token || !$this->manager->validToken($token)) {
            // also return null since the token
            // signature could not be determined.
            return null;
        }

        // if the token has expired.
        if ($this->manager->expired($token)) {
            // you got right?
            return null;
        }

        // try to find the user which the token belongs to.
        $user = $this->findUserByToken($token);

        // if the user has not been found.
        if (!$user) {
            // abort!
            return null;
        }

        // set the current user on the scope.
        $this->setUser($user);

        // return the scope user.
        return $this->user;
    }
1219899
public function getCurrentUser()
    {
        $returnValue = null;

    	if(!common_session_SessionManager::isAnonymous()){
        	$userUri = \common_session_SessionManager::getSession()->getUser()->getIdentifier();
			if(!empty($userUri)){
        		$returnValue = new core_kernel_classes_Resource($userUri);
			} else {
				common_Logger::d('no userUri');
			}
    	}

        return $returnValue;
    }