mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-23 02:35:49 +08:00
Add GetUserNoCheck().
This commit is contained in:
parent
91c0282040
commit
9eb09b7db0
@ -166,7 +166,7 @@ func (c *ApiController) UploadResource() {
|
||||
switch tag {
|
||||
case "avatar":
|
||||
if user == nil {
|
||||
user = object.GetUser(username)
|
||||
user = object.GetUserNoCheck(username)
|
||||
if user == nil {
|
||||
c.ResponseError("user is nil for tag: \"avatar\"")
|
||||
return
|
||||
|
@ -200,6 +200,11 @@ func GetUser(id string) *User {
|
||||
return getUser(owner, name)
|
||||
}
|
||||
|
||||
func GetUserNoCheck(id string) *User {
|
||||
owner, name := util.GetOwnerAndNameFromIdNoCheck(id)
|
||||
return getUser(owner, name)
|
||||
}
|
||||
|
||||
func GetMaskedUser(user *User) *User {
|
||||
if user == nil {
|
||||
return nil
|
||||
@ -233,7 +238,7 @@ func GetLastUser(owner string) *User {
|
||||
}
|
||||
|
||||
func UpdateUser(id string, user *User) bool {
|
||||
owner, name := util.GetOwnerAndNameFromId(id)
|
||||
owner, name := util.GetOwnerAndNameFromIdNoCheck(id)
|
||||
oldUser := getUser(owner, name)
|
||||
if oldUser == nil {
|
||||
return false
|
||||
|
Loading…
x
Reference in New Issue
Block a user