From e7b233348165dad67803f62fbd9dfb0d2224c42e Mon Sep 17 00:00:00 2001 From: Azareal Date: Thu, 2 Apr 2020 21:00:01 +1000 Subject: [PATCH] update second scratch slot properly --- common/mfa_store.go | 10 +++++----- templates/convo_row.html | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/common/mfa_store.go b/common/mfa_store.go index ba9bd614..051ca822 100644 --- a/common/mfa_store.go +++ b/common/mfa_store.go @@ -5,7 +5,7 @@ import ( "errors" "strings" - "github.com/Azareal/Gosora/query_gen" + qgen "github.com/Azareal/Gosora/query_gen" ) var MFAstore MFAStore @@ -21,8 +21,8 @@ var mfaItemStmts MFAItemStmts func init() { DbInits.Add(func(acc *qgen.Accumulator) error { mfaItemStmts = MFAItemStmts{ - update: acc.Update("users_2fa_keys").Set("scratch1 = ?, scratch2, scratch3 = ?, scratch3 = ?, scratch4 = ?, scratch5 = ?, scratch6 = ?, scratch7 = ?, scratch8 = ?").Where("uid = ?").Prepare(), - delete: acc.Delete("users_2fa_keys").Where("uid = ?").Prepare(), + update: acc.Update("users_2fa_keys").Set("scratch1=?,scratch2=?,scratch3=?,scratch4=?,scratch5=?,scratch6=?,scratch7=?,scratch8=?").Where("uid=?").Prepare(), + delete: acc.Delete("users_2fa_keys").Where("uid=?").Prepare(), } return acc.FirstError() }) @@ -70,8 +70,8 @@ type SQLMFAStore struct { func NewSQLMFAStore(acc *qgen.Accumulator) (*SQLMFAStore, error) { return &SQLMFAStore{ - get: acc.Select("users_2fa_keys").Columns("secret, scratch1, scratch2, scratch3, scratch4, scratch5, scratch6, scratch7, scratch8").Where("uid = ?").Prepare(), - create: acc.Insert("users_2fa_keys").Columns("uid, secret, scratch1, scratch2, scratch3, scratch4, scratch5, scratch6, scratch7, scratch8, createdAt").Fields("?,?,?,?,?,?,?,?,?,?,UTC_TIMESTAMP()").Prepare(), + get: acc.Select("users_2fa_keys").Columns("secret,scratch1,scratch2,scratch3,scratch4,scratch5,scratch6,scratch7,scratch8").Where("uid=?").Prepare(), + create: acc.Insert("users_2fa_keys").Columns("uid,secret,scratch1,scratch2,scratch3,scratch4,scratch5,scratch6,scratch7,scratch8,createdAt").Fields("?,?,?,?,?,?,?,?,?,?,UTC_TIMESTAMP()").Prepare(), }, acc.FirstError() } diff --git a/templates/convo_row.html b/templates/convo_row.html index ebb40268..d690c71c 100644 --- a/templates/convo_row.html +++ b/templates/convo_row.html @@ -4,7 +4,7 @@
{{.Body}} - {{.User.Name}}   + {{.User.Name}}   {{if .CanModify}} @@ -12,7 +12,7 @@ - {{if .User.Tag}}{{.User.Tag}}{{end}} + {{if .User.Tag}}{{.User.Tag}}{{end}}
{{end}}