diff --git a/bot_routes.go b/bot_routes.go index 32c77733..c9ce0978 100644 --- a/bot_routes.go +++ b/bot_routes.go @@ -13,6 +13,7 @@ import ( // TODO: Make this a static file somehow? Is it possible for us to put this file somewhere else? // TODO: Add an API so that plugins can register disallowed areas. E.g. /guilds/join for plugin_guilds func routeRobotsTxt(w http.ResponseWriter, r *http.Request) common.RouteError { + // TODO: Do we have to put * or something at the end of the paths? _, _ = w.Write([]byte(`User-agent: * Disallow: /panel/ Disallow: /topics/create/ diff --git a/common/forum_perms.go b/common/forum_perms.go index a4b69c21..4a794d6c 100644 --- a/common/forum_perms.go +++ b/common/forum_perms.go @@ -20,6 +20,7 @@ var LocalPermList = []string{ "DeleteReply", "PinTopic", "CloseTopic", + "MoveTopic", } // TODO: Rename this to ForumPermSet? @@ -39,6 +40,7 @@ type ForumPerms struct { PinTopic bool CloseTopic bool //CloseOwnTopic bool + MoveTopic bool Overrides bool ExtData map[string]bool @@ -226,11 +228,11 @@ func ForumPermsToGroupForumPreset(fperms *ForumPerms) string { return "no_access" } var canPost = (fperms.LikeItem && fperms.CreateTopic && fperms.CreateReply) - var canModerate = (canPost && fperms.EditTopic && fperms.DeleteTopic && fperms.EditReply && fperms.DeleteReply && fperms.PinTopic && fperms.CloseTopic) + var canModerate = (canPost && fperms.EditTopic && fperms.DeleteTopic && fperms.EditReply && fperms.DeleteReply && fperms.PinTopic && fperms.CloseTopic && fperms.MoveTopic) if canModerate { return "can_moderate" } - if fperms.EditTopic || fperms.DeleteTopic || fperms.EditReply || fperms.DeleteReply || fperms.PinTopic || fperms.CloseTopic { + if fperms.EditTopic || fperms.DeleteTopic || fperms.EditReply || fperms.DeleteReply || fperms.PinTopic || fperms.CloseTopic || fperms.MoveTopic { if !canPost { return "custom" } @@ -308,6 +310,7 @@ func AllForumPerms() *ForumPerms { DeleteReply: true, PinTopic: true, CloseTopic: true, + MoveTopic: true, Overrides: true, ExtData: make(map[string]bool), diff --git a/common/permissions.go b/common/permissions.go index 8b3ec5bc..d7064ed8 100644 --- a/common/permissions.go +++ b/common/permissions.go @@ -82,6 +82,7 @@ type Perms struct { PinTopic bool CloseTopic bool //CloseOwnTopic bool + MoveTopic bool //ExtData map[string]bool } @@ -129,6 +130,7 @@ func init() { DeleteReply: true, PinTopic: true, CloseTopic: true, + MoveTopic: true, //ExtData: make(map[string]bool), } @@ -218,6 +220,7 @@ func OverrideForumPerms(perms *Perms, status bool) { perms.DeleteReply = status perms.PinTopic = status perms.CloseTopic = status + perms.MoveTopic = status } func RegisterPluginPerm(name string) { diff --git a/common/routes_common.go b/common/routes_common.go index fce992a3..47a17e49 100644 --- a/common/routes_common.go +++ b/common/routes_common.go @@ -86,6 +86,7 @@ func cascadeForumPerms(fperms *ForumPerms, user *User) { user.Perms.DeleteReply = fperms.DeleteReply user.Perms.PinTopic = fperms.PinTopic user.Perms.CloseTopic = fperms.CloseTopic + user.Perms.MoveTopic = fperms.MoveTopic if len(fperms.ExtData) != 0 { for name, perm := range fperms.ExtData { diff --git a/gen_router.go b/gen_router.go index afb5be01..0bee6d53 100644 --- a/gen_router.go +++ b/gen_router.go @@ -288,8 +288,9 @@ var agentMapEnum = map[string]int{ "baidu": 10, "duckduckgo": 11, "discord": 12, - "lynx": 13, - "blank": 14, + "cloudflarealwayson": 13, + "lynx": 14, + "blank": 15, } var reverseAgentMapEnum = map[int]string{ 0: "unknown", @@ -305,8 +306,9 @@ var reverseAgentMapEnum = map[int]string{ 10: "baidu", 11: "duckduckgo", 12: "discord", - 13: "lynx", - 14: "blank", + 13: "cloudflarealwayson", + 14: "lynx", + 15: "blank", } // TODO: Stop spilling these into the package scope? @@ -438,9 +440,11 @@ func (router *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) { case strings.Contains(ua,"Discordbot"): common.AgentViewCounter.Bump(12) case strings.Contains(ua,"Lynx"): + common.AgentViewCounter.Bump(14) + case strings.Contains(ua,"CloudFlare-AlwaysOnline"): common.AgentViewCounter.Bump(13) case ua == "": - common.AgentViewCounter.Bump(14) + common.AgentViewCounter.Bump(15) if common.Dev.DebugMode { log.Print("Blank UA: ", req.UserAgent()) log.Print("Method: ", req.Method) diff --git a/langs/english.json b/langs/english.json index 18c0cf03..cc3ae649 100644 --- a/langs/english.json +++ b/langs/english.json @@ -37,7 +37,8 @@ "EditReply": "Can edit replies", "DeleteReply": "Can delete replies", "PinTopic": "Can pin topics", - "CloseTopic": "Can lock topics" + "CloseTopic": "Can lock topics", + "MoveTopic": "Can move topics in or out" }, "SettingLabels": { "activation_type": "Activate All,Email Activation,Admin Approval" diff --git a/mod_routes.go b/mod_routes.go index f6ae35ec..ff79f642 100644 --- a/mod_routes.go +++ b/mod_routes.go @@ -309,22 +309,23 @@ func routeUnlockTopicSubmit(w http.ResponseWriter, r *http.Request, user common. // ! JS only route // TODO: Figure a way to get this route to work without JS func routeMoveTopicSubmit(w http.ResponseWriter, r *http.Request, user common.User, sfid string) common.RouteError { - // Not fully implemented - return common.NoPermissionsJS(w, r, user) + fid, err := strconv.Atoi(sfid) + if err != nil { + return common.PreErrorJS("The provided Forum ID is not a valid number.", w, r) + } // TODO: Move this to some sort of middleware var tids []int if r.Body == nil { return common.PreErrorJS("No request body", w, r) } - err := json.NewDecoder(r.Body).Decode(&tids) + err = json.NewDecoder(r.Body).Decode(&tids) if err != nil { return common.PreErrorJS("We weren't able to parse your data", w, r) } if len(tids) == 0 { return common.LocalErrorJS("You haven't provided any IDs", w, r) } - fid := 0 for _, tid := range tids { topic, err := common.Topics.Get(tid) @@ -339,7 +340,8 @@ func routeMoveTopicSubmit(w http.ResponseWriter, r *http.Request, user common.Us if ferr != nil { return ferr } - if !user.Perms.ViewTopic || !user.IsSuperMod { // TODO: Add a MoveTo permission + // TODO: Make sure the mod has MoveTopic in the destination forum too + if !user.Perms.ViewTopic || !user.Perms.MoveTopic { return common.NoPermissionsJS(w, r, user) } @@ -348,6 +350,7 @@ func routeMoveTopicSubmit(w http.ResponseWriter, r *http.Request, user common.Us return common.InternalErrorJS(err, w, r) } + // TODO: Log more data so we can list the destination forum in the action post? err = common.ModLogs.Create("move", tid, "topic", user.LastIP, user.ID) if err != nil { return common.InternalErrorJS(err, w, r) diff --git a/panel_routes.go b/panel_routes.go index ba110f3a..7744f081 100644 --- a/panel_routes.go +++ b/panel_routes.go @@ -490,6 +490,7 @@ func routePanelForumsEditPermsAdvance(w http.ResponseWriter, r *http.Request, us addNameLangToggle("DeleteReply", forumPerms.DeleteReply) addNameLangToggle("PinTopic", forumPerms.PinTopic) addNameLangToggle("CloseTopic", forumPerms.CloseTopic) + addNameLangToggle("MoveTopic", forumPerms.MoveTopic) pi := common.PanelEditForumGroupPage{common.GetTitlePhrase("panel_edit_forum"), user, headerVars, stats, "forums", forum.ID, gid, forum.Name, forum.Desc, forum.Active, forum.Preset, formattedPermList} if common.PreRenderHooks["pre_render_panel_edit_forum"] != nil { @@ -550,6 +551,7 @@ func routePanelForumsEditPermsAdvanceSubmit(w http.ResponseWriter, r *http.Reque forumPerms.DeleteReply = extractPerm("DeleteReply") forumPerms.PinTopic = extractPerm("PinTopic") forumPerms.CloseTopic = extractPerm("CloseTopic") + forumPerms.MoveTopic = extractPerm("MoveTopic") err = forum.SetPerms(&forumPerms, "custom", gid) if err != nil { @@ -1765,6 +1767,7 @@ func routePanelGroupsEditPerms(w http.ResponseWriter, r *http.Request, user comm addLocalPerm("DeleteReply", group.Perms.DeleteReply) addLocalPerm("PinTopic", group.Perms.PinTopic) addLocalPerm("CloseTopic", group.Perms.CloseTopic) + addLocalPerm("MoveTopic", group.Perms.MoveTopic) var globalPerms []common.NameLangToggle var addGlobalPerm = func(permStr string, perm bool) { diff --git a/public/global.js b/public/global.js index 77e07a3b..842d0c29 100644 --- a/public/global.js +++ b/public/global.js @@ -504,8 +504,8 @@ $(document).ready(function(){ }); }); - let bulkActionSender = function(action, selectedTopics) { - let url = "/topic/"+action+"/submit/?session=" + session; + let bulkActionSender = function(action, selectedTopics, fragBit) { + let url = "/topic/"+action+"/submit/"+fragBit+"?session=" + session; $.ajax({ url: url, type: "POST", @@ -538,14 +538,17 @@ $(document).ready(function(){ } this.classList.add("pane_selected"); console.log("fid: " + fid); - let moverFid = document.getElementById("#mover_fid"); - console.log("moverFid: ", moverFid); - moverFid.value = fid; + forumToMoveTo = fid; + + $("#mover_submit").click(function(event){ + event.preventDefault(); + bulkActionSender("move",selectedTopics,forumToMoveTo); + }); }); return; } - bulkActionSender(action,selectedTopics); + bulkActionSender(action,selectedTopics,""); }); }); diff --git a/query_gen/main.go b/query_gen/main.go index 01fe681c..bd016496 100644 --- a/query_gen/main.go +++ b/query_gen/main.go @@ -157,12 +157,13 @@ func seedTables(adapter qgen.Adapter) error { DeleteReply PinTopic CloseTopic + MoveTopic */ // TODO: Set the permissions on a struct and then serialize the struct and insert that instead of writing raw JSON - qgen.Install.SimpleInsert("users_groups", "name, permissions, plugin_perms, is_mod, is_admin, tag", `'Administrator','{"BanUsers":true,"ActivateUsers":true,"EditUser":true,"EditUserEmail":true,"EditUserPassword":true,"EditUserGroup":true,"EditUserGroupSuperMod":true,"EditUserGroupAdmin":false,"EditGroup":true,"EditGroupLocalPerms":true,"EditGroupGlobalPerms":true,"EditGroupSuperMod":true,"EditGroupAdmin":false,"ManageForums":true,"EditSettings":true,"ManageThemes":true,"ManagePlugins":true,"ViewAdminLogs":true,"ViewIPs":true,"UploadFiles":true,"ViewTopic":true,"LikeItem":true,"CreateTopic":true,"EditTopic":true,"DeleteTopic":true,"CreateReply":true,"EditReply":true,"DeleteReply":true,"PinTopic":true,"CloseTopic":true}','{}',1,1,"Admin"`) + qgen.Install.SimpleInsert("users_groups", "name, permissions, plugin_perms, is_mod, is_admin, tag", `'Administrator','{"BanUsers":true,"ActivateUsers":true,"EditUser":true,"EditUserEmail":true,"EditUserPassword":true,"EditUserGroup":true,"EditUserGroupSuperMod":true,"EditUserGroupAdmin":false,"EditGroup":true,"EditGroupLocalPerms":true,"EditGroupGlobalPerms":true,"EditGroupSuperMod":true,"EditGroupAdmin":false,"ManageForums":true,"EditSettings":true,"ManageThemes":true,"ManagePlugins":true,"ViewAdminLogs":true,"ViewIPs":true,"UploadFiles":true,"ViewTopic":true,"LikeItem":true,"CreateTopic":true,"EditTopic":true,"DeleteTopic":true,"CreateReply":true,"EditReply":true,"DeleteReply":true,"PinTopic":true,"CloseTopic":true,"MoveTopic":true}','{}',1,1,"Admin"`) - qgen.Install.SimpleInsert("users_groups", "name, permissions, plugin_perms, is_mod, tag", `'Moderator','{"BanUsers":true,"ActivateUsers":false,"EditUser":true,"EditUserEmail":false,"EditUserGroup":true,"ViewIPs":true,"UploadFiles":true,"ViewTopic":true,"LikeItem":true,"CreateTopic":true,"EditTopic":true,"DeleteTopic":true,"CreateReply":true,"EditReply":true,"DeleteReply":true,"PinTopic":true,"CloseTopic":true}','{}',1,"Mod"`) + qgen.Install.SimpleInsert("users_groups", "name, permissions, plugin_perms, is_mod, tag", `'Moderator','{"BanUsers":true,"ActivateUsers":false,"EditUser":true,"EditUserEmail":false,"EditUserGroup":true,"ViewIPs":true,"UploadFiles":true,"ViewTopic":true,"LikeItem":true,"CreateTopic":true,"EditTopic":true,"DeleteTopic":true,"CreateReply":true,"EditReply":true,"DeleteReply":true,"PinTopic":true,"CloseTopic":true,"MoveTopic":true}','{}',1,"Mod"`) qgen.Install.SimpleInsert("users_groups", "name, permissions, plugin_perms", `'Member','{"UploadFiles":true,"ViewTopic":true,"LikeItem":true,"CreateTopic":true,"CreateReply":true}','{}'`) @@ -190,9 +191,9 @@ func seedTables(adapter qgen.Adapter) error { // - qgen.Install.SimpleInsert("forums_permissions", "gid, fid, permissions", `1,2,'{"ViewTopic":true,"CreateReply":true,"CreateTopic":true,"LikeItem":true,"EditTopic":true,"DeleteTopic":true,"EditReply":true,"DeleteReply":true,"PinTopic":true,"CloseTopic":true}'`) + qgen.Install.SimpleInsert("forums_permissions", "gid, fid, permissions", `1,2,'{"ViewTopic":true,"CreateReply":true,"CreateTopic":true,"LikeItem":true,"EditTopic":true,"DeleteTopic":true,"EditReply":true,"DeleteReply":true,"PinTopic":true,"CloseTopic":true,"MoveTopic":true}'`) - qgen.Install.SimpleInsert("forums_permissions", "gid, fid, permissions", `2,2,'{"ViewTopic":true,"CreateReply":true,"CreateTopic":true,"LikeItem":true,"EditTopic":true,"DeleteTopic":true,"EditReply":true,"DeleteReply":true,"PinTopic":true,"CloseTopic":true}'`) + qgen.Install.SimpleInsert("forums_permissions", "gid, fid, permissions", `2,2,'{"ViewTopic":true,"CreateReply":true,"CreateTopic":true,"LikeItem":true,"EditTopic":true,"DeleteTopic":true,"EditReply":true,"DeleteReply":true,"PinTopic":true,"CloseTopic":true,"MoveTopic":true}'`) qgen.Install.SimpleInsert("forums_permissions", "gid, fid, permissions", `3,2,'{"ViewTopic":true,"CreateReply":true,"CreateTopic":true,"LikeItem":true}'`) diff --git a/router_gen/main.go b/router_gen/main.go index e5c2f362..25c8c51e 100644 --- a/router_gen/main.go +++ b/router_gen/main.go @@ -172,6 +172,7 @@ func main() { "baidu", "duckduckgo", "discord", + "cloudflarealwayson", "lynx", "blank", } @@ -345,6 +346,8 @@ func (router *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) { common.AgentViewCounter.Bump({{.AllAgentMap.discord}}) case strings.Contains(ua,"Lynx"): common.AgentViewCounter.Bump({{.AllAgentMap.lynx}}) + case strings.Contains(ua,"CloudFlare-AlwaysOnline"): + common.AgentViewCounter.Bump({{.AllAgentMap.cloudflarealwayson}}) case ua == "": common.AgentViewCounter.Bump({{.AllAgentMap.blank}}) if common.Dev.DebugMode { diff --git a/schema/mssql/inserts.sql b/schema/mssql/inserts.sql index 92c49c5b..9810fde0 100644 --- a/schema/mssql/inserts.sql +++ b/schema/mssql/inserts.sql @@ -6,8 +6,8 @@ INSERT INTO [settings] ([name],[content],[type]) VALUES ('megapost_min_words','1 INSERT INTO [settings] ([name],[content],[type]) VALUES ('meta_desc','','html-attribute'); INSERT INTO [themes] ([uname],[default]) VALUES ('tempra-simple',1); INSERT INTO [emails] ([email],[uid],[validated]) VALUES ('admin@localhost',1,1); -INSERT INTO [users_groups] ([name],[permissions],[plugin_perms],[is_mod],[is_admin],[tag]) VALUES ('Administrator','{"BanUsers":true,"ActivateUsers":true,"EditUser":true,"EditUserEmail":true,"EditUserPassword":true,"EditUserGroup":true,"EditUserGroupSuperMod":true,"EditUserGroupAdmin":false,"EditGroup":true,"EditGroupLocalPerms":true,"EditGroupGlobalPerms":true,"EditGroupSuperMod":true,"EditGroupAdmin":false,"ManageForums":true,"EditSettings":true,"ManageThemes":true,"ManagePlugins":true,"ViewAdminLogs":true,"ViewIPs":true,"UploadFiles":true,"ViewTopic":true,"LikeItem":true,"CreateTopic":true,"EditTopic":true,"DeleteTopic":true,"CreateReply":true,"EditReply":true,"DeleteReply":true,"PinTopic":true,"CloseTopic":true}','{}',1,1,'Admin'); -INSERT INTO [users_groups] ([name],[permissions],[plugin_perms],[is_mod],[tag]) VALUES ('Moderator','{"BanUsers":true,"ActivateUsers":false,"EditUser":true,"EditUserEmail":false,"EditUserGroup":true,"ViewIPs":true,"UploadFiles":true,"ViewTopic":true,"LikeItem":true,"CreateTopic":true,"EditTopic":true,"DeleteTopic":true,"CreateReply":true,"EditReply":true,"DeleteReply":true,"PinTopic":true,"CloseTopic":true}','{}',1,'Mod'); +INSERT INTO [users_groups] ([name],[permissions],[plugin_perms],[is_mod],[is_admin],[tag]) VALUES ('Administrator','{"BanUsers":true,"ActivateUsers":true,"EditUser":true,"EditUserEmail":true,"EditUserPassword":true,"EditUserGroup":true,"EditUserGroupSuperMod":true,"EditUserGroupAdmin":false,"EditGroup":true,"EditGroupLocalPerms":true,"EditGroupGlobalPerms":true,"EditGroupSuperMod":true,"EditGroupAdmin":false,"ManageForums":true,"EditSettings":true,"ManageThemes":true,"ManagePlugins":true,"ViewAdminLogs":true,"ViewIPs":true,"UploadFiles":true,"ViewTopic":true,"LikeItem":true,"CreateTopic":true,"EditTopic":true,"DeleteTopic":true,"CreateReply":true,"EditReply":true,"DeleteReply":true,"PinTopic":true,"CloseTopic":true,"MoveTopic":true}','{}',1,1,'Admin'); +INSERT INTO [users_groups] ([name],[permissions],[plugin_perms],[is_mod],[tag]) VALUES ('Moderator','{"BanUsers":true,"ActivateUsers":false,"EditUser":true,"EditUserEmail":false,"EditUserGroup":true,"ViewIPs":true,"UploadFiles":true,"ViewTopic":true,"LikeItem":true,"CreateTopic":true,"EditTopic":true,"DeleteTopic":true,"CreateReply":true,"EditReply":true,"DeleteReply":true,"PinTopic":true,"CloseTopic":true,"MoveTopic":true}','{}',1,'Mod'); INSERT INTO [users_groups] ([name],[permissions],[plugin_perms]) VALUES ('Member','{"UploadFiles":true,"ViewTopic":true,"LikeItem":true,"CreateTopic":true,"CreateReply":true}','{}'); INSERT INTO [users_groups] ([name],[permissions],[plugin_perms],[is_banned]) VALUES ('Banned','{"ViewTopic":true}','{}',1); INSERT INTO [users_groups] ([name],[permissions],[plugin_perms]) VALUES ('AwaitingActivation','{"ViewTopic":true}','{}'); @@ -20,8 +20,8 @@ INSERT INTO [forums_permissions] ([gid],[fid],[permissions]) VALUES (3,1,'{}'); INSERT INTO [forums_permissions] ([gid],[fid],[permissions]) VALUES (4,1,'{}'); INSERT INTO [forums_permissions] ([gid],[fid],[permissions]) VALUES (5,1,'{}'); INSERT INTO [forums_permissions] ([gid],[fid],[permissions]) VALUES (6,1,'{}'); -INSERT INTO [forums_permissions] ([gid],[fid],[permissions]) VALUES (1,2,'{"ViewTopic":true,"CreateReply":true,"CreateTopic":true,"LikeItem":true,"EditTopic":true,"DeleteTopic":true,"EditReply":true,"DeleteReply":true,"PinTopic":true,"CloseTopic":true}'); -INSERT INTO [forums_permissions] ([gid],[fid],[permissions]) VALUES (2,2,'{"ViewTopic":true,"CreateReply":true,"CreateTopic":true,"LikeItem":true,"EditTopic":true,"DeleteTopic":true,"EditReply":true,"DeleteReply":true,"PinTopic":true,"CloseTopic":true}'); +INSERT INTO [forums_permissions] ([gid],[fid],[permissions]) VALUES (1,2,'{"ViewTopic":true,"CreateReply":true,"CreateTopic":true,"LikeItem":true,"EditTopic":true,"DeleteTopic":true,"EditReply":true,"DeleteReply":true,"PinTopic":true,"CloseTopic":true,"MoveTopic":true}'); +INSERT INTO [forums_permissions] ([gid],[fid],[permissions]) VALUES (2,2,'{"ViewTopic":true,"CreateReply":true,"CreateTopic":true,"LikeItem":true,"EditTopic":true,"DeleteTopic":true,"EditReply":true,"DeleteReply":true,"PinTopic":true,"CloseTopic":true,"MoveTopic":true}'); INSERT INTO [forums_permissions] ([gid],[fid],[permissions]) VALUES (3,2,'{"ViewTopic":true,"CreateReply":true,"CreateTopic":true,"LikeItem":true}'); INSERT INTO [forums_permissions] ([gid],[fid],[permissions]) VALUES (4,2,'{"ViewTopic":true}'); INSERT INTO [forums_permissions] ([gid],[fid],[permissions]) VALUES (5,2,'{"ViewTopic":true}'); diff --git a/schema/mysql/inserts.sql b/schema/mysql/inserts.sql index afc9b0f4..c3c0cb5d 100644 --- a/schema/mysql/inserts.sql +++ b/schema/mysql/inserts.sql @@ -6,8 +6,8 @@ INSERT INTO `settings`(`name`,`content`,`type`) VALUES ('megapost_min_words','10 INSERT INTO `settings`(`name`,`content`,`type`) VALUES ('meta_desc','','html-attribute'); INSERT INTO `themes`(`uname`,`default`) VALUES ('tempra-simple',1); INSERT INTO `emails`(`email`,`uid`,`validated`) VALUES ('admin@localhost',1,1); -INSERT INTO `users_groups`(`name`,`permissions`,`plugin_perms`,`is_mod`,`is_admin`,`tag`) VALUES ('Administrator','{"BanUsers":true,"ActivateUsers":true,"EditUser":true,"EditUserEmail":true,"EditUserPassword":true,"EditUserGroup":true,"EditUserGroupSuperMod":true,"EditUserGroupAdmin":false,"EditGroup":true,"EditGroupLocalPerms":true,"EditGroupGlobalPerms":true,"EditGroupSuperMod":true,"EditGroupAdmin":false,"ManageForums":true,"EditSettings":true,"ManageThemes":true,"ManagePlugins":true,"ViewAdminLogs":true,"ViewIPs":true,"UploadFiles":true,"ViewTopic":true,"LikeItem":true,"CreateTopic":true,"EditTopic":true,"DeleteTopic":true,"CreateReply":true,"EditReply":true,"DeleteReply":true,"PinTopic":true,"CloseTopic":true}','{}',1,1,'Admin'); -INSERT INTO `users_groups`(`name`,`permissions`,`plugin_perms`,`is_mod`,`tag`) VALUES ('Moderator','{"BanUsers":true,"ActivateUsers":false,"EditUser":true,"EditUserEmail":false,"EditUserGroup":true,"ViewIPs":true,"UploadFiles":true,"ViewTopic":true,"LikeItem":true,"CreateTopic":true,"EditTopic":true,"DeleteTopic":true,"CreateReply":true,"EditReply":true,"DeleteReply":true,"PinTopic":true,"CloseTopic":true}','{}',1,'Mod'); +INSERT INTO `users_groups`(`name`,`permissions`,`plugin_perms`,`is_mod`,`is_admin`,`tag`) VALUES ('Administrator','{"BanUsers":true,"ActivateUsers":true,"EditUser":true,"EditUserEmail":true,"EditUserPassword":true,"EditUserGroup":true,"EditUserGroupSuperMod":true,"EditUserGroupAdmin":false,"EditGroup":true,"EditGroupLocalPerms":true,"EditGroupGlobalPerms":true,"EditGroupSuperMod":true,"EditGroupAdmin":false,"ManageForums":true,"EditSettings":true,"ManageThemes":true,"ManagePlugins":true,"ViewAdminLogs":true,"ViewIPs":true,"UploadFiles":true,"ViewTopic":true,"LikeItem":true,"CreateTopic":true,"EditTopic":true,"DeleteTopic":true,"CreateReply":true,"EditReply":true,"DeleteReply":true,"PinTopic":true,"CloseTopic":true,"MoveTopic":true}','{}',1,1,'Admin'); +INSERT INTO `users_groups`(`name`,`permissions`,`plugin_perms`,`is_mod`,`tag`) VALUES ('Moderator','{"BanUsers":true,"ActivateUsers":false,"EditUser":true,"EditUserEmail":false,"EditUserGroup":true,"ViewIPs":true,"UploadFiles":true,"ViewTopic":true,"LikeItem":true,"CreateTopic":true,"EditTopic":true,"DeleteTopic":true,"CreateReply":true,"EditReply":true,"DeleteReply":true,"PinTopic":true,"CloseTopic":true,"MoveTopic":true}','{}',1,'Mod'); INSERT INTO `users_groups`(`name`,`permissions`,`plugin_perms`) VALUES ('Member','{"UploadFiles":true,"ViewTopic":true,"LikeItem":true,"CreateTopic":true,"CreateReply":true}','{}'); INSERT INTO `users_groups`(`name`,`permissions`,`plugin_perms`,`is_banned`) VALUES ('Banned','{"ViewTopic":true}','{}',1); INSERT INTO `users_groups`(`name`,`permissions`,`plugin_perms`) VALUES ('AwaitingActivation','{"ViewTopic":true}','{}'); @@ -20,8 +20,8 @@ INSERT INTO `forums_permissions`(`gid`,`fid`,`permissions`) VALUES (3,1,'{}'); INSERT INTO `forums_permissions`(`gid`,`fid`,`permissions`) VALUES (4,1,'{}'); INSERT INTO `forums_permissions`(`gid`,`fid`,`permissions`) VALUES (5,1,'{}'); INSERT INTO `forums_permissions`(`gid`,`fid`,`permissions`) VALUES (6,1,'{}'); -INSERT INTO `forums_permissions`(`gid`,`fid`,`permissions`) VALUES (1,2,'{"ViewTopic":true,"CreateReply":true,"CreateTopic":true,"LikeItem":true,"EditTopic":true,"DeleteTopic":true,"EditReply":true,"DeleteReply":true,"PinTopic":true,"CloseTopic":true}'); -INSERT INTO `forums_permissions`(`gid`,`fid`,`permissions`) VALUES (2,2,'{"ViewTopic":true,"CreateReply":true,"CreateTopic":true,"LikeItem":true,"EditTopic":true,"DeleteTopic":true,"EditReply":true,"DeleteReply":true,"PinTopic":true,"CloseTopic":true}'); +INSERT INTO `forums_permissions`(`gid`,`fid`,`permissions`) VALUES (1,2,'{"ViewTopic":true,"CreateReply":true,"CreateTopic":true,"LikeItem":true,"EditTopic":true,"DeleteTopic":true,"EditReply":true,"DeleteReply":true,"PinTopic":true,"CloseTopic":true,"MoveTopic":true}'); +INSERT INTO `forums_permissions`(`gid`,`fid`,`permissions`) VALUES (2,2,'{"ViewTopic":true,"CreateReply":true,"CreateTopic":true,"LikeItem":true,"EditTopic":true,"DeleteTopic":true,"EditReply":true,"DeleteReply":true,"PinTopic":true,"CloseTopic":true,"MoveTopic":true}'); INSERT INTO `forums_permissions`(`gid`,`fid`,`permissions`) VALUES (3,2,'{"ViewTopic":true,"CreateReply":true,"CreateTopic":true,"LikeItem":true}'); INSERT INTO `forums_permissions`(`gid`,`fid`,`permissions`) VALUES (4,2,'{"ViewTopic":true}'); INSERT INTO `forums_permissions`(`gid`,`fid`,`permissions`) VALUES (5,2,'{"ViewTopic":true}'); diff --git a/template_list.go b/template_list.go index c5b30429..325d55f5 100644 --- a/template_list.go +++ b/template_list.go @@ -865,7 +865,7 @@ var topics_15 = []byte(`
diff --git a/templates/topics.html b/templates/topics.html index 7013f1f8..d0bbb01d 100644 --- a/templates/topics.html +++ b/templates/topics.html @@ -49,7 +49,7 @@