update second scratch slot properly
This commit is contained in:
parent
581f86eeba
commit
e7b2333481
@ -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()
|
||||
}
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
<div id="post-{{.ID}}" class="rowitem passive deletable_block editable_parent simple {{.ClassName}}" style="background-image:url({{.User.Avatar}}),url(/s/post-avatar-bg.jpg);background-position:0px {{if le .ContentLines 5}}-1{{end}}0px;">
|
||||
<span class="editable_block user_content simple">{{.Body}}</span>
|
||||
<span class="controls">
|
||||
<a href="{{.User.Link}}" class="real_username username">{{.User.Name}}</a>
|
||||
<a href="{{.User.Link}}"class="real_username username">{{.User.Name}}</a>
|
||||
|
||||
{{if .CanModify}}<a href="/user/convo/edit/submit/{{.ID}}?s={{$.CurrentUser.Session}}" class="mod_button" title="{{lang "profile.comments_edit_tooltip"}}" aria-label="{{lang "profile.comments_edit_aria"}}"><button class="username edit_item edit_label"></button></a>
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
|
||||
<a class="mod_button" href="/report/submit/{{.ID}}?s={{$.CurrentUser.Session}}&type=convo-reply"><button class="username report_item flag_label" title="{{lang "profile.comments_report_tooltip"}}" aria-label="{{lang "profile.comments_report_aria"}}"></button></a>
|
||||
|
||||
{{if .User.Tag}}<a class="username hide_on_mobile user_tag" style="float:right;">{{.User.Tag}}</a>{{end}}
|
||||
{{if .User.Tag}}<a class="username hide_on_mobile user_tag"style="float:right;">{{.User.Tag}}</a>{{end}}
|
||||
</span>
|
||||
</div>
|
||||
{{end}}
|
||||
|
Loading…
Reference in New Issue
Block a user