Changed the authentication mechanism to support hooks

This commit is contained in:
Egil Moeller 2012-04-19 16:04:03 +02:00
parent 7b39da2d69
commit ecac40d062
4 changed files with 35 additions and 24 deletions

View file

@ -21,7 +21,7 @@ exports.expressCreateServer = function (hook_name, args, cb) {
exports.socketio = function (hook_name, args, cb) {
var io = args.io.of("/pluginfw/installer");
io.on('connection', function (socket) {
if (!socket.handshake.session.user.is_admin) return;
if (!socket.handshake.session.user || !socket.handshake.session.user.is_admin) return;
socket.on("load", function (query) {
socket.emit("installed-results", {results: plugins.plugins});