diff --git a/public/language/en_GB/pages.json b/public/language/en_GB/pages.json index 2fe5b5dbac..52339d7830 100644 --- a/public/language/en_GB/pages.json +++ b/public/language/en_GB/pages.json @@ -34,6 +34,7 @@ "account/edit/password": "Editing password of \"%1\"", "account/edit/username": "Editing username of \"%1\"", "account/edit/email": "Editing email of \"%1\"", + "account/info": "Account Info", "account/following": "People %1 follows", "account/followers": "People who follow %1", "account/posts": "Posts made by %1", diff --git a/public/language/en_GB/user.json b/public/language/en_GB/user.json index a0ef56e0e7..b1cb065de5 100644 --- a/public/language/en_GB/user.json +++ b/public/language/en_GB/user.json @@ -7,6 +7,7 @@ "email": "Email", "confirm_email": "Confirm Email", + "account_info": "Account Info", "ban_account": "Ban Account", "ban_account_confirm": "Do you really want to ban this user?", "unban_account": "Unban Account", @@ -125,5 +126,12 @@ "sso.title": "Single Sign-on Services", "sso.associated": "Associated with", - "sso.not-associated": "Click here to associate with" + "sso.not-associated": "Click here to associate with", + + "info.latest-flags": "Latest Flags", + "info.no-flags": "No Flagged Posts Found", + "info.ban-history": "Recent Ban History", + "info.no-ban-history": "This user has never been banned", + "info.banned-until": "Banned until %1", + "info.banned-permanently": "Banned permanently" } diff --git a/src/controllers/accounts.js b/src/controllers/accounts.js index 789393703a..2c99a981c3 100644 --- a/src/controllers/accounts.js +++ b/src/controllers/accounts.js @@ -3,6 +3,7 @@ var accountsController = { profile: require('./accounts/profile'), edit: require('./accounts/edit'), + info: require('./accounts/info'), settings: require('./accounts/settings'), groups: require('./accounts/groups'), follow: require('./accounts/follow'), diff --git a/src/routes/accounts.js b/src/routes/accounts.js index 9ee4b3af20..e60d2bcc99 100644 --- a/src/routes/accounts.js +++ b/src/routes/accounts.js @@ -5,7 +5,7 @@ var setupPageRoute = helpers.setupPageRoute; module.exports = function (app, middleware, controllers) { var middlewares = [middleware.checkGlobalPrivacySettings]; - var accountMiddlewares = [middleware.checkGlobalPrivacySettings, middleware.checkAccountPermissions]; + var accountMiddlewares = [middleware.checkGlobalPrivacySettings, middleware.checkAccountPermissions, middleware.exposeUid]; setupPageRoute(app, '/uid/:uid/:section?', middleware, [], middleware.redirectUidToUserslug); @@ -25,6 +25,7 @@ module.exports = function (app, middleware, controllers) { setupPageRoute(app, '/user/:userslug/edit/username', middleware, accountMiddlewares, controllers.accounts.edit.username); setupPageRoute(app, '/user/:userslug/edit/email', middleware, accountMiddlewares, controllers.accounts.edit.email); setupPageRoute(app, '/user/:userslug/edit/password', middleware, accountMiddlewares, controllers.accounts.edit.password); + setupPageRoute(app, '/user/:userslug/info', middleware, accountMiddlewares, controllers.accounts.info.get); setupPageRoute(app, '/user/:userslug/settings', middleware, accountMiddlewares, controllers.accounts.settings.get); app.delete('/user/:userslug/session/:uuid', accountMiddlewares, controllers.accounts.session.revoke); diff --git a/src/user.js b/src/user.js index b4557abfb0..19f9974cba 100644 --- a/src/user.js +++ b/src/user.js @@ -33,6 +33,7 @@ var utils = require('../public/src/utils'); require('./user/approval')(User); require('./user/invite')(User); require('./user/password')(User); + require('./user/info')(User); User.updateLastOnlineTime = function(uid, callback) { callback = callback || function() {}; diff --git a/src/user/admin.js b/src/user/admin.js index e2cb88a616..cf09c0a4ed 100644 --- a/src/user/admin.js +++ b/src/user/admin.js @@ -22,9 +22,7 @@ module.exports = function(User) { return callback(err); } - callback(null, ips.map(function(ip) { - return {ip:ip}; - })); + callback(null, ips); }); }; @@ -68,6 +66,7 @@ module.exports = function(User) { var tasks = [ async.apply(User.setUserField, uid, 'banned', 1), async.apply(db.sortedSetAdd, 'users:banned', Date.now(), uid), + async.apply(db.sortedSetAdd, 'uid:' + uid + ':bans', Date.now(), until) ]; if (until > 0 && Date.now() < until) {