diff --git a/main.go b/main.go index 8526068..2499fa8 100644 --- a/main.go +++ b/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)