// user <name> <password>
544378
func (ip *Interpreter) user(args []string) {
	uid, err := ip.Backend.CreateUser(args[0], args[1])
	ip.intResponder(uid, err)
}
112552
func (session *Session) User() (id string, err error) {
	if session.id != "" {
		id = session.id
		return
	}

	if session.accessToken == "" && session.HttpClient == nil {
		err = fmt.Errorf("access token is not set")
		return
	}

	var result Result
	result, err = session.Api("/me", GET, Params{"fields": "id"})

	if err != nil {
		return
	}

	err = result.DecodeField("id", &id)

	if err != nil {
		return
	}

	return
}
751722
func (p *OAuth) User(ctx echo.Context) (u goth.User) {
	u, _ = ctx.Get(p.Config.ContextKey).(goth.User)
	return u
}
1087336
func (b MongodbAuthBackend) User(username string) (user UserData, e error) {
	var result UserData

	c := b.connect()
	defer c.Database.Session.Close()

	err := c.Find(bson.M{"Username": username}).One(&result)
	if err != nil {
		return result, ErrMissingUser
	}
	return result, nil
}
479601
func (a *Account) RegisterUser(username, email, password string) error {
	user := registerUserReq{
		Username: username,
		Email:    email,
		Password: password,
	}

	err := a.post(auth.Public, "/api/v2/users", user, nil)
	if err != nil {
		return fmt.Errorf("Could not register user: %s", err)
	}
	return nil
}
1303730
func (c *Clientset) User() userinternalversion.UserInterface {
	return &fakeuserinternalversion.FakeUser{Fake: &c.Fake}
}
1084982
func (c *Client) LockUser(p *LockUserParameter) (*User, error) {
	obj, err := c.Request("lockUser", convertParamToMap(p))
	if err != nil {
		return nil, err
	}
	return obj.(*User), err
}
806087
func (f UserConversionFunc) User(chain []*x509.Certificate) (*authenticator.Response, bool, error) {
	return f(chain)
}
614252
func (s *UsersService) CreateUser(body User, headers, queryParams map[string]interface{}) (*http.Response, error) {
	var err error

	resp, err := s.client.doReqWithBody("POST", s.client.BaseURI+"/users", &body, headers, queryParams)
	if err != nil {
		return nil, err
	}
	defer resp.Body.Close()

	return resp, err
}
1066313
func (o *OIDCAuthenticator) Username(claims *Claims) string {
	return getUsername(o.usernameClaim, claims)
}
603702
func (s *FileStorage) user(email string) string {
	if email == "" {
		email = emptyEmail
	}
	email = strings.ToLower(email)
	return filepath.Join(s.users(), email)
}
1287053
func (pt *PlaylistTrack) User() *User {
	sp_user := C.sp_playlist_track_creator(pt.playlist.sp_playlist, C.int(pt.index))
	return newUser(pt.playlist.session, sp_user)
}
1099643
func (c *Client) User(userToken string) *UserClient {
	return &UserClient{
		UserToken: userToken,
		Client:    *c,
	}
}
630413
func (b SqlAuthBackend) User(username string) (user UserData, e error) {
	row := b.userStmt.QueryRow(username)
	err := row.Scan(&user.Email, &user.Hash, &user.Role)
	if err != nil {
		if err == sql.ErrNoRows {
			return user, ErrMissingUser
		}
		return user, mksqlerror(err.Error())
	}
	user.Username = username
	return user, nil
}
33521
func (s *UserService) CreateUser(p *CreateUserParams) (*CreateUserResponse, error) {
	resp, err := s.cs.newRequest("createUser", p.toURLValues())
	if err != nil {
		return nil, err
	}

	if resp, err = getRawValue(resp); err != nil {
		return nil, err
	}

	var r CreateUserResponse
	if err := json.Unmarshal(resp, &r); err != nil {
		return nil, err
	}

	return &r, nil
}
203396
func (c *client) Users(ctx context.Context) ([]User, error) {
	req, err := c.conn.NewRequest("GET", "/_api/user")
	if err != nil {
		return nil, WithStack(err)
	}
	resp, err := c.conn.Do(ctx, req)
	if err != nil {
		return nil, WithStack(err)
	}
	if err := resp.CheckStatus(200); err != nil {
		return nil, WithStack(err)
	}
	var data listUsersResponse
	if err := resp.ParseBody("", &data); err != nil {
		return nil, WithStack(err)
	}
	result := make([]User, 0, len(data.Result))
	for _, userData := range data.Result {
		u, err := newUser(userData, c.conn)
		if err != nil {
			return nil, WithStack(err)
		}
		result = append(result, u)
	}
	return result, nil
}
513042
func (c *Client) GetUser(username string) (rec *UserInfo, err error) {
	req, err := newGETRequest(c, "users/"+PathEscape(username))
	if err != nil {
		return nil, err
	}

	if err = executeAndParseRequest(c, req, &rec); err != nil {
		return nil, err
	}

	return rec, nil
}