BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
a7345e36
Unverified
Commit
a7345e36
authored
Jun 13, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix gravatar size and update docs for new users API
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
ae564c97
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
1 deletion
+54
-1
user.rb
app/models/user.rb
+1
-1
users.md
doc/api/users.md
+53
-0
No files found.
app/models/user.rb
View file @
a7345e36
...
...
@@ -487,7 +487,7 @@ class User < ActiveRecord::Base
if
avatar
.
present?
URI
::
join
(
Gitlab
.
config
.
gitlab
.
url
,
avatar
.
url
).
to_s
else
GravatarService
.
new
.
execute
(
email
)
GravatarService
.
new
.
execute
(
email
,
size
)
end
end
end
doc/api/users.md
View file @
a7345e36
...
...
@@ -6,6 +6,34 @@ Get a list of users.
This function takes pagination parameters
`page`
and
`per_page`
to restrict the list of users.
### For normal users:
```
GET /users
```
```
json
[
{
"id"
:
1
,
"username"
:
"john_smith"
,
"name"
:
"John Smith"
,
"state"
:
"active"
,
"avatar_url"
:
"http://localhost:3000/uploads/user/avatar/1/cd8.jpeg"
,
},
{
"id"
:
2
,
"username"
:
"jack_smith"
,
"name"
:
"Jack Smith"
,
"state"
:
"blocked"
,
"avatar_url"
:
"http://gravatar.com/../e32131cd8.jpeg"
,
}
]
```
### For admins:
```
GET /users
```
...
...
@@ -29,6 +57,7 @@ GET /users
"theme_id"
:
1
,
"color_scheme_id"
:
2
,
"is_admin"
:
false
,
"avatar_url"
:
"http://localhost:3000/uploads/user/avatar/1/cd8.jpeg"
,
"can_create_group"
:
true
},
{
...
...
@@ -48,6 +77,7 @@ GET /users
"theme_id"
:
1
,
"color_scheme_id"
:
3
,
"is_admin"
:
false
,
"avatar_url"
:
"http://localhost:3000/uploads/user/avatar/1/cd8.jpeg"
,
"can_create_group"
:
true
,
"can_create_project"
:
true
}
...
...
@@ -62,6 +92,29 @@ Also see `def search query` in `app/models/user.rb`.
Get a single user.
#### For user:
```
GET /users/:id
```
Parameters:
-
`id`
(required) - The ID of a user
```
json
{
"id"
:
1
,
"username"
:
"john_smith"
,
"name"
:
"John Smith"
,
"state"
:
"active"
,
"avatar_url"
:
"http://localhost:3000/uploads/user/avatar/1/cd8.jpeg"
,
}
```
#### For admin:
```
GET /users/:id
```
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment