// SimpleFSUserEditHistory returns the edit history for the logged-in user.
978706
func (k *SimpleFS) SimpleFSUserEditHistory(ctx context.Context) (
	res []keybase1.FSFolderEditHistory, err error) {
	session, err := idutil.GetCurrentSessionIfPossible(
		ctx, k.config.KBPKI(), true)
	// Return empty history if we are not logged in.
	if err != nil {
		return nil, nil
	}
	return k.config.UserHistory().Get(string(session.Name)), nil
}
364019
func (s *UserType) SetUserLastModifiedDate(v time.Time) *UserType {
	s.UserLastModifiedDate = &v
	return s
}
845113
func (c SimpleFSClient) SimpleFSRemove(ctx context.Context, __arg SimpleFSRemoveArg) (err error) {
	err = c.Cli.Call(ctx, "keybase.1.SimpleFS.simpleFSRemove", []interface{}{__arg}, nil)
	return
}
700647
func (comment *UserPostComment) ClearDefaults() {
	comment.Time = time.Time{}
	comment.Editable = true
}
487801
func (n *nessusImpl) EditUser(userID int, permissions, name, email string) (*User, error) {
	if n.verbose {
		log.Println("Editing user...")
	}
	data := editUserRequest{}

	if permissions != "" {
		data.Permissions = permissions
	}
	if name != "" {
		data.Name = name
	}
	if email != "" {
		data.Email = email
	}

	resp, err := n.doRequest("PUT", fmt.Sprintf("/users/%d", userID), data, []int{http.StatusOK})
	if err != nil {
		return nil, err
	}
	defer resp.Body.Close()
	reply := &User{}
	if err = json.NewDecoder(resp.Body).Decode(&reply); err != nil {
		return nil, err
	}
	return reply, nil
}
1248479
func (md *RootMetadata) SetLastModifyingUser(user keybase1.UID) {
	md.bareMd.SetLastModifyingUser(user)
}
1127160
func (r Account_Lockdown_Request) GetAccountHistory(accountId *int) (resp []datatypes.Account_Lockdown_Request, err error) {
	params := []interface{}{
		accountId,
	}
	err = r.Session.DoRequest("SoftLayer_Account_Lockdown_Request", "getAccountHistory", params, &r.Options, &resp)
	return
}
484000
func (fbo *folderBranchOps) GetEditHistory(
	ctx context.Context, _ data.FolderBranch) (
	tlfHistory keybase1.FSFolderEditHistory, err error) {
	// Wait for any outstanding edit requests.
	if err := fbo.editActivity.Wait(ctx); err != nil {
		return keybase1.FSFolderEditHistory{}, err
	}

	lState := makeFBOLockState()
	md, _ := fbo.getHead(ctx, lState, mdNoCommit)
	name := md.GetTlfHandle().GetCanonicalName()
	return fbo.config.UserHistory().GetTlfHistory(name, fbo.id().Type()), nil
}
929677
func (s *SimpleFSHandler) SimpleFSCopyRecursive(ctx context.Context, arg keybase1.SimpleFSCopyRecursiveArg) error {
	ctx, cancel := s.wrapContextWithTimeout(ctx)
	defer cancel()
	cli, err := s.client()
	if err != nil {
		return err
	}
	return cli.SimpleFSCopyRecursive(ctx, arg)
}
116434
func (s *AdminGetUserOutput) SetUserLastModifiedDate(v time.Time) *AdminGetUserOutput {
	s.UserLastModifiedDate = &v
	return s
}
648149
func (s *SecretStoreRevokableSecretService) GetUsersWithStoredSecrets(mctx MetaContext) (usernames []string, err error) {
	defer mctx.TraceTimed("SecretStoreRevokableSecretService.GetUsersWithStoredSecrets", func() error { return err })()
	identifierKeystore := s.identifierKeystore(mctx)
	suffixedUsernames, err := identifierKeystore.AllKeys(mctx, identifierKeystoreSuffix)
	if err != nil {
		return nil, err
	}
	for _, suffixedUsername := range suffixedUsernames {
		usernames = append(usernames, strings.TrimSuffix(suffixedUsername, identifierKeystoreSuffix))
	}
	return usernames, nil
}
1256069
func (m *Manager) AddSMSHistory(sh *SmsHistory) error {
	return m.collection.Insert(sh)
}
1080615
func (s *Action) History(ctx context.Context, c *cli.Context) error {
	name := c.Args().Get(0)
	showPassword := c.Bool("password")

	if name == "" {
		return ExitError(ctx, ExitUsage, nil, "Usage: %s history <NAME>", s.Name)
	}

	if !s.Store.Exists(ctx, name) {
		return ExitError(ctx, ExitNotFound, nil, "Secret not found")
	}

	revs, err := s.Store.ListRevisions(ctx, name)
	if err != nil {
		return ExitError(ctx, ExitUnknown, err, "Failed to get revisions: %s", err)
	}

	for _, rev := range revs {
		pw := ""
		if showPassword {
			sec, err := s.Store.GetRevision(ctx, name, rev.Hash)
			if err != nil {
				out.Debug(ctx, "Failed to get revision '%s' of '%s': %s", rev.Hash, name, err)
			}
			if err == nil {
				pw = " - " + sec.Password()
			}
		}
		out.Print(ctx, "%s - %s <%s> - %s - %s%s", rev.Hash[:8], rev.AuthorName, rev.AuthorEmail, rev.Date.Format(time.RFC3339), rev.Subject, pw)
	}
	return nil
}
130662
func (c *ConfigLocal) SetUserHistory(uh *kbfsedits.UserHistory) {
	c.lock.Lock()
	defer c.lock.Unlock()
	c.userHistory = uh
}
879991
func userFromOS(u *user.User) (User, error) {
	newUser := User{
		Name: u.Username,
		Home: u.HomeDir,
	}
	id, err := strconv.Atoi(u.Uid)
	if err != nil {
		return newUser, err
	}
	newUser.Uid = id

	id, err = strconv.Atoi(u.Gid)
	if err != nil {
		return newUser, err
	}
	newUser.Gid = id
	return newUser, nil
}
1258317
func NewUserFileMembershipInfo(AccessType *AccessLevel, User *UserInfo) *UserFileMembershipInfo {
	s := new(UserFileMembershipInfo)
	s.AccessType = AccessType
	s.User = User
	s.IsInherited = false
	return s
}
1200386
func (c *collectorImpl) GetUserRecords() map[string]*collector.UserRecord {
	c.Lock()
	defer c.Unlock()

	if len(c.Users) == 0 {
		return nil
	}

	retval := c.Users
	c.Users = map[string]*collector.UserRecord{}
	return retval
}