token recent activity

This commit is contained in:
Unknwon committed 2015-08-19 06:22:33 +08:00
1 parent 54b52de6ee
commit 03b85b73af
6 files changed
+24 -8

No files matched your search

+1
View File
@@ -278,6 +278,7 @@ add_on = Added on
last_used = Last used on last_used = Last used on
no_activity = No recent activity no_activity = No recent activity
key_state_desc = This key is used in last 7 days key_state_desc = This key is used in last 7 days
token_state_desc = This token is used in last 7 days
manage_social = Manage Associated Social Accounts manage_social = Manage Associated Social Accounts
social_desc = This is a list of associated social accounts. Remove any binding that you do not recognize. social_desc = This is a list of associated social accounts. Remove any binding that you do not recognize.
+8 -2
View File
@@ -35,8 +35,8 @@ func NewAccessToken(t *AccessToken) error {
return err return err
} }
// GetAccessTokenBySha returns access token by given sha1. // GetAccessTokenBySHA returns access token by given sha1.
func GetAccessTokenBySha(sha string) (*AccessToken, error) { func GetAccessTokenBySHA(sha string) (*AccessToken, error) {
t := &AccessToken{Sha1: sha} t := &AccessToken{Sha1: sha}
has, err := x.Get(t) has, err := x.Get(t)
if err != nil { if err != nil {
@@ -62,6 +62,12 @@ func ListAccessTokens(uid int64) ([]*AccessToken, error) {
return tokens, nil return tokens, nil
} }
// UpdateAccessToekn updates information of access token.
func UpdateAccessToekn(t *AccessToken) error {
_, err := x.Id(t.ID).AllCols().Update(t)
return err
}
// DeleteAccessTokenByID deletes access token by given ID. // DeleteAccessTokenByID deletes access token by given ID.
func DeleteAccessTokenByID(id int64) error { func DeleteAccessTokenByID(id int64) error {
_, err := x.Id(id).Delete(new(AccessToken)) _, err := x.Id(id).Delete(new(AccessToken))
+7 -2
View File
@@ -8,6 +8,7 @@ import (
"net/http" "net/http"
"reflect" "reflect"
"strings" "strings"
"time"
"github.com/Unknwon/com" "github.com/Unknwon/com"
"github.com/Unknwon/macaron" "github.com/Unknwon/macaron"
@@ -37,13 +38,17 @@ func SignedInId(req *http.Request, sess session.Store) int64 {
if len(auHead) > 0 { if len(auHead) > 0 {
auths := strings.Fields(auHead) auths := strings.Fields(auHead)
if len(auths) == 2 && auths[0] == "token" { if len(auths) == 2 && auths[0] == "token" {
t, err := models.GetAccessTokenBySha(auths[1]) t, err := models.GetAccessTokenBySHA(auths[1])
if err != nil { if err != nil {
if err != models.ErrAccessTokenNotExist { if err != models.ErrAccessTokenNotExist {
log.Error(4, "GetAccessTokenBySha: %v", err) log.Error(4, "GetAccessTokenBySHA: %v", err)
} }
return 0 return 0
} }
t.Updated = time.Now()
if err = models.UpdateAccessToekn(t); err != nil {
log.Error(4, "UpdateAccessToekn: %v", err)
}
return t.UID return t.UID
} }
} }
+2 -2
View File
@@ -772,7 +772,7 @@ func confLocaleLocale_deDeIni() (*asset, error) {
return a, nil return a, nil
} }
var _confLocaleLocale_enUsIni = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xc4\x7d\xfd\x72\xdb\x48\x92\xe7\xff\x78\x0a\xb4\x37\x7c\x76\x47\xc8\x74\x74\x4f\xdc\x47\x4c\xd8\xee\x93\xa5\xf6\xc7\xac\x65\x69\x2d\x79\xe6\xe6\x1c\x0e\x34\x48\x40\x24\x46\x24\xc0\x06\x40\xd1\x9a\x8d\x8d\xb8\xd7\xb8\xd7\xbb\x27\xb9\xcc\x5f\x66\xd6\x07\x00\xca\xf6\xec\xc6\xdd\x3f\x64\xa1\x2a\xeb\x2b\x2b\x2b\x2b\x33\x2b\xab\x2a\xdf\x6e\xb3\xa2\xec\x16\xe9\xf3\xf4\x38\xdd\xe6\x55\xbd\x2e\xbb\x2e\xed\xca\xf5\xf5\x93\x55\xd3\xf5\x65\x91\xbe\xae\x7a\xfa\x6e\x6f\xab\x45\x99\x24\xab\x66\x53\x12\xe8\x1b\xfa\x4b\x8a\xbc\x5b\xcd\x9b\xbc\x2d\x28\xe2\xd4\xc2\x49\xf9\x65\xbb\x6e\x5a\x06\xfa\x55\x42\xc9\xaa\x5c\x6f\x39\x0f\xfd\x25\x5d\xb5\xac\xb3\xaa\xa6\xcf\x4b\x0a\xa5\x6f\xeb\xa4\x6b\x16\x55\xbe\xce\x82\x04\x44\x58\xfa\x1f\xd3\x9f\xeb\x22\xbd\xec\xcb\x6d\xfa\xac\xdb\xe4\xeb\xf5\x8b\xbc\x43\x96\xbe\x4c\xf3\xc5\xa2\xd9\xd5\xfd\xb3\xa7\x92\x20\x85\x37\xbb\xde\x4a\x3f\xdf\xf5\x12\xb7\xdb\x5a\xd4\xc7\x6d\xd2\x96\xcb\x8a\x3a\xd6\x52\xd4\x07\x0d\x26\xfb\x72\xde\x55\x3d\x37\xfa\x2f\x12\x4a\x6e\xcb\xb6\xab\x1a\x6e\xcf\x9f\x25\x94\x6c\xf3\x25\x03\x5c\xd0\x5f\xd2\x97\x9b\xed\x3a\x47\x86\x2b\x0d\x26\xeb\xbc\x5e\xee\x04\xe6\x9d\x06\x93\x45\x5b\x52\x52\x56\x97\x7b\x8a\x3d\xc1\x47\x4a\x1f\xb3\xd9\x2c\xd9\x11\x4e\xb3\x6d\xdb\x5c\x57\xeb\x32\xcb\xeb\x22\xdb\x08\xd6\x3e\x52\x7c\xaa\xf1\x29\xc5\xa7\x1c\x8f\x6e\x94\x05\x21\x28\xcb\x3b\xed\x0b\x0d\x0d\xe1\x2b\xef\x12\x14\x55\xe7\x1b\xcb\xcd\xc1\xa4\xdc\xe4\xd5\x9a\x07\xe1\x09\x07\xa8\xf1\x5d\xb7\x6f\x30\x54\x17\x1a\x24\x44\x64\xfd\xdd\xb6\x04\x1e\x9e\x5c\x51\x28\x59\xe4\xdb\x7e\xb1\xca\xb9\xad\x12\x4a\x08\x68\xdb\x10\x42\x9a\xf6\x0e\x70\xf6\x91\x34\xed\x32\xaf\xab\xbf\xe7\xbd\x20\xe9\x3c\xf8\x4c\x36\x55\xdb\x36\x8c\xdf\x33\x04\x12\xea\x71\xc6\xe5\x50\xcc\x7b\xc2\x44\x50\x0a\xa7\x6c\xaa\x65\x2b\xa8\xe4\xc4\x33\x7c\x71\x29\x9c\x76\xdd\xb4\x37\x9a\xf0\x8a\x83\x83\xac\xd4\x08\x4d\x8d\xeb\xcf\x6b\x42\xbe\xa6\x9e\xe1\x23\x02\xe8\x92\xbc\xd8\x10\x2a\xb7\x79\x5d\x32\x8e\x8e\xf9\x8b\xf0\x42\x5f\x89\xd2\x54\xd6\x95\x7d\x5f\xd5\x4b\x46\xf6\xb1\x44\xa5\x97\x1a\x95\x04\x69\x2e\xee\xae\xd9\xb9\xe1\xa4\xf8\xbf\xd2\x67\x7a\x21\x9f\x92\x16\x64\x42\xa2\xcb\xc9\x3d\xe9\xb2\xeb\xb2\x2c\xa4\x2f\x5d\xfa\x8a\xc2\xc9\x76\xb7\x5e\x13\xd6\x7e\xdf\x95\x5d\xcf\x99\x2e\xe8\x9b\xfa\x2f\xdf\x49\xd5\x75\x14\xa0\xe8\xb7\x08\x24\x34\x74\xf5\x02\x9d\x39\x41\x20\x49\x3e\x75\x65\xde\x2e\x56\x9f\x13\xf9\x47\x5b\x39\xc0\xb4\x77\x68\x50\x99\x90\x94\x88\xa4\x06\xab\x20\x59\x34\x05\x7f\x9c\xd0\x1f\x15\x5d\xd5\x5d\x4f\x33\xee\x73\xa2\x01\x06\x93\x90\x0c\x40\x5f\xf5\xc0\x82\x46\x62\xfa\x76\x3c\x82\xe9\xab\xaa\xed\xfa\x27\x7d\x45\xc4\xfa\x61\x57\x27\xdc\x3f\x9a\x6d\x59\x31\x37\x26\xf4\xba\x21\x14\x21\xba\xa5\xfe\x9d\xdd\x5d\xfe\xcb\xbb\xa3\xf4\x82\x38\xd1\xb2\x2d\x29\x9c\x52\x19\xf4\x47\x79\xfe\x30\x4b\x28\x97\xd5\x74\x9a\xf7\xf9\x3c\xef\x4a\x8f\x56\x4e\x14\xea\x76\x69\xa0\x71\xe6\x6a\xe0\x60\x5d\x1f\xf5\x77\x6a\x86\x50\x19\x3a\xaf\x5c\x19\xef\x79\x72\x51\x3c\x33\x35\x64\xbe\x58\x97\x1c\x4f\x45\xa5\x6f\xdf\xbf\x3f\x3f\x7d\x99\x96\xf5\xb2\xaa\xcb\x74\x5f\xf5\xab\x74\xd7\x5f\xff\xb7\x6c\x59\xd6\x65\x4b\x3c\x6e\x51\xa5\x34\xa7\x5a\xa2\x84\x94\x08\x5b\x3a\x37\x4b\xba\x6e\x4d\x73\x1f\xe8\xbd\xbc\x7c\x97\x9e\x31\x8a\xb7\x79\xbf\x42\x43\xfa\x55\xd2\xfd\xbe\x66\x14\xb9\x0a\xaf\x56\x65\x0a\x2a\x03\x50\x73\x6d\xf8\x48\x0b\x6d\xe3\x2c\x29\xdb\x36\x23\xb6\xd4\xdf\x65\x9a\x59\xcb\x1b\x42\x4a\x11\x44\x3a\x75\xd3\xa7\xf3\x32\x45\x9e\x59\x92\x58\x83\x0d\xbb\xc7\xdb\xed\xba\x5a\xc8\x5c\x7f\x2d\x69\x1e\xd1\xbc\x82\x28\x96\x42\x38\x20\xca\xd2\x02\x74\x11\x7b\xe6\xf9\x90\x46\x0c\x04\xf9\x57\x25\x31\xc0\xd5\x6e\x29\x6c\x6f\xdd\xec\x8a\x1f\x40\xa9\xd6\x7a\x4f\xa8\xe9\x87\x86\x1a\x0c\xec\x38\x00\x5f\xc5\x31\x51\x1c\x2f\x5a\x6d\xb9\x69\x88\xaf\x38\x62\xaf\x88\xa0\xf6\x15\x25\x52\x4f\xbb\xfc\x96\xe6\x5b\xdf\xa4\xfd\xaa\xea\xd2\x82\x88\x6d\xc1\x05\xd3\xd4\xd8\xd1\x72\x21\x64\x41\x04\x2a\xa4\x61\x71\xf1\x18\x00\x6a\xb3\x23\x6a\x5a\x51\x61\xbc\x18\xf1\xca\x49\x45\x4e\xb5\x13\x5d\xa2\x72\x40\xdf\x44\xb9\x0d\x71\x65\xe6\x9b\xa7\x08\xe8\x77\x58\x3e\xb5\x2a\xbf\xbe\xa6\x56\x75\x44\x15\x6f\xd2\xc5\xba\x21\x92\xfa\xf8\xe1\x1d\x65\x5e\xf5\xfd\x36\xdb\x36\x2d\xc8\xf8\xea\xea\x82\xa6\x47\xdb\xfb\xd8\x00\xd7\x0c\x53\xef\x36\x73\xfa\xda\xaf\x2a\x62\x02\x79\x30\x40\x40\xc5\x9a\xd7\xbf\x3a\x6d\xea\x19\xc6\x6a\xd7\xae\x07\xc3\x48\x55\x5a\xca\x81\xe6\x71\x13\x9e\xf2\xcf\xa5\x6f\x25\xba\xdb\x91\x90\xb0\xc7\xa0\x52\x57\x4b\xac\x43\x44\x5b\xcd\x96\xcb\x0d\x88\xeb\x5c\x23\x3c\x45\x61\xed\x72\xe9\xb2\x82\x51\x2a\x44\x90\x80\x0b\x6f\xa8\xc3\x3a\x9b\x2f\xcf\x08\x0d\x98\xd2\x88\xbd\x6e\x9b\x0d\xc5\xbe\xa2\x3f\x1f\xe1\x9b\x7f\xc6\xe5\x01\x26\x2f\x0a\x62\x33\xdd\x51\xfa\xe1\xd5\x49\xfa\x9f\xff\xf0\xf3\xcf\xb3\xf4\x6d\xcf\x13\x82\x69\xe4\x6f\x3c\xb6\x14\x94\xa5\xd4\x81\xd2\xcc\xed\x69\xf8\x1f\x30\x81\x3f\x48\x9f\x21\xf5\xbf\x97\x5f\x72\x12\x03\xca\xd9\xa2\xd9\xbc\xe0\xc9\xbd\xc9\xfb\x59\xc2\x29\x44\x35\x4a\x4e\x97\x65\x5d\x50\x40\x17\x64\x4d\x0b\xb8\x8e\xa6\x07\xcb\xb3\x08\x27\xd9\xa2\xa9\xaf\xab\x96\x3b\xfLine truncated var _confLocaleLocale_enUsIni = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xc4\x7d\xfd\x72\xdb\x48\x92\xe7\xff\x78\x0a\xb4\x37\x7c\x76\x47\xc8\x74\x74\x4f\xdc\x47\x4c\xd8\xee\x93\xa5\xf6\xc7\xac\x65\x69\x2d\x79\xe6\xe6\x1c\x0e\x34\x48\x40\x24\x46\x24\xc0\x06\x40\xd1\x9a\x8d\x8d\xb8\xd7\xb8\xd7\xbb\x27\xb9\xcc\x5f\x66\xd6\x07\x00\xca\xf6\xec\xc6\xdd\x3f\x64\xa1\x2a\xeb\x2b\x2b\x2b\x2b\x33\x2b\xab\x2a\xdf\x6e\xb3\xa2\xec\x16\xe9\xf3\xf4\x38\xdd\xe6\x55\xbd\x2e\xbb\x2e\xed\xca\xf5\xf5\x93\x55\xd3\xf5\x65\x91\xbe\xae\x7a\xfa\x6e\x6f\xab\x45\x99\x24\xab\x66\x53\x12\xe8\x1b\xfa\x4b\x8a\xbc\x5b\xcd\x9b\xbc\x2d\x28\xe2\xd4\xc2\x49\xf9\x65\xbb\x6e\x5a\x06\xfa\x55\x42\xc9\xaa\x5c\x6f\x39\x0f\xfd\x25\x5d\xb5\xac\xb3\xaa\xa6\xcf\x4b\x0a\xa5\x6f\xeb\xa4\x6b\x16\x55\xbe\xce\x82\x04\x44\x58\xfa\x1f\xd3\x9f\xeb\x22\xbd\xec\xcb\x6d\xfa\xac\xdb\xe4\xeb\xf5\x8b\xbc\x43\x96\xbe\x4c\xf3\xc5\xa2\xd9\xd5\xfd\xb3\xa7\x92\x20\x85\x37\xbb\xde\x4a\x3f\xdf\xf5\x12\xb7\xdb\x5a\xd4\xc7\x6d\xd2\x96\xcb\x8a\x3a\xd6\x52\xd4\x07\x0d\x26\xfb\x72\xde\x55\x3d\x37\xfa\x2f\x12\x4a\x6e\xcb\xb6\xab\x1a\x6e\xcf\x9f\x25\x94\x6c\xf3\x25\x03\x5c\xd0\x5f\xd2\x97\x9b\xed\x3a\x47\x86\x2b\x0d\x26\xeb\xbc\x5e\xee\x04\xe6\x9d\x06\x93\x45\x5b\x52\x52\x56\x97\x7b\x8a\x3d\xc1\x47\x4a\x1f\xb3\xd9\x2c\xd9\x11\x4e\xb3\x6d\xdb\x5c\x57\xeb\x32\xcb\xeb\x22\xdb\x08\xd6\x3e\x52\x7c\xaa\xf1\x29\xc5\xa7\x1c\x8f\x6e\x94\x05\x21\x28\xcb\x3b\xed\x0b\x0d\x0d\xe1\x2b\xef\x12\x14\x55\xe7\x1b\xcb\xcd\xc1\xa4\xdc\xe4\xd5\x9a\x07\xe1\x09\x07\xa8\xf1\x5d\xb7\x6f\x30\x54\x17\x1a\x24\x44\x64\xfd\xdd\xb6\x04\x1e\x9e\x5c\x51\x28\x59\xe4\xdb\x7e\xb1\xca\xb9\xad\x12\x4a\x08\x68\xdb\x10\x42\x9a\xf6\x0e\x70\xf6\x91\x34\xed\x32\xaf\xab\xbf\xe7\xbd\x20\xe9\x3c\xf8\x4c\x36\x55\xdb\x36\x8c\xdf\x33\x04\x12\xea\x71\xc6\xe5\x50\xcc\x7b\xc2\x44\x50\x0a\xa7\x6c\xaa\x65\x2b\xa8\xe4\xc4\x33\x7c\x71\x29\x9c\x76\xdd\xb4\x37\x9a\xf0\x8a\x83\x83\xac\xd4\x08\x4d\x8d\xeb\xcf\x6b\x42\xbe\xa6\x9e\xe1\x23\x02\xe8\x92\xbc\xd8\x10\x2a\xb7\x79\x5d\x32\x8e\x8e\xf9\x8b\xf0\x42\x5f\x89\xd2\x54\xd6\x95\x7d\x5f\xd5\x4b\x46\xf6\xb1\x44\xa5\x97\x1a\x95\x04\x69\x2e\xee\xae\xd9\xb9\xe1\xa4\xf8\xbf\xd2\x67\x7a\x21\x9f\x92\x16\x64\x42\xa2\xcb\xc9\x3d\xe9\xb2\xeb\xb2\x2c\xa4\x2f\x5d\xfa\x8a\xc2\xc9\x76\xb7\x5e\x13\xd6\x7e\xdf\x95\x5d\xcf\x99\x2e\xe8\x9b\xfa\x2f\xdf\x49\xd5\x75\x14\xa0\xe8\xb7\x08\x24\x34\x74\xf5\x02\x9d\x39\x41\x20\x49\x3e\x75\x65\xde\x2e\x56\x9f\x13\xf9\x47\x5b\x39\xc0\xb4\x77\x68\x50\x99\x90\x94\x88\xa4\x06\xab\x20\x59\x34\x05\x7f\x9c\xd0\x1f\x15\x5d\xd5\x5d\x4f\x33\xee\x73\xa2\x01\x06\x93\x90\x0c\x40\x5f\xf5\xc0\x82\x46\x62\xfa\x76\x3c\x82\xe9\xab\xaa\xed\xfa\x27\x7d\x45\xc4\xfa\x61\x57\x27\xdc\x3f\x9a\x6d\x59\x31\x37\x26\xf4\xba\x21\x14\x21\xba\xa5\xfe\x9d\xdd\x5d\xfe\xcb\xbb\xa3\xf4\x82\x38\xd1\xb2\x2d\x29\x9c\x52\x19\xf4\x47\x79\xfe\x30\x4b\x28\x97\xd5\x74\x9a\xf7\xf9\x3c\xef\x4a\x8f\x56\x4e\x14\xea\x76\x69\xa0\x71\xe6\x6a\xe0\x60\x5d\x1f\xf5\x77\x6a\x86\x50\x19\x3a\xaf\x5c\x19\xef\x79\x72\x51\x3c\x33\x35\x64\xbe\x58\x97\x1c\x4f\x45\xa5\x6f\xdf\xbf\x3f\x3f\x7d\x99\x96\xf5\xb2\xaa\xcb\x74\x5f\xf5\xab\x74\xd7\x5f\xff\xb7\x6c\x59\xd6\x65\x4b\x3c\x6e\x51\xa5\x34\xa7\x5a\xa2\x84\x94\x08\x5b\x3a\x37\x4b\xba\x6e\x4d\x73\x1f\xe8\xbd\xbc\x7c\x97\x9e\x31\x8a\xb7\x79\xbf\x42\x43\xfa\x55\xd2\xfd\xbe\x66\x14\xb9\x0a\xaf\x56\x65\x0a\x2a\x03\x50\x73\x6d\xf8\x48\x0b\x6d\xe3\x2c\x29\xdb\x36\x23\xb6\xd4\xdf\x65\x9a\x59\xcb\x1b\x42\x4a\x11\x44\x3a\x75\xd3\xa7\xf3\x32\x45\x9e\x59\x92\x58\x83\x0d\xbb\xc7\xdb\xed\xba\x5a\xc8\x5c\x7f\x2d\x69\x1e\xd1\xbc\x82\x28\x96\x42\x38\x20\xca\xd2\x02\x74\x11\x7b\xe6\xf9\x90\x46\x0c\x04\xf9\x57\x25\x31\xc0\xd5\x6e\x29\x6c\x6f\xdd\xec\x8a\x1f\x40\xa9\xd6\x7a\x4f\xa8\xe9\x87\x86\x1a\x0c\xec\x38\x00\x5f\xc5\x31\x51\x1c\x2f\x5a\x6d\xb9\x69\x88\xaf\x38\x62\xaf\x88\xa0\xf6\x15\x25\x52\x4f\xbb\xfc\x96\xe6\x5b\xdf\xa4\xfd\xaa\xea\xd2\x82\x88\x6d\xc1\x05\xd3\xd4\xd8\xd1\x72\x21\x64\x41\x04\x2a\xa4\x61\x71\xf1\x18\x00\x6a\xb3\x23\x6a\x5a\x51\x61\xbc\x18\xf1\xca\x49\x45\x4e\xb5\x13\x5d\xa2\x72\x40\xdf\x44\xb9\x0d\x71\x65\xe6\x9b\xa7\x08\xe8\x77\x58\x3e\xb5\x2a\xbf\xbe\xa6\x56\x75\x44\x15\x6f\xd2\xc5\xba\x21\x92\xfa\xf8\xe1\x1d\x65\x5e\xf5\xfd\x36\xdb\x36\x2d\xc8\xf8\xea\xea\x82\xa6\x47\xdb\xfb\xd8\x00\xd7\x0c\x53\xef\x36\x73\xfa\xda\xaf\x2a\x62\x02\x79\x30\x40\x40\xc5\x9a\xd7\xbf\x3a\x6d\xea\x19\xc6\x6a\xd7\xae\x07\xc3\x48\x55\x5a\xca\x81\xe6\x71\x13\x9e\xf2\xcf\xa5\x6f\x25\xba\xdb\x91\x90\xb0\xc7\xa0\x52\x57\x4b\xac\x43\x44\x5b\xcd\x96\xcb\x0d\x88\xeb\x5c\x23\x3c\x45\x61\xed\x72\xe9\xb2\x82\x51\x2a\x44\x90\x80\x0b\x6f\xa8\xc3\x3a\x9b\x2f\xcf\x08\x0d\x98\xd2\x88\xbd\x6e\x9b\x0d\xc5\xbe\xa2\x3f\x1f\xe1\x9b\x7f\xc6\xe5\x01\x26\x2f\x0a\x62\x33\xdd\x51\xfa\xe1\xd5\x49\xfa\x9f\xff\xf0\xf3\xcf\xb3\xf4\x6d\xcf\x13\x82\x69\xe4\x6f\x3c\xb6\x14\x94\xa5\xd4\x81\xd2\xcc\xed\x69\xf8\x1f\x30\x81\x3f\x48\x9f\x21\xf5\xbf\x97\x5f\x72\x12\x03\xca\xd9\xa2\xd9\xbc\xe0\xc9\xbd\xc9\xfb\x59\xc2\x29\x44\x35\x4a\x4e\x97\x65\x5d\x50\x40\x17\x64\x4d\x0b\xb8\x8e\xa6\x07\xcb\xb3\x08\x27\xd9\xa2\xa9\xaf\xab\x96\x3b\xfLine truncated
func confLocaleLocale_enUsIniBytes() ([]byte, error) { func confLocaleLocale_enUsIniBytes() ([]byte, error) {
return bindataRead( return bindataRead(
@@ -787,7 +787,7 @@ func confLocaleLocale_enUsIni() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "conf/locale/locale_en-US.ini", size: 38486, mode: os.FileMode(420), modTime: time.Unix(1439926073, 0)} info := bindataFileInfo{name: "conf/locale/locale_en-US.ini", size: 38539, mode: os.FileMode(420), modTime: time.Unix(1439936510, 0)}
a := &asset{bytes: bytes, info: info} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
+5 -1
View File
@@ -113,7 +113,7 @@ func Http(ctx *middleware.Context) {
} }
// Assume username now is a token. // Assume username now is a token.
token, err := models.GetAccessTokenBySha(authUsername) token, err := models.GetAccessTokenBySHA(authUsername)
if err != nil { if err != nil {
if err == models.ErrAccessTokenNotExist { if err == models.ErrAccessTokenNotExist {
ctx.HandleText(401, "invalid token") ctx.HandleText(401, "invalid token")
@@ -122,6 +122,10 @@ func Http(ctx *middleware.Context) {
} }
return return
} }
token.Updated = time.Now()
if err = models.UpdateAccessToekn(token); err != nil {
ctx.Handle(500, "UpdateAccessToekn", err)
}
authUser, err = models.GetUserByID(token.UID) authUser, err = models.GetUserByID(token.UID)
if err != nil { if err != nil {
ctx.Handle(500, "GetUserById", err) ctx.Handle(500, "GetUserById", err)
+1 -1
View File
@@ -19,7 +19,7 @@
{{range .Tokens}} {{range .Tokens}}
<div class="item ui grid"> <div class="item ui grid">
<div class="one wide column"> <div class="one wide column">
<i class="ssh-key-state-indicator fa fa-circle{{if .HasRecentActivity}} active invert poping up{{else}}-o{{end}}" {{if .HasRecentActivity}}data-content="{{$.i18n.Tr "settings.key_state_desc"}}" data-variation="inverted"{{end}}></i> <i class="ssh-key-state-indicator fa fa-circle{{if .HasRecentActivity}} active invert poping up{{else}}-o{{end}}" {{if .HasRecentActivity}}data-content="{{$.i18n.Tr "settings.token_state_desc"}}" data-variation="inverted"{{end}}></i>
</div> </div>
<div class="one wide column"> <div class="one wide column">
<i class="fa fa-send fa-2x left"></i> <i class="fa fa-send fa-2x left"></i>