diff --git a/src/controllers/users.js b/src/controllers/users.js index cd636823b1..1a0be53e5c 100644 --- a/src/controllers/users.js +++ b/src/controllers/users.js @@ -14,6 +14,10 @@ var async = require('async'), db = require('../database'), helpers = require('./helpers'); +usersController.redirectToOnlineUsers = function(req, res, next) { + helpers.redirect(res, '/users/online'); +}; + usersController.getOnlineUsers = function(req, res, next) { var websockets = require('../socket.io'); diff --git a/src/routes/index.js b/src/routes/index.js index a70bcec510..823cd45f8a 100644 --- a/src/routes/index.js +++ b/src/routes/index.js @@ -78,7 +78,7 @@ function accountRoutes(app, middleware, controllers) { function userRoutes(app, middleware, controllers) { var middlewares = [middleware.checkGlobalPrivacySettings]; - setupPageRoute(app, '/users', middleware, middlewares, controllers.users.getOnlineUsers); + setupPageRoute(app, '/users', middleware, middlewares, controllers.users.redirectToOnlineUsers); setupPageRoute(app, '/users/online', middleware, middlewares, controllers.users.getOnlineUsers); setupPageRoute(app, '/users/sort-posts', middleware, middlewares, controllers.users.getUsersSortedByPosts); setupPageRoute(app, '/users/sort-reputation', middleware, middlewares, controllers.users.getUsersSortedByReputation);