parent
95d3f9ebe1
commit
8b059ac877
|
@ -181,7 +181,7 @@ func InternalErrorXML(err error, w http.ResponseWriter, r *http.Request) RouteEr
|
||||||
func SilentInternalErrorXML(err error, w http.ResponseWriter, r *http.Request) RouteError {
|
func SilentInternalErrorXML(err error, w http.ResponseWriter, r *http.Request) RouteError {
|
||||||
w.Header().Set("Content-Type", "application/xml")
|
w.Header().Set("Content-Type", "application/xml")
|
||||||
w.WriteHeader(500)
|
w.WriteHeader(500)
|
||||||
w.Write([]byte(`<?xml version="1.0" encoding="UTF-8"?>
|
w.Write([]byte(`<?xml version="1.0"encoding="UTF-8"?>
|
||||||
<error>` + phrases.GetErrorPhrase("internal_error_body") + `</error>`))
|
<error>` + phrases.GetErrorPhrase("internal_error_body") + `</error>`))
|
||||||
log.Print("InternalError: ", err)
|
log.Print("InternalError: ", err)
|
||||||
return HandledRouteError()
|
return HandledRouteError()
|
||||||
|
|
|
@ -64,7 +64,7 @@ func NewDefaultTopicStore(cache TopicCache) (*DefaultTopicStore, error) {
|
||||||
t := "topics"
|
t := "topics"
|
||||||
return &DefaultTopicStore{
|
return &DefaultTopicStore{
|
||||||
cache: cache,
|
cache: cache,
|
||||||
get: acc.Select(t).Columns("title, content, createdBy, createdAt, lastReplyBy, lastReplyAt, lastReplyID, is_closed, sticky, parentID, ip, views, postCount, likeCount, attachCount, poll, data").Where("tid=?").Prepare(),
|
get: acc.Select(t).Columns("title,content,createdBy,createdAt,lastReplyBy,lastReplyAt,lastReplyID,is_closed,sticky,parentID,ip,views,postCount,likeCount,attachCount,poll,data").Where("tid=?").Prepare(),
|
||||||
exists: acc.Exists(t, "tid").Prepare(),
|
exists: acc.Exists(t, "tid").Prepare(),
|
||||||
count: acc.Count(t).Prepare(),
|
count: acc.Count(t).Prepare(),
|
||||||
countUser: acc.Count(t).Where("createdBy=?").Prepare(),
|
countUser: acc.Count(t).Where("createdBy=?").Prepare(),
|
||||||
|
|
|
@ -53,7 +53,7 @@ func NewDefaultUserStore(cache UserCache) (*DefaultUserStore, error) {
|
||||||
cache = NewNullUserCache()
|
cache = NewNullUserCache()
|
||||||
}
|
}
|
||||||
u := "users"
|
u := "users"
|
||||||
allCols := "uid, name, group, active, is_super_admin, session, email, avatar, message, level, score, posts, liked, last_ip, temp_group, createdAt, enable_embeds"
|
allCols := "uid,name,group,active,is_super_admin,session,email,avatar,message,level,score,posts,liked,last_ip,temp_group,createdAt,enable_embeds"
|
||||||
// TODO: Add an admin version of registerStmt with more flexibility?
|
// TODO: Add an admin version of registerStmt with more flexibility?
|
||||||
return &DefaultUserStore{
|
return &DefaultUserStore{
|
||||||
cache: cache,
|
cache: cache,
|
||||||
|
|
|
@ -14,16 +14,16 @@ type searchAndFilter struct {
|
||||||
|
|
||||||
func widgetSearchAndFilter(widget *Widget, hvars interface{}) (out string, err error) {
|
func widgetSearchAndFilter(widget *Widget, hvars interface{}) (out string, err error) {
|
||||||
header := hvars.(*Header)
|
header := hvars.(*Header)
|
||||||
user := header.CurrentUser
|
u := header.CurrentUser
|
||||||
var forums []filterForum
|
var forums []filterForum
|
||||||
var canSee []int
|
var canSee []int
|
||||||
if user.IsSuperAdmin {
|
if u.IsSuperAdmin {
|
||||||
canSee, err = Forums.GetAllVisibleIDs()
|
canSee, err = Forums.GetAllVisibleIDs()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
group, err := Groups.Get(user.Group)
|
group, err := Groups.Get(u.Group)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// TODO: Revisit this
|
// TODO: Revisit this
|
||||||
return "", errors.New("Something weird happened")
|
return "", errors.New("Something weird happened")
|
||||||
|
|
|
@ -1841,6 +1841,13 @@ func TestMFAStore(t *testing.T) {
|
||||||
it, err = c.MFAstore.Get(1)
|
it, err = c.MFAstore.Get(1)
|
||||||
test(i)
|
test(i)
|
||||||
}
|
}
|
||||||
|
expectNilErr(t, it.Delete())
|
||||||
|
_, err = c.MFAstore.Get(-1)
|
||||||
|
recordMustNotExist(t, err, "mfa uid -1 should not exist")
|
||||||
|
_, err = c.MFAstore.Get(0)
|
||||||
|
recordMustNotExist(t, err, "mfa uid 0 should not exist")
|
||||||
|
_, err = c.MFAstore.Get(1)
|
||||||
|
recordMustNotExist(t, err, "mfa uid 1 should not exist")
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Expand upon the valid characters which can go in URLs?
|
// TODO: Expand upon the valid characters which can go in URLs?
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
<form id="avatar_form" action="/user/edit/avatar/submit/?s={{.CurrentUser.Session}}" method="post" enctype="multipart/form-data"></form>
|
<form id="avatar_form"action="/user/edit/avatar/submit/?s={{.CurrentUser.Session}}"method="post"enctype="multipart/form-data"></form>
|
||||||
<div class="coldyn_block">
|
<div class="coldyn_block">
|
||||||
<div id="dash_left" class="coldyn_item">
|
<div id="dash_left" class="coldyn_item">
|
||||||
<div class="rowitem">
|
<div class="rowitem">
|
||||||
<span id="dash_username">
|
<span id="dash_username">
|
||||||
<form id="dash_username_form" action="/user/edit/username/submit/?s={{.CurrentUser.Session}}" method="post"></form>
|
<form id="dash_username_form"action="/user/edit/username/submit/?s={{.CurrentUser.Session}}"method="post"></form>
|
||||||
<form id="revoke_avatar_form" action="/user/edit/avatar/revoke/submit/?s={{.CurrentUser.Session}}" method="post"></form>
|
<form id="revoke_avatar_form"action="/user/edit/avatar/revoke/submit/?s={{.CurrentUser.Session}}"method="post"></form>
|
||||||
<input form="dash_username_form" name="new-name" value="{{.CurrentUser.Name}}">
|
<input form="dash_username_form"name="new-name"value="{{.CurrentUser.Name}}">
|
||||||
<button form="dash_username_form" class="formbutton">{{lang "account_username_save"}}</button>
|
<button form="dash_username_form"class="formbutton">{{lang "account_username_save"}}</button>
|
||||||
</span>
|
</span>
|
||||||
<img src="{{.CurrentUser.Avatar}}"height="128px">
|
<img src="{{.CurrentUser.Avatar}}"height="128px">
|
||||||
<span id="dash_avatar_buttons">
|
<span id="dash_avatar_buttons">
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="colstack_item the_form">
|
<div class="colstack_item the_form">
|
||||||
<form action="/user/edit/mfa/setup/submit/?s={{.CurrentUser.Session}}" method="post">
|
<form action="/user/edit/mfa/setup/submit/?s={{.CurrentUser.Session}}" method="post">
|
||||||
<input name="code" value="{{.Something}}" type="hidden">
|
<input name="code"value="{{.Something}}"type="hidden">
|
||||||
<div class="formrow real_first_child">
|
<div class="formrow real_first_child">
|
||||||
<div class="formitem formlabel"><a>{{lang "account_mfa_setup_explanation"}}</a></div>
|
<div class="formitem formlabel"><a>{{lang "account_mfa_setup_explanation"}}</a></div>
|
||||||
<div class="formitem formlabel">{{.Something}}</div>
|
<div class="formitem formlabel">{{.Something}}</div>
|
||||||
|
|
|
@ -1,21 +1,21 @@
|
||||||
{{range .Posts}}
|
{{range .Posts}}
|
||||||
<div id="post-{{.ID}}" class="rowitem passive deletable_block editable_parent comment {{.ClassName}}">
|
<div id="post-{{.ID}}"class="rowitem passive deletable_block editable_parent comment {{.ClassName}}">
|
||||||
<div class="topRow">
|
<div class="topRow">
|
||||||
<div class="userbit">
|
<div class="userbit">
|
||||||
<img src="{{.User.MicroAvatar}}" alt="Avatar" title="{{.User.Name}}'s Avatar" aria-hidden="true">
|
<img src="{{.User.MicroAvatar}}"alt="Avatar"title="{{.User.Name}}'s Avatar"aria-hidden="true">
|
||||||
<span class="nameAndTitle">
|
<span class="nameAndTitle">
|
||||||
<a href="{{.User.Link}}" class="real_username username">{{.User.Name}}</a>
|
<a href="{{.User.Link}}"class="real_username username">{{.User.Name}}</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>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<span class="controls">
|
<span class="controls">
|
||||||
{{if .CanModify}}
|
{{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>
|
<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>
|
||||||
|
|
||||||
<a href="/user/convo/delete/submit/{{.ID}}?s={{$.CurrentUser.Session}}" class="mod_button" title="{{lang "profile.comments_delete_tooltip"}}" aria-label="{{lang "profile.comments_delete_aria"}}"><button class="username delete_item delete_label"></button></a>
|
<a href="/user/convo/delete/submit/{{.ID}}?s={{$.CurrentUser.Session}}"class="mod_button"title="{{lang "profile.comments_delete_tooltip"}}" aria-label="{{lang "profile.comments_delete_aria"}}"><button class="username delete_item delete_label"></button></a>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
<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>
|
<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>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="content_column">
|
<div class="content_column">
|
||||||
|
|
|
@ -24,8 +24,8 @@ type Widget struct {
|
||||||
<a class="panel_compacttext to_right">{{$widget.Location}}</a>
|
<a class="panel_compacttext to_right">{{$widget.Location}}</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="widget_edit show_on_block_edit">
|
<div class="widget_edit show_on_block_edit">
|
||||||
<form action="/panel/themes/widgets/edit/submit/{{$widget.ID}}" method="post">
|
<form action="/panel/themes/widgets/edit/submit/{{$widget.ID}}"method="post">
|
||||||
<input class="wside" name="wside" value="{{$name}}" type="hidden">
|
<input class="wside"name="wside"value="{{$name}}"type="hidden">
|
||||||
{{template "panel_themes_widgets_widget.html" $widget }}
|
{{template "panel_themes_widgets_widget.html" $widget }}
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
@ -39,13 +39,13 @@ type Widget struct {
|
||||||
<div id="widgetTmpl">
|
<div id="widgetTmpl">
|
||||||
<div class="rowitem panel_compactrow editable_parent widget_item blank_widget bg_red">
|
<div class="rowitem panel_compactrow editable_parent widget_item blank_widget bg_red">
|
||||||
<div class="widget_normal editable_block hide_on_block_edit">
|
<div class="widget_normal editable_block hide_on_block_edit">
|
||||||
<a href="#" class="panel_upshift">{{.BlankWidget.Type}} <span class="widget_disabled">({{lang "panel_themes_widgets_disabled"}})</span></a>
|
<a href="#"class="panel_upshift">{{.BlankWidget.Type}} <span class="widget_disabled">({{lang "panel_themes_widgets_disabled"}})</span></a>
|
||||||
<a class="panel_compacttext to_right">{{.BlankWidget.Location}}</a>
|
<a class="panel_compacttext to_right">{{.BlankWidget.Location}}</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="widget_edit show_on_block_edit">
|
<div class="widget_edit show_on_block_edit">
|
||||||
<form action="/panel/themes/widgets/create/submit/" method="post">
|
<form action="/panel/themes/widgets/create/submit/" method="post">
|
||||||
<input name="s" value="{{.CurrentUser.Session}}" type="hidden">
|
<input name="s"value="{{.CurrentUser.Session}}"type="hidden">
|
||||||
<input class="wside" name="wside" value="" type="hidden">
|
<input class="wside"name="wside"value=""type="hidden">
|
||||||
{{template "panel_themes_widgets_widget.html" .BlankWidget }}
|
{{template "panel_themes_widgets_widget.html" .BlankWidget }}
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -22,26 +22,26 @@
|
||||||
<div class="formrow">
|
<div class="formrow">
|
||||||
<div class="formitem formlabel"><a>{{lang "panel_themes_widgets_location"}}</a></div>
|
<div class="formitem formlabel"><a>{{lang "panel_themes_widgets_location"}}</a></div>
|
||||||
<div class="formitem">
|
<div class="formitem">
|
||||||
<input name="wlocation" value="{{.Location}}">
|
<input name="wlocation"value="{{.Location}}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="wtypes wtype_{{.Type}}">
|
<div class="wtypes wtype_{{.Type}}">
|
||||||
<div class="formrow w_simple w_about">
|
<div class="formrow w_simple w_about">
|
||||||
<div class="formitem formlabel"><a>{{lang "panel_themes_widgets_name"}}</a></div>
|
<div class="formitem formlabel"><a>{{lang "panel_themes_widgets_name"}}</a></div>
|
||||||
<div class="formitem">
|
<div class="formitem">
|
||||||
<input name="wname" value="{{index .Data "Name"}}">
|
<input name="wname"value="{{index .Data "Name"}}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="formrow w_simple w_about">
|
<div class="formrow w_simple w_about">
|
||||||
<div class="formitem formlabel"><a>{{lang "panel_themes_widgets_body"}}</a></div>
|
<div class="formitem formlabel"><a>{{lang "panel_themes_widgets_body"}}</a></div>
|
||||||
<div class="formitem">
|
<div class="formitem">
|
||||||
<textarea name="wtext" class="wtext">{{index .Data "Text"}}</textarea>
|
<textarea name="wtext"class="wtext">{{index .Data "Text"}}</textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="formrow w_default">
|
<div class="formrow w_default">
|
||||||
<div class="formitem formlabel"><a>{{lang "panel_themes_widgets_raw_body"}}</a></div>
|
<div class="formitem formlabel"><a>{{lang "panel_themes_widgets_raw_body"}}</a></div>
|
||||||
<div class="formitem">
|
<div class="formitem">
|
||||||
<textarea name="wbody" class="rwtext">{{.RawBody}}</textarea>
|
<textarea name="wbody"class="rwtext">{{.RawBody}}</textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
<div class="opt mod_opt" title="{{lang "topic_list.moderate_tooltip"}}">
|
<div class="opt mod_opt" title="{{lang "topic_list.moderate_tooltip"}}">
|
||||||
<a class="moderate_link" href="#" aria-label="{{lang "topic_list.moderate_aria"}}"></a>
|
<a class="moderate_link" href="#" aria-label="{{lang "topic_list.moderate_aria"}}"></a>
|
||||||
</div>
|
</div>
|
||||||
{{else}}<div class="opt locked_opt" title="{{lang "topics_locked_tooltip"}}" aria-label="{{lang "topics_locked_aria"}}"><a></a></div>{{end}}
|
{{else}}<div class="opt locked_opt"title="{{lang "topics_locked_tooltip"}}" aria-label="{{lang "topics_locked_aria"}}"><a></a></div>{{end}}
|
||||||
</div><div style="clear:both;"></div>
|
</div><div style="clear:both;"></div>
|
||||||
{{end}}
|
{{end}}
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue