Alternate messaging system improvements (#4274)

This commit is contained in:
Ylian Saint-Hilaire 2022-07-15 14:23:01 -07:00
parent cd99f81064
commit ea977d8c0d
4 changed files with 91 additions and 47 deletions

View File

@ -395,14 +395,18 @@
} }
} }
}, },
"altMessenging": { "altMessenging": {
"type": "object", "type": "array",
"properties": { "items": {
"name": { "type": "string", "description": "Name of the alternative messaging service, for example: \"Jitsi\" " }, "type": "object",
"url": { "type": "string", "description": "URL to the alternative messaging services, for example: \"https://meet.jit.si/myserver-{0}\"" }, "properties": {
"localurl": { "type": "string", "description": "If specified, this is the URL that is used on the administrator side, for example: \"https://meet.jit.si/myserver-{0}\"" } "name": { "type": "string", "description": "Name of the alternative messaging service, for example: \"Jitsi\" " },
}, "url": { "type": "string", "description": "URL to the alternative messaging services, for example: \"https://meet.jit.si/myserver-{0}\", for a device {0}, {1}, {2}, {3} is the device id. For a user, {0} is the userid, {1} is full userid with dashes, {2} is real name with no spaces, {3} is real name with dash instead of spaces." },
"required": [ "name", "url" ] "localurl": { "type": "string", "description": "If specified, this is the URL that is used on the administrator side, for example: \"https://meet.jit.si/myserver-{0}\", for a device {0}, {1}, {2}, {3} is the device id. For a user, {0} is the userid, {1} is full userid with dashes, {2} is real name with no spaces, {3} is real name with dash instead of spaces." },
"type": { "type": "string", "enum": [null, "user", "device"], "default": null, "description": "Indicate if this button should be shown in the user or device type. If obmitted, it will be displayed in both." }
},
"required": [ "name", "url" ]
}
}, },
"deviceMeshRouterLinks": { "deviceMeshRouterLinks": {
"rdp": { "type": "boolean", "default": true, "description": "Display a RDP link in the device tab when supported." }, "rdp": { "type": "boolean", "default": true, "description": "Display a RDP link in the device tab when supported." },

View File

@ -554,9 +554,9 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
} }
if (matchingDomains.length > 0) { serverinfo.amtAcmFqdn = matchingDomains; } if (matchingDomains.length > 0) { serverinfo.amtAcmFqdn = matchingDomains; }
} }
if ((typeof domain.altmessenging == 'object') && (typeof domain.altmessenging.name == 'string') && (typeof domain.altmessenging.url == 'string')) { serverinfo.altmessenging = [{ name: domain.altmessenging.name, url: domain.altmessenging.url, localurl: domain.altmessenging.localurl }]; }
if (typeof domain.devicemeshrouterlinks == 'object') { serverinfo.devicemeshrouterlinks = domain.devicemeshrouterlinks; } if (typeof domain.devicemeshrouterlinks == 'object') { serverinfo.devicemeshrouterlinks = domain.devicemeshrouterlinks; }
if (Array.isArray(domain.altmessenging)) { serverinfo.altmessenging = []; for (var i in domain.altmessenging) { if ((typeof domain.altmessenging[i] == 'object') && (typeof domain.altmessenging[i].name == 'string') && (typeof domain.altmessenging[i].url == 'string')) { serverinfo.altmessenging.push({ name: domain.altmessenging[i].name, url: domain.altmessenging[i].url }); } } } if ((typeof domain.altmessenging == 'object') && (typeof domain.altmessenging.name == 'string') && (typeof domain.altmessenging.url == 'string')) { serverinfo.altmessenging = [{ name: domain.altmessenging.name, url: domain.altmessenging.url, localurl: domain.altmessenging.localurl, type: domain.altmessenging.type }]; }
if (Array.isArray(domain.altmessenging)) { serverinfo.altmessenging = []; for (var i in domain.altmessenging) { if ((typeof domain.altmessenging[i] == 'object') && (typeof domain.altmessenging[i].name == 'string') && (typeof domain.altmessenging[i].url == 'string')) { serverinfo.altmessenging.push({ name: domain.altmessenging[i].name, url: domain.altmessenging[i].url, type: domain.altmessenging[i].type }); } } }
serverinfo.https = true; serverinfo.https = true;
serverinfo.redirport = args.redirport; serverinfo.redirport = args.redirport;
if (parent.parent.webpush != null) { serverinfo.vapidpublickey = parent.parent.webpush.vapidPublicKey; } // Web push public key if (parent.parent.webpush != null) { serverinfo.vapidpublickey = parent.parent.webpush.vapidPublicKey; } // Web push public key

View File

@ -10,7 +10,7 @@
"_WANonly": true, "_WANonly": true,
"_LANonly": true, "_LANonly": true,
"_maintenanceMode": true, "_maintenanceMode": true,
"_certificatePrivateKeyPassword": ["password1", "password2"], "_certificatePrivateKeyPassword": [ "password1", "password2" ],
"_sessionTime": 60, "_sessionTime": 60,
"_sessionKey": "MyReallySecretPassword1", "_sessionKey": "MyReallySecretPassword1",
"_sessionSameSite": "strict", "_sessionSameSite": "strict",
@ -83,9 +83,9 @@
"_agentAllowedIP": "192.168.0.100/24", "_agentAllowedIP": "192.168.0.100/24",
"_agentBlockedIP": "127.0.0.1,::1", "_agentBlockedIP": "127.0.0.1,::1",
"_authLog": "c:\\temp\\auth.log", "_authLog": "c:\\temp\\auth.log",
"_InterUserMessaging": ["user//admin"], "_InterUserMessaging": [ "user//admin" ],
"_manageAllDeviceGroups": ["user//admin"], "_manageAllDeviceGroups": [ "user//admin" ],
"_manageCrossDomain": ["user//admin"], "_manageCrossDomain": [ "user//admin" ],
"_localDiscovery": { "_localDiscovery": {
"name": "Local server name", "name": "Local server name",
"info": "Information about this server" "info": "Information about this server"
@ -146,7 +146,10 @@
"count": 10, "count": 10,
"coolofftime": 10 "coolofftime": 10
}, },
"watchDog": { "interval": 100, "timeout": 400 }, "watchDog": {
"interval": 100,
"timeout": 400
},
"_AmtProvisioningServer": { "_AmtProvisioningServer": {
"port": 9971, "port": 9971,
"deviceGroup": "mesh//xxxxxxxxxxxxxxxxxxxxx", "deviceGroup": "mesh//xxxxxxxxxxxxxxxxxxxxx",
@ -179,15 +182,15 @@
"_nightMode": 1, "_nightMode": 1,
"_userQuota": 1048576, "_userQuota": 1048576,
"_meshQuota": 248576, "_meshQuota": 248576,
"_loginKey": ["abc", "123"], "_loginKey": [ "abc", "123" ],
"_agentKey": ["abc", "123"], "_agentKey": [ "abc", "123" ],
"_ipkvm": false, "_ipkvm": false,
"minify": true, "minify": true,
"_newAccounts": true, "_newAccounts": true,
"_newAccountsUserGroups": ["ugrp//xxxxxxxxxxxxxxxxx"], "_newAccountsUserGroups": [ "ugrp//xxxxxxxxxxxxxxxxx" ],
"_userNameIsEmail": true, "_userNameIsEmail": true,
"_newAccountEmailDomains": ["sample.com"], "_newAccountEmailDomains": [ "sample.com" ],
"_newAccountsRights": ["nonewgroups", "notools"], "_newAccountsRights": [ "nonewgroups", "notools" ],
"_welcomeText": "Sample Text on Login Page.", "_welcomeText": "Sample Text on Login Page.",
"_welcomePicture": "mainwelcome.jpg", "_welcomePicture": "mainwelcome.jpg",
"_welcomePictureFullScreen": false, "_welcomePictureFullScreen": false,
@ -202,13 +205,23 @@
"_AutoRemoveInactiveDevices": 37, "_AutoRemoveInactiveDevices": 37,
"_DeviceSearchBarServerAndClientName": false, "_DeviceSearchBarServerAndClientName": false,
"_agentSelfGuestSharing": { "_agentSelfGuestSharing": {
"expire": 120 "expire": 120
},
"_certUrl": "https://192.168.2.106:443/",
"_altMessenging": {
"name": "Jitsi",
"url": "https://meet.jit.si/myserver-{0}"
}, },
"_certUrl": "https://192.168.2.106:443/",
"_altMessenging": [
{
"name": "Jitsi",
"url": "https://meet.jit.si/myserver-{0}",
"localurl": "https://meet.jit.si/myserver-local-{0}",
"type": "device"
},
{
"name": "Jitsi",
"url": "https://meet.jit.si/myserver-{0}-{1}-{2}-{3}",
"localurl": "https://meet.jit.si/myserver-local-{0}-{1}-{2}-{3}",
"type": "user"
}
],
"_deviceMeshRouterLinks": { "_deviceMeshRouterLinks": {
"rdp": true, "rdp": true,
"ssh": true, "ssh": true,
@ -219,7 +232,7 @@
"protocol": "http", "protocol": "http",
"port": 80, "port": 80,
"_ip": "192.168.1.100", "_ip": "192.168.1.100",
"_filter": ["mesh/(domainid)/(meshid)", "node/(domainid)/(nodeid)"] "_filter": [ "mesh/(domainid)/(meshid)", "node/(domainid)/(nodeid)" ]
}, },
{ {
"name": "HTTPS", "name": "HTTPS",
@ -364,7 +377,12 @@
} }
}, },
"_amtManager": { "_amtManager": {
"adminAccounts": [{ "user": "admin", "pass": "MyP@ssw0rd" }], "adminAccounts": [
{
"user": "admin",
"pass": "MyP@ssw0rd"
}
],
"environmentDetection": [ "environmentDetection": [
"domain1.com", "domain1.com",
"domain2.com", "domain2.com",
@ -393,8 +411,8 @@
"Strict-Transport-Security": "max-age=360000", "Strict-Transport-Security": "max-age=360000",
"x-frame-options": "SAMEORIGIN" "x-frame-options": "SAMEORIGIN"
}, },
"_agentConfig": ["webSocketMaskOverride=1", "coreDumpEnabled=1"], "_agentConfig": [ "webSocketMaskOverride=1", "coreDumpEnabled=1" ],
"_assistantConfig": ["disableUpdate=1"], "_assistantConfig": [ "disableUpdate=1" ],
"_sessionRecording": { "_sessionRecording": {
"_onlySelectedUsers": true, "_onlySelectedUsers": true,
"_onlySelectedUserGroups": true, "_onlySelectedUserGroups": true,
@ -405,42 +423,42 @@
"_maxRecordingDays": 15, "_maxRecordingDays": 15,
"_maxRecordingSizeMegabytes": 3, "_maxRecordingSizeMegabytes": 3,
"__protocols__": "Is an array: 1 = Terminal, 2 = Desktop, 5 = Files, 100 = Intel AMT WSMAN, 101 = Intel AMT Redirection, 200 = Messenger", "__protocols__": "Is an array: 1 = Terminal, 2 = Desktop, 5 = Files, 100 = Intel AMT WSMAN, 101 = Intel AMT Redirection, 200 = Messenger",
"protocols": [1, 2, 101] "protocols": [ 1, 2, 101 ]
}, },
"_authStrategies": { "_authStrategies": {
"__comment__": "This section is used to allow users to login using other accounts. You will need to get an API key from the services and register callback URL's", "__comment__": "This section is used to allow users to login using other accounts. You will need to get an API key from the services and register callback URL's",
"twitter": { "twitter": {
"_callbackurl": "https://server/auth-twitter-callback", "_callbackurl": "https://server/auth-twitter-callback",
"newAccounts": true, "newAccounts": true,
"_newAccountsUserGroups": ["ugrp//xxxxxxxxxxxxxxxxx"], "_newAccountsUserGroups": [ "ugrp//xxxxxxxxxxxxxxxxx" ],
"clientid": "xxxxxxxxxxxxxxxxxxxxxxx", "clientid": "xxxxxxxxxxxxxxxxxxxxxxx",
"clientsecret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" "clientsecret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}, },
"google": { "google": {
"_callbackurl": "https://server/auth-google-callback", "_callbackurl": "https://server/auth-google-callback",
"newAccounts": true, "newAccounts": true,
"_newAccountsUserGroups": ["ugrp//xxxxxxxxxxxxxxxxx"], "_newAccountsUserGroups": [ "ugrp//xxxxxxxxxxxxxxxxx" ],
"clientid": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com", "clientid": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com",
"clientsecret": "xxxxxxxxxxxxxxxxxxxxxxx" "clientsecret": "xxxxxxxxxxxxxxxxxxxxxxx"
}, },
"github": { "github": {
"_callbackurl": "https://server/auth-github-callback", "_callbackurl": "https://server/auth-github-callback",
"newAccounts": true, "newAccounts": true,
"_newAccountsUserGroups": ["ugrp//xxxxxxxxxxxxxxxxx"], "_newAccountsUserGroups": [ "ugrp//xxxxxxxxxxxxxxxxx" ],
"clientid": "xxxxxxxxxxxxxxxxxxxxxxx", "clientid": "xxxxxxxxxxxxxxxxxxxxxxx",
"clientsecret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" "clientsecret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}, },
"reddit": { "reddit": {
"_callbackurl": "https://server/auth-reddit-callback", "_callbackurl": "https://server/auth-reddit-callback",
"newAccounts": true, "newAccounts": true,
"_newAccountsUserGroups": ["ugrp//xxxxxxxxxxxxxxxxx"], "_newAccountsUserGroups": [ "ugrp//xxxxxxxxxxxxxxxxx" ],
"clientid": "xxxxxxxxxxxxxxxxxxxxxxx", "clientid": "xxxxxxxxxxxxxxxxxxxxxxx",
"clientsecret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" "clientsecret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}, },
"azure": { "azure": {
"_callbackurl": "https://server/auth-azure-callback", "_callbackurl": "https://server/auth-azure-callback",
"newAccounts": true, "newAccounts": true,
"_newAccountsUserGroups": ["ugrp//xxxxxxxxxxxxxxxxx"], "_newAccountsUserGroups": [ "ugrp//xxxxxxxxxxxxxxxxx" ],
"clientid": "00000000-0000-0000-0000-000000000000", "clientid": "00000000-0000-0000-0000-000000000000",
"clientsecret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "clientsecret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"tenantid": "00000000-0000-0000-0000-000000000000" "tenantid": "00000000-0000-0000-0000-000000000000"
@ -448,7 +466,7 @@
"jumpcloud": { "jumpcloud": {
"_callbackurl": "https://server/auth-jumpcloud-callback", "_callbackurl": "https://server/auth-jumpcloud-callback",
"newAccounts": true, "newAccounts": true,
"_newAccountsUserGroups": ["ugrp//xxxxxxxxxxxxxxxxx"], "_newAccountsUserGroups": [ "ugrp//xxxxxxxxxxxxxxxxx" ],
"entityid": "meshcentral", "entityid": "meshcentral",
"idpurl": "https://sso.jumpcloud.com/saml2/saml2", "idpurl": "https://sso.jumpcloud.com/saml2/saml2",
"cert": "jumpcloud-saml.pem" "cert": "jumpcloud-saml.pem"
@ -457,8 +475,8 @@
"_callbackurl": "https://server/auth-saml-callback", "_callbackurl": "https://server/auth-saml-callback",
"_disableRequestedAuthnContext": true, "_disableRequestedAuthnContext": true,
"newAccounts": true, "newAccounts": true,
"_newAccountsUserGroups": ["ugrp//xxxxxxxxxxxxxxxxx"], "_newAccountsUserGroups": [ "ugrp//xxxxxxxxxxxxxxxxx" ],
"_newAccountsRights": ["nonewgroups", "notools"], "_newAccountsRights": [ "nonewgroups", "notools" ],
"entityid": "meshcentral", "entityid": "meshcentral",
"idpurl": "https://server/saml2", "idpurl": "https://server/saml2",
"cert": "saml.pem" "cert": "saml.pem"
@ -494,7 +512,7 @@
"uid": "anneonyme", "uid": "anneonyme",
"mail": "anneonyme@example.com", "mail": "anneonyme@example.com",
"email": "anneonyme@example.com", "email": "anneonyme@example.com",
"otherMail": ["other.anneonyme@example.com", "anneonyme@example.com"] "otherMail": [ "other.anneonyme@example.com", "anneonyme@example.com" ]
}, },
"so": { "so": {
"displayName": "Sticker Sophie", "displayName": "Sticker Sophie",
@ -502,7 +520,7 @@
"uid": "ssticker", "uid": "ssticker",
"mail": "ssticker@example.com", "mail": "ssticker@example.com",
"email": "ssticker@example.com", "email": "ssticker@example.com",
"otherMail": ["other.ssticker@example.com", "ssticker@example.com"] "otherMail": [ "other.ssticker@example.com", "ssticker@example.com" ]
} }
}, },
"__LDAPOptions": { "__LDAPOptions": {
@ -551,7 +569,7 @@
"_sendmail": { "_sendmail": {
"newline": "unix", "newline": "unix",
"path": "/usr/sbin/sendmail", "path": "/usr/sbin/sendmail",
"_args": ["-f", "foo@example.com"] "_args": [ "-f", "foo@example.com" ]
}, },
"_sms": { "_sms": {
"provider": "twilio", "provider": "twilio",

View File

@ -7144,7 +7144,12 @@
//if ((connectivity & 1) && (meshrights & 8) && (node.agent.id < 5)) { x += '<input type=button value=Toast title="' + "Display a text message of the remote device" + '" onclick=deviceToastFunction() />'; } //if ((connectivity & 1) && (meshrights & 8) && (node.agent.id < 5)) { x += '<input type=button value=Toast title="' + "Display a text message of the remote device" + '" onclick=deviceToastFunction() />'; }
if ((meshrights & 8) && (connectivity & 1) || ((node.pmt == 1) && ((features2 & 2) != 0))) { x += '<input type=button value="' + "Chat" + '" title="' + "Open chat window to this computer" + '" onclick=deviceChat(event) />'; } if ((meshrights & 8) && (connectivity & 1) || ((node.pmt == 1) && ((features2 & 2) != 0))) { x += '<input type=button value="' + "Chat" + '" title="' + "Open chat window to this computer" + '" onclick=deviceChat(event) />'; }
if ((serverinfo != null) && (serverinfo.altmessenging != null) && (meshrights & 8) && (connectivity & 1)) { if ((serverinfo != null) && (serverinfo.altmessenging != null) && (meshrights & 8) && (connectivity & 1)) {
for (var i in serverinfo.altmessenging) { x += '<input type=button value="' + EscapeHtml(serverinfo.altmessenging[i].name) + '" onclick=altDeviceChat(event,' + i + ') />'; } for (var i in serverinfo.altmessenging) {
var am = serverinfo.altmessenging[i];
if ((am.type == null) || (am.type == 'device')) {
x += '<input type=button value="' + EscapeHtml(serverinfo.altmessenging[i].name) + '" onclick=altDeviceChat(event,' + i + ') />';
}
}
} }
if ((serverinfo.guestdevicesharing !== false) && (node.agent != null) && (node.agent.caps & 3) && (connectivity & 1) && ((meshrights & 0x80008) == 0x80008) && ((meshrights == 0xFFFFFFFF) || ((meshrights & 0x1000) == 0))) { if ((serverinfo.guestdevicesharing !== false) && (node.agent != null) && (node.agent.caps & 3) && (connectivity & 1) && ((meshrights & 0x80008) == 0x80008) && ((meshrights == 0xFFFFFFFF) || ((meshrights & 0x1000) == 0))) {
x += '<input type=button value="' + "Share" + '" title="' + "Create a link to share this device with a guest" + '" onclick=showShareDevice() />'; x += '<input type=button value="' + "Share" + '" title="' + "Create a link to share this device with a guest" + '" onclick=showShareDevice() />';
@ -7633,9 +7638,9 @@
function altDeviceChat(e, i) { function altDeviceChat(e, i) {
if (xxdialogMode) return; if (xxdialogMode) return;
var url = serverinfo.altmessenging[i].url.split('{0}').join(currentNode._id.split('/').join('-')); var url = serverinfo.altmessenging[i].url.split('{0}').join(currentNode._id.split('/')[2]).split('{1}').join(currentNode._id.split('/')[2]).split('{2}').join(currentNode._id.split('/')[2]).split('{3}').join(currentNode._id.split('/')[2]);
var localurl = url; var localurl = url;
if (typeof serverinfo.altmessenging[i].localurl == 'string') { localurl = serverinfo.altmessenging[i].localurl.split('{0}').join(currentNode._id.split('/').join('-')); } if (typeof serverinfo.altmessenging[i].localurl == 'string') { localurl = serverinfo.altmessenging[i].localurl.split('{0}').join(currentNode._id.split('/')[2]).split('{1}').join(currentNode._id.split('/')[2]).split('{2}').join(currentNode._id.split('/')[2]).split('{3}').join(currentNode._id.split('/')[2]); }
if (url != '') { meshserver.send({ action: 'msg', type: 'openUrl', nodeid: currentNode._id, url: url }); } if (url != '') { meshserver.send({ action: 'msg', type: 'openUrl', nodeid: currentNode._id, url: url }); }
if (localurl != '') { safeNewWindow(localurl, 'altmessenger:' + currentNode._id, 'directories=no,titlebar=no,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=400,height=560'); } if (localurl != '') { safeNewWindow(localurl, 'altmessenger:' + currentNode._id, 'directories=no,titlebar=no,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=400,height=560'); }
} }
@ -14429,7 +14434,17 @@
function altUserChat(e, userid, name, i) { function altUserChat(e, userid, name, i) {
if (xxdialogMode) return; if (xxdialogMode) return;
haltEvent(e); haltEvent(e);
var url = serverinfo.altmessenging[i].url.split('{0}').join(userid.split('/').join('-')); var url = serverinfo.altmessenging[i].url;
var ruserid = decodeURIComponent(userid);
var userid1 = encodeURIComponentEx(ruserid.split('/')[2]); // userid
var userid2 = encodeURIComponentEx(ruserid.split('/').join('-')); // user-domain-userid
var userid3 = userid1, userid4 = userid2;
var ruser = users[ruserid];
if ((ruser != null) && (ruser.realname != null)) {
userid3 = encodeURIComponentEx(ruser.realname.split(' ').join('')); // real name with no empty spaces
userid4 = encodeURIComponentEx(ruser.realname.split(' ').join('-')); // real name with - instead of spaces
}
url = url.split('{0}').join(userid1).split('{1}').join(userid2).split('{2}').join(userid3).split('{3}').join(userid4);
if (urlargs.key) { url += '&key=' + urlargs.key; } if (urlargs.key) { url += '&key=' + urlargs.key; }
safeNewWindow(url, 'altmessenger:' + userid); safeNewWindow(url, 'altmessenger:' + userid);
meshserver.send({ action: 'notifyuser', userid: decodeURIComponent(userid), msg: serverinfo.altmessenging[i].name, msgid: 11, url: url }); meshserver.send({ action: 'notifyuser', userid: decodeURIComponent(userid), msg: serverinfo.altmessenging[i].name, msgid: 11, url: url });
@ -15429,7 +15444,14 @@
if (!self && ((activeSessions > 0) || ((features2 & 8) && (user.webpush)))) { if (!self && ((activeSessions > 0) || ((features2 & 8) && (user.webpush)))) {
x += '<input type=button value="' + "Notify" + '" title="' + "Send user notification" + '" onclick=showUserAlertDialog(event,"' + encodeURIComponentEx(user._id) + '") />'; x += '<input type=button value="' + "Notify" + '" title="' + "Send user notification" + '" onclick=showUserAlertDialog(event,"' + encodeURIComponentEx(user._id) + '") />';
x += '<input type=button value="' + "Chat" + '" title="' + "Chat" + '" onclick=userChat(event,"' + encodeURIComponentEx(user._id) + '","' + encodeURIComponentEx(user.name) + '") />'; x += '<input type=button value="' + "Chat" + '" title="' + "Chat" + '" onclick=userChat(event,"' + encodeURIComponentEx(user._id) + '","' + encodeURIComponentEx(user.name) + '") />';
if ((activeSessions > 0) && (serverinfo != null) && (serverinfo.altmessenging != null)) { for (var i in serverinfo.altmessenging) { x += '<input type=button value="' + EscapeHtml(serverinfo.altmessenging[i].name) + '" onclick=altUserChat(event,"' + encodeURIComponentEx(user._id) + '","' + encodeURIComponentEx(user.name) + '",' + i + ') />'; } } if ((activeSessions > 0) && (serverinfo != null) && (serverinfo.altmessenging != null)) {
for (var i in serverinfo.altmessenging) {
var am = serverinfo.altmessenging[i];
if ((am.type == null) || (am.type == 'user')) {
x += '<input type=button value="' + EscapeHtml(am.name) + '" onclick=altUserChat(event,"' + encodeURIComponentEx(user._id) + '","' + encodeURIComponentEx(user.name) + '",' + i + ') />';
}
}
}
} }
// Setup the panel // Setup the panel