fixed active users socket calls in ACP

This commit is contained in:
Julian Lam
2014-01-13 12:01:42 -05:00
parent 3fb44d7693
commit aa689a7a29
4 changed files with 42 additions and 19 deletions

View File

@@ -10,9 +10,21 @@ var groups = require('../groups'),
},
async = require('async'),
winston = require('winston'),
SocketAdmin = {};
SocketAdmin.before = function(sessionData, next) {
// Verify administrative privileges
user.isAdministrator(sessionData.uid, function(err, isAdmin) {
if (isAdmin) {
next();
} else {
winston.warn('[socket.io] Call to admin method blocked (accessed by uid ' + sessionData.uid + ')');
}
});
};
/* Topics */
SocketAdmin.topics = {};