1
0
Fork 0
mirror of https://github.com/Ylianst/MeshCentral.git synced 2025-03-09 15:40:18 +00:00

Server bug fixing and new MeshAgent

This commit is contained in:
Ylian Saint-Hilaire 2018-08-31 15:23:42 -07:00
parent 562310bed1
commit b274b782fa
21 changed files with 719 additions and 92 deletions

View file

@ -15,41 +15,41 @@ limitations under the License.
*/
function borderController()
{
this.container = null;
this.Start = function Start(user)
{
if (this.container == null) {
if (process.platform == 'win32') {
this.container = require('ScriptContainer').Create({ processIsolation: 1, sessionId: user.SessionId });
}
else {
this.container = require('ScriptContainer').Create({ processIsolation: 1, sessionId: user.uid });
}
this.container.addModule('monitor-info', getJSModule('monitor-info'));
this.container.addModule('monitor-border', getJSModule('monitor-border'));
this.container.addModule('promise', getJSModule('promise'));
this.container.ExecuteString("var border = require('monitor-border'); border.Start();");
}
}
this.Stop = function Stop()
{
if (this.container != null)
{
this._container = this.container;
this._container.parent = this;
this.container = null;
this._container.once('exit', function () { this.parent._container = null; });
this._container.exit();
}
}
}
function createMeshCore(agent) {
var obj = {};
function borderController() {
this.container = null;
this.Start = function Start(user) {
if (this.container == null) {
if (process.platform == 'win32') {
this.container = require('ScriptContainer').Create({ processIsolation: 1, sessionId: user.SessionId });
}
else {
this.container = require('ScriptContainer').Create({ processIsolation: 1, sessionId: user.uid });
}
this.container.parent = this;
this.container.addModule('monitor-info', getJSModule('monitor-info'));
this.container.addModule('monitor-border', getJSModule('monitor-border'));
this.container.addModule('promise', getJSModule('promise'));
this.container.once('exit', function (code) { sendConsoleText('Border Process Exited with code: ' + code); this.parent.container = this.parent._container = null; });
this.container.ExecuteString("var border = require('monitor-border'); border.Start();");
}
}
this.Stop = function Stop() {
if (this.container != null) {
this._container = this.container;
this._container.parent = this;
this.container = null;
this._container.exit();
}
}
}
require('events').EventEmitter.call(obj, true).createEvent('loggedInUsers_Updated');
obj.on('loggedInUsers_Updated', function ()
{
@ -1457,6 +1457,8 @@ function createMeshCore(agent) {
});
require('user-sessions').emit('changed');
require('user-sessions').on('locked', function (user) { sendConsoleText('[' + (user.Domain ? user.Domain + '\\' : '') + user.Username + '] has LOCKED the desktop'); });
require('user-sessions').on('unlocked', function (user) { sendConsoleText('[' + (user.Domain ? user.Domain + '\\' : '') + user.Username + '] has UNLOCKED the desktop'); });
//console.log('Stopping.');
//process.exit();
}