Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
e750508d
Commit
e750508d
authored
Jan 19, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes for update user and add token
parent
90925273
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
2 deletions
+18
-2
grafana
+1
-1
pkg/services/sqlstore/tokens.go
+1
-1
pkg/services/sqlstore/user.go
+16
-0
No files found.
grafana
@
efe7279e
Subproject commit
1c5f902770c260f9bc63a0f07f1e9d22f60ce796
Subproject commit
efe7279eadeffc4ba9f5a7b340e4ecdf4d208218
pkg/services/sqlstore/tokens.go
View file @
e750508d
...
...
@@ -13,7 +13,7 @@ func init() {
bus
.
AddHandler
(
"sql"
,
GetTokenByToken
)
bus
.
AddHandler
(
"sql"
,
UpdateToken
)
bus
.
AddHandler
(
"sql"
,
DeleteToken
)
bus
.
AddHandler
(
"sql"
,
Delete
Token
)
bus
.
AddHandler
(
"sql"
,
Add
Token
)
}
func
GetTokens
(
query
*
m
.
GetTokensQuery
)
error
{
...
...
pkg/services/sqlstore/user.go
View file @
e750508d
...
...
@@ -12,6 +12,7 @@ import (
func
init
()
{
bus
.
AddHandler
(
"sql"
,
CreateUser
)
bus
.
AddHandler
(
"sql"
,
UpdateUser
)
bus
.
AddHandler
(
"sql"
,
GetUserByLogin
)
bus
.
AddHandler
(
"sql"
,
SetUsingAccount
)
bus
.
AddHandler
(
"sql"
,
GetUserInfo
)
...
...
@@ -92,6 +93,21 @@ func GetUserByLogin(query *m.GetUserByLoginQuery) error {
return
nil
}
func
UpdateUser
(
cmd
*
m
.
UpdateUserCommand
)
error
{
return
inTransaction
(
func
(
sess
*
xorm
.
Session
)
error
{
user
:=
m
.
User
{
Name
:
cmd
.
Name
,
Email
:
cmd
.
Email
,
Login
:
cmd
.
Login
,
Updated
:
time
.
Now
(),
}
_
,
err
:=
sess
.
Id
(
cmd
.
UserId
)
.
Update
(
&
user
)
return
err
})
}
func
SetUsingAccount
(
cmd
*
m
.
SetUsingAccountCommand
)
error
{
return
inTransaction
(
func
(
sess
*
xorm
.
Session
)
error
{
user
:=
m
.
User
{}
...
...
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