Add Getuserid
This commit is contained in:
parent
9093104c28
commit
4767b8556a
11
main.go
11
main.go
|
@ -140,6 +140,17 @@ func ChangePassword(username, oldpass, newpass string) bool {
|
|||
return true
|
||||
|
||||
}
|
||||
|
||||
func GetUserid(username string) int64 {
|
||||
var i int64
|
||||
q:=fmt.Sprintf("select userid from %s_auth where username=$1", c.TablePrefix)
|
||||
err:=c.db.Get(&i, q, username)
|
||||
if err != nil {
|
||||
log.Printf("scsusers.getUserId: Error loading user: %s : %s\n", username, err.Error())
|
||||
return 0
|
||||
}
|
||||
return i
|
||||
}
|
||||
func LoadUser(username string) (UserData, error) {
|
||||
var u UserData
|
||||
q:=fmt.Sprintf("select data from %s_userdata where username=$1", c.TablePrefix)
|
||||
|
|
Loading…
Reference in New Issue