From 7581dd11746b6fef0821795aa1fd3f99a5aaeb64 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Mon, 29 Jan 2018 17:33:45 -0500 Subject: [PATCH] Closes #6245 - Moved account info to within the profile menu hook, so it can be better filtered and shown to mods - Also serves as a nice template for plugins that wish to listen to the profileMenu hook! --- src/controllers/accounts/helpers.js | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/controllers/accounts/helpers.js b/src/controllers/accounts/helpers.js index 64170ce39d..8951976a78 100644 --- a/src/controllers/accounts/helpers.js +++ b/src/controllers/accounts/helpers.js @@ -50,11 +50,26 @@ helpers.getUserDataByUserSlug = function (userslug, callerUID, callback) { ips: function (next) { user.getIPs(uid, 4, next); }, - profile_links: function (next) { + profile_links: function (next) { // DEPRECATED, do not use plugins.fireHook('filter:user.profileLinks', [], next); }, profile_menu: function (next) { - plugins.fireHook('filter:user.profileMenu', { uid: uid, callerUID: callerUID, links: [] }, next); + plugins.fireHook('filter:user.profileMenu', { + uid: uid, + callerUID: callerUID, + links: [{ + id: 'info', + route: 'info', + name: '[[user:account_info]]', + visibility: { + self: false, + other: false, + moderator: true, + globalMod: true, + admin: true, + }, + }], + }, next); }, groups: function (next) { groups.getUserGroups([uid], next);