55 lines
1.4 KiB
Lua
55 lines
1.4 KiB
Lua
local Constants = {}
|
|
|
|
Constants.PermissionLevel = {
|
|
GUEST = 0,
|
|
USER = 1,
|
|
MODERATOR = 2,
|
|
SYSTEM = 3,
|
|
ADMIN = 4,
|
|
}
|
|
|
|
Constants.FULL_POSTS_QUERY = [[
|
|
SELECT
|
|
posts.id, posts.created_at, post_history.content, post_history.edited_at, users.username, users.status, avatars.file_path AS avatar_path, posts.thread_id, users.id AS user_id, post_history.original_markup
|
|
FROM
|
|
posts
|
|
JOIN
|
|
post_history ON posts.current_revision_id = post_history.id
|
|
JOIN
|
|
users ON posts.user_id = users.id
|
|
LEFT JOIN
|
|
avatars ON users.avatar_id = avatars.id
|
|
]]
|
|
|
|
Constants.PermissionLevelString = {
|
|
[Constants.PermissionLevel.GUEST] = "Guest",
|
|
[Constants.PermissionLevel.USER] = "User",
|
|
[Constants.PermissionLevel.MODERATOR] = "Moderator",
|
|
[Constants.PermissionLevel.SYSTEM] = "System",
|
|
[Constants.PermissionLevel.ADMIN] = "Administrator",
|
|
}
|
|
|
|
Constants.InfoboxKind = {
|
|
INFO = 0,
|
|
LOCK = 1,
|
|
WARN = 2,
|
|
ERROR = 3,
|
|
}
|
|
|
|
Constants.InfoboxIcons = {
|
|
[Constants.InfoboxKind.INFO] = "svg-icons.info",
|
|
[Constants.InfoboxKind.LOCK] = "svg-icons.lock",
|
|
[Constants.InfoboxKind.WARN] = "svg-icons.warn",
|
|
[Constants.InfoboxKind.ERROR] = "svg-icons.error",
|
|
}
|
|
Constants.InfoboxHTMLClass = {
|
|
[Constants.InfoboxKind.INFO] = "",
|
|
[Constants.InfoboxKind.LOCK] = "warn",
|
|
[Constants.InfoboxKind.WARN] = "warn",
|
|
[Constants.InfoboxKind.ERROR] = "critical",
|
|
}
|
|
|
|
Constants.BCRYPT_ROUNDS = 10
|
|
|
|
return Constants
|