ReadCurrentUser Method.
340314
public boolean readCurrentUser()
    {
        String strUserName = this.getProperty(DBParams.USER_NAME);
        String strUserID = this.getProperty(DBParams.USER_ID);
        boolean bUserFound = false;
        if ((this.getMainRecord().getEditMode() == DBConstants.EDIT_CURRENT) || (this.getMainRecord().getEditMode() == DBConstants.EDIT_IN_PROGRESS))
        {
            bUserFound = true;
        }
        else
        {
            if ((strUserID != null) && (strUserID.length() > 0))
            {
                bUserFound = ((UserInfo)this.getMainRecord()).getUserInfo(strUserID, false);
                if (bUserFound)
                    if (this.getMainRecord().getField(UserInfo.READ_ONLY_RECORD).getState() == true)
                        bUserFound = false; // Can't change anonymous
            }
            if (!bUserFound)
                if ((strUserName != null) && (strUserName.length() > 0))
            {
                bUserFound = ((UserInfo)this.getMainRecord()).getUserInfo(strUserName, false);
                if (bUserFound)
                    if (this.getMainRecord().getField(UserInfo.READ_ONLY_RECORD).getState() == true)
                        bUserFound = false; // Can't change anonymous
            }
        }
        if (!bUserFound)
        {
            try {
                this.getMainRecord().addNew();
            } catch (DBException e) {
                e.printStackTrace();
            }
            this.getMainRecord().getField(UserInfo.USER_NAME).setString(strUserName);
            this.getMainRecord().getField(UserInfo.USER_NAME).setModified(false);   // Don't force a write
        }
        else
        {
            // TODO What do I do if this user exists?
        }
        
        return bUserFound;
    }
705803
public static String formatCurrentTenant() {
        final UserDetails userDetails = getCurrentUser();
        if (!(userDetails instanceof UserPrincipal)) {
            return null;
        }

        final UserPrincipal userPrincipal = (UserPrincipal) userDetails;
        return trimAndFormatDetail(userPrincipal.getTenant(), 8);
    }
107364
public static function GetCurrentUser($guid = "CURRENT_USER")
	{
		if (self::$user == null)
		{
			self::Init();
			
			if (isset($_SESSION[$guid]))
			{
				self::$user = unserialize($_SESSION[$guid]);
			}		
		}
		return self::$user;
	}
1107890
def read(self, user=True, defaults=True):
        
        if user:
            self._add_user_source()
        if defaults:
            self._add_default_source()
818734
public function readCurrent()
    {
        if ($this->hasCurrent()) {
            $char = $this->input[$this->position];
        } else {
            $char = null;
        }

        return $char;
    }
607510
def user(self, user):
        """"""

        resource = self.RUSER + '/' + user
        params = {}

        result = [page for page in self._fetch(resource, params)]

        return result[0]
971582
public User getMe() {
        User u = User.current();
        if (u == null)
            throw new AccessDeniedException("/me is not available when not logged in");
        return u;
    }
143962
def check_user(self, todays_facts):
        """"""
        interval = self.conf_notify_interval
        if interval <= 0 or interval >= 121:
            return

        now = dt.datetime.now()
        message = None

        last_activity = todays_facts[-1] if todays_facts else None

        # update duration of current task
        if last_activity and not last_activity['end_time']:
            delta = now - last_activity['start_time']
            duration = delta.seconds /  60

            if duration and duration % interval == 0:
                message = _("Working on %s") % last_activity['name']
                self.notify_user(message)

        elif self.conf_notify_on_idle:
            #if we have no last activity, let's just calculate duration from 00:00
            if (now.minute + now.hour * 60) % interval == 0:
                self.notify_user(_("No activity"))
258880
function() {
      if (Parse.User._currentUser) {
        return Parse.User._currentUser;
      }

      if (Parse.User._currentUserMatchesDisk) {
        
        return Parse.User._currentUser;
      }

      // Load the user from local storage.
      Parse.User._currentUserMatchesDisk = true;

      var userData = Parse.localStorage.getItem(Parse._getParsePath(
          Parse.User._CURRENT_USER_KEY));
      if (!userData) {
        
        return null;
      }
      Parse.User._currentUser = Parse.Object._create("_User");
      Parse.User._currentUser._isCurrentUser = true;

      var json = JSON.parse(userData);
      Parse.User._currentUser.id = json._id;
      delete json._id;
      Parse.User._currentUser._sessionToken = json._sessionToken;
      delete json._sessionToken;
      Parse.User._currentUser._finishFetch(json);

      Parse.User._currentUser._synchronizeAllAuthData();
      Parse.User._currentUser._refreshCache();
      Parse.User._currentUser._opSetQueue = [{}];
      return Parse.User._currentUser;
    }
1214427
public void read() {
        File prefFile = new File(SystemProperties.getProperty("user.home"), PREF_FILE_NAME);
        if (!prefFile.exists() || !prefFile.isFile()) {
            return;
        }
        try {
            read(new FileInputStream(prefFile));
        } catch (IOException e) {
            // Ignore - just use default preferences
        }
    }
1013474
def get_history_user(self, instance):
        """"""
        try:
            return instance._history_user
        except AttributeError:
            request = None
            try:
                if self.thread.request.user.is_authenticated:
                    request = self.thread.request
            except AttributeError:
                pass

        return self.get_user(instance=instance, request=request)
669679
protected User getUser() {
        User visitor = ThreadContext.getSessionVisitor();
        if (visitor != null) {
            return visitor;
        }
        return null;
    }
205052
protected function getCurrentUser() {
    $use_ecomm_sessions = \Drupal::config('acm.commerce_users')
      ->get('use_ecomm_sessions');

    if ($use_ecomm_sessions) {
      return \Drupal::service('acm.commerce_user_manager');
    }
    else {
      return \Drupal::currentUser();
    }
  }
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;
    }
1096791
public function getCurrentUser() {
    if (empty($this->currentUser)) {
      $this->currentUser = \Drupal::service('current_user');
    }
    return $this->currentUser;
  }
1151554
@Provides
	@SessionScoped
	public UserLogin getLogin(@Named(JAXRS_SERVER_WEBAUTH_PROVIDER) CurrentUser user)
	{
		return (UserLogin) user;
	}
900497
def get_current_user():
    
    process = OpenProcessToken(
        ctypes.windll.kernel32.GetCurrentProcess(), TokenAccess.TOKEN_QUERY
    )
    return GetTokenInformation(process, TOKEN_USER)