Fixes editing for ordinary users and new thread field name.
This commit is contained in:
parent
1592be0503
commit
bfa5bfe4d9
2 changed files with 2 additions and 2 deletions
|
|
@ -1076,7 +1076,7 @@ proc updatePost(c: TForumData, postId: int, content: string,
|
||||||
# Verify that the current user has permissions to edit the specified post.
|
# Verify that the current user has permissions to edit the specified post.
|
||||||
let creation = fromUnix(postRow[1].parseInt)
|
let creation = fromUnix(postRow[1].parseInt)
|
||||||
let isArchived = (getTime() - creation).weeks > 8
|
let isArchived = (getTime() - creation).weeks > 8
|
||||||
let canEdit = c.rank == Admin or c.username == postRow[0]
|
let canEdit = c.rank == Admin or c.userid == postRow[0]
|
||||||
if isArchived:
|
if isArchived:
|
||||||
raise newForumError("This post is archived and can no longer be edited")
|
raise newForumError("This post is archived and can no longer be edited")
|
||||||
if not canEdit:
|
if not canEdit:
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ when defined(js):
|
||||||
tdiv(class="title"):
|
tdiv(class="title"):
|
||||||
p(): text "New Thread"
|
p(): text "New Thread"
|
||||||
tdiv(class="content"):
|
tdiv(class="content"):
|
||||||
input(class="form-input", `type`="text", name="username",
|
input(class="form-input", `type`="text", name="subject",
|
||||||
placeholder="Type the title here",
|
placeholder="Type the title here",
|
||||||
onChange=(e: Event, n: VNode) => onSubjectChange(e, n, state))
|
onChange=(e: Event, n: VNode) => onSubjectChange(e, n, state))
|
||||||
if state.error.isSome():
|
if state.error.isSome():
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue