Merge pull request #2319 from ether/fix-socket-admin-etc
Fixing admin issues due to socket upgrade
This commit is contained in:
commit
b0872cc447
|
@ -14,7 +14,6 @@ exports.expressCreateServer = function (hook_name, args, cb) {
|
||||||
search_results: {},
|
search_results: {},
|
||||||
errors: [],
|
errors: [],
|
||||||
};
|
};
|
||||||
|
|
||||||
res.send( eejs.require("ep_etherpad-lite/templates/admin/plugins.html", render_args) );
|
res.send( eejs.require("ep_etherpad-lite/templates/admin/plugins.html", render_args) );
|
||||||
});
|
});
|
||||||
args.app.get('/admin/plugins/info', function(req, res) {
|
args.app.get('/admin/plugins/info', function(req, res) {
|
||||||
|
@ -25,7 +24,8 @@ exports.expressCreateServer = function (hook_name, args, cb) {
|
||||||
exports.socketio = function (hook_name, args, cb) {
|
exports.socketio = function (hook_name, args, cb) {
|
||||||
var io = args.io.of("/pluginfw/installer");
|
var io = args.io.of("/pluginfw/installer");
|
||||||
io.on('connection', function (socket) {
|
io.on('connection', function (socket) {
|
||||||
if (!socket.handshake.session.user || !socket.handshake.session.user.is_admin) return;
|
|
||||||
|
if (!socket.conn.request.session || !socket.conn.request.session.user || !socket.conn.request.session.user.is_admin) return;
|
||||||
|
|
||||||
socket.on("getInstalled", function (query) {
|
socket.on("getInstalled", function (query) {
|
||||||
// send currently installed plugins
|
// send currently installed plugins
|
||||||
|
|
|
@ -22,7 +22,8 @@ exports.expressCreateServer = function (hook_name, args, cb) {
|
||||||
exports.socketio = function (hook_name, args, cb) {
|
exports.socketio = function (hook_name, args, cb) {
|
||||||
var io = args.io.of("/settings");
|
var io = args.io.of("/settings");
|
||||||
io.on('connection', function (socket) {
|
io.on('connection', function (socket) {
|
||||||
if (!socket.handshake.session.user || !socket.handshake.session.user.is_admin) return;
|
|
||||||
|
if (!socket.conn.request.session || !socket.conn.request.session.user || !socket.conn.request.session.user.is_admin) return;
|
||||||
|
|
||||||
socket.on("load", function (query) {
|
socket.on("load", function (query) {
|
||||||
fs.readFile('settings.json', 'utf8', function (err,data) {
|
fs.readFile('settings.json', 'utf8', function (err,data) {
|
||||||
|
|
|
@ -10,7 +10,8 @@ $(document).ready(function () {
|
||||||
resource = baseURL.substring(1) + "socket.io";
|
resource = baseURL.substring(1) + "socket.io";
|
||||||
|
|
||||||
//connect
|
//connect
|
||||||
socket = io.connect(url, {resource : resource}).of("/pluginfw/installer");
|
var room = url + "pluginfw/installer";
|
||||||
|
socket = io.connect(room, {resource : resource});
|
||||||
|
|
||||||
function search(searchTerm, limit) {
|
function search(searchTerm, limit) {
|
||||||
if(search.searchTerm != searchTerm) {
|
if(search.searchTerm != searchTerm) {
|
||||||
|
|
|
@ -9,7 +9,8 @@ $(document).ready(function () {
|
||||||
resource = baseURL.substring(1) + "socket.io";
|
resource = baseURL.substring(1) + "socket.io";
|
||||||
|
|
||||||
//connect
|
//connect
|
||||||
socket = io.connect(url, {resource : resource}).of("/settings");
|
var room = url + "settings";
|
||||||
|
socket = io.connect(room, {resource : resource});
|
||||||
|
|
||||||
socket.on('settings', function (settings) {
|
socket.on('settings', function (settings) {
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue