Access control fixes.

This commit is contained in:
Ylian Saint-Hilaire 2020-04-18 19:17:44 -07:00
parent 32911b09d2
commit dbfb1c5122
3 changed files with 131 additions and 108 deletions

View File

@ -2436,6 +2436,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
} }
} }
var selfMeshRights = 0;
try { try {
if (common.validateString(command.meshid, 1, 1024) == false) { err = 'Invalid groupid'; } // Check the meshid if (common.validateString(command.meshid, 1, 1024) == false) { err = 'Invalid groupid'; } // Check the meshid
else if (common.validateInt(command.meshadmin) == false) { err = 'Invalid group rights'; } // Mesh rights must be an integer else if (common.validateInt(command.meshadmin) == false) { err = 'Invalid group rights'; } // Mesh rights must be an integer
@ -2444,7 +2445,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
if (command.meshid.indexOf('/') == -1) { command.meshid = 'mesh/' + domain.id + '/' + command.meshid; } if (command.meshid.indexOf('/') == -1) { command.meshid = 'mesh/' + domain.id + '/' + command.meshid; }
mesh = parent.meshes[command.meshid]; mesh = parent.meshes[command.meshid];
if (mesh == null) { err = 'Unknown group'; } if (mesh == null) { err = 'Unknown group'; }
else if ((parent.GetMeshRights(user, mesh) & MESHRIGHT_MANAGEUSERS) == 0) { err = 'Permission denied'; } else if (((selfMeshRights = parent.GetMeshRights(user, mesh)) & MESHRIGHT_MANAGEUSERS) == 0) { err = 'Permission denied'; }
else if ((command.meshid.split('/').length != 3) || (command.meshid.split('/')[1] != domain.id)) { err = 'Invalid domain'; } // Invalid domain, operation only valid for current domain else if ((command.meshid.split('/').length != 3) || (command.meshid.split('/')[1] != domain.id)) { err = 'Invalid domain'; } // Invalid domain, operation only valid for current domain
} }
} catch (ex) { err = 'Validation exception: ' + ex; } } catch (ex) { err = 'Validation exception: ' + ex; }
@ -2475,16 +2476,20 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
if (newuser != null) { if (newuser != null) {
// Can't add or modify self // Can't add or modify self
if (newuserid == obj.user._id) { errors.push("Can't change self."); continue; } if (newuserid == obj.user._id) { msgs.push("Can't change self"); continue; }
var targetMeshRights = 0;
if (newuser.links[command.meshid]) { targetMeshRights = newuser.links[command.meshid].rights; }
if ((targetMeshRights == 0xFFFFFFFF) && (selfMeshRights != 0xFFFFFFFF)) { msgs.push("Can't change rights of device group administrator"); continue; } // A non-admin can't kick out an admin
if (command.remove === true) { if (command.remove === true) {
// Remove mesh from user or user group // Remove mesh from user or user group
var selfMeshRights = parent.GetMeshRights(user, mesh);
var delmeshrights = 0;
if (newuser.links[command.meshid]) { delmeshrights = newuser.links[command.meshid].rights; }
if ((delmeshrights == 0xFFFFFFFF) && (selfMeshRights != 0xFFFFFFFF)) { console.log('ttt', delmeshrights, selfMeshRights); errors.push("Can't remove device group administrator."); continue; } // A non-admin can't kick out an admin
delete newuser.links[command.meshid]; delete newuser.links[command.meshid];
} else { } else {
// Adjust rights since we can't add more rights that we have outself for MESHRIGHT_MANAGEUSERS
if ((selfMeshRights != 0xFFFFFFFF) && (command.meshadmin == 0xFFFFFFFF)) { msgs.push("Can't set device group administrator, if not administrator"); continue; }
if (((selfMeshRights & 2) == 0) && ((command.meshadmin & 2) != 0) && ((targetMeshRights & 2) == 0)) { command.meshadmin -= 2; }
// Add mesh to user or user group // Add mesh to user or user group
if (newuser.links == null) { newuser.links = {}; } if (newuser.links == null) { newuser.links = {}; }
if (newuser.links[command.meshid]) { newuser.links[command.meshid].rights = command.meshadmin; } else { newuser.links[command.meshid] = { rights: command.meshadmin }; } if (newuser.links[command.meshid]) { newuser.links[command.meshid].rights = command.meshadmin; } else { newuser.links[command.meshid] = { rights: command.meshadmin }; }

View File

@ -605,7 +605,7 @@
"default-mobile.handlebars->9->244", "default-mobile.handlebars->9->244",
"default-mobile.handlebars->9->70", "default-mobile.handlebars->9->70",
"default.handlebars->29->1312", "default.handlebars->29->1312",
"default.handlebars->29->1608", "default.handlebars->29->1610",
"default.handlebars->29->716" "default.handlebars->29->716"
] ]
}, },
@ -2375,7 +2375,7 @@
"ru": "Добавить участие", "ru": "Добавить участие",
"zh-chs": "添加會員", "zh-chs": "添加會員",
"xloc": [ "xloc": [
"default.handlebars->29->1604" "default.handlebars->29->1606"
] ]
}, },
{ {
@ -2907,7 +2907,7 @@
"ru": "Счетчик ошибок агента", "ru": "Счетчик ошибок агента",
"zh-chs": "座席錯誤計數器", "zh-chs": "座席錯誤計數器",
"xloc": [ "xloc": [
"default.handlebars->29->1617" "default.handlebars->29->1619"
] ]
}, },
{ {
@ -2976,7 +2976,7 @@
"ru": "Сессии агентов", "ru": "Сессии агентов",
"zh-chs": "座席會議", "zh-chs": "座席會議",
"xloc": [ "xloc": [
"default.handlebars->29->1633" "default.handlebars->29->1635"
] ]
}, },
{ {
@ -3099,7 +3099,7 @@
"ru": "Агенты", "ru": "Агенты",
"zh-chs": "代理商", "zh-chs": "代理商",
"xloc": [ "xloc": [
"default.handlebars->29->1646" "default.handlebars->29->1648"
] ]
}, },
{ {
@ -3909,7 +3909,7 @@
"ru": "Вы уверенны, что {0} плагин: {1}", "ru": "Вы уверенны, что {0} плагин: {1}",
"zh-chs": "您確定要{0}插件嗎:{1}", "zh-chs": "您確定要{0}插件嗎:{1}",
"xloc": [ "xloc": [
"default.handlebars->29->1686" "default.handlebars->29->1688"
] ]
}, },
{ {
@ -4322,7 +4322,7 @@
"ru": "Плохой ключ", "ru": "Плохой ключ",
"zh-chs": "錯誤的簽名", "zh-chs": "錯誤的簽名",
"xloc": [ "xloc": [
"default.handlebars->29->1624" "default.handlebars->29->1626"
] ]
}, },
{ {
@ -4339,7 +4339,7 @@
"ru": "Плохой веб-сертификат", "ru": "Плохой веб-сертификат",
"zh-chs": "錯誤的網絡證書", "zh-chs": "錯誤的網絡證書",
"xloc": [ "xloc": [
"default.handlebars->29->1623" "default.handlebars->29->1625"
] ]
}, },
{ {
@ -4600,7 +4600,7 @@
"ru": "CIRA Сервер", "ru": "CIRA Сервер",
"zh-chs": "CIRA服務器", "zh-chs": "CIRA服務器",
"xloc": [ "xloc": [
"default.handlebars->29->1674" "default.handlebars->29->1676"
] ]
}, },
{ {
@ -4617,7 +4617,7 @@
"ru": "CIRA Сервер команды", "ru": "CIRA Сервер команды",
"zh-chs": "CIRA服務器命令", "zh-chs": "CIRA服務器命令",
"xloc": [ "xloc": [
"default.handlebars->29->1675" "default.handlebars->29->1677"
] ]
}, },
{ {
@ -4634,7 +4634,7 @@
"ru": "Загрузка CPU", "ru": "Загрузка CPU",
"zh-chs": "CPU負載", "zh-chs": "CPU負載",
"xloc": [ "xloc": [
"default.handlebars->29->1638" "default.handlebars->29->1640"
] ]
}, },
{ {
@ -4651,7 +4651,7 @@
"ru": "Загрузка CPU за последние 15 минут", "ru": "Загрузка CPU за последние 15 минут",
"zh-chs": "最近15分鐘的CPU負載", "zh-chs": "最近15分鐘的CPU負載",
"xloc": [ "xloc": [
"default.handlebars->29->1641" "default.handlebars->29->1643"
] ]
}, },
{ {
@ -4668,7 +4668,7 @@
"ru": "Загрузка CPU за последние 5 минут", "ru": "Загрузка CPU за последние 5 минут",
"zh-chs": "最近5分鐘的CPU負載", "zh-chs": "最近5分鐘的CPU負載",
"xloc": [ "xloc": [
"default.handlebars->29->1640" "default.handlebars->29->1642"
] ]
}, },
{ {
@ -4685,7 +4685,7 @@
"ru": "Загрузка CPU за последнюю минуту", "ru": "Загрузка CPU за последнюю минуту",
"zh-chs": "最後一分鐘的CPU負載", "zh-chs": "最後一分鐘的CPU負載",
"xloc": [ "xloc": [
"default.handlebars->29->1639" "default.handlebars->29->1641"
] ]
}, },
{ {
@ -4740,7 +4740,7 @@
"ru": "Ошибка вызова", "ru": "Ошибка вызова",
"zh-chs": "通話錯誤", "zh-chs": "通話錯誤",
"xloc": [ "xloc": [
"default.handlebars->29->1687" "default.handlebars->29->1689"
] ]
}, },
{ {
@ -5166,7 +5166,7 @@
"ru": "Проверка...", "ru": "Проверка...",
"zh-chs": "檢查...", "zh-chs": "檢查...",
"xloc": [ "xloc": [
"default.handlebars->29->1681", "default.handlebars->29->1683",
"default.handlebars->29->841" "default.handlebars->29->841"
] ]
}, },
@ -5414,7 +5414,7 @@
"zh-chs": "清除此通知", "zh-chs": "清除此通知",
"es": "Borrar esta notificación", "es": "Borrar esta notificación",
"xloc": [ "xloc": [
"default.handlebars->29->1611" "default.handlebars->29->1613"
] ]
}, },
{ {
@ -5790,7 +5790,7 @@
"en": "Confirm membership removal of user group \\\"{0}\\\"?", "en": "Confirm membership removal of user group \\\"{0}\\\"?",
"nl": "Bevestig lidmaatschap verwijdering van gebruikergroep \\\"{0}\\\"?", "nl": "Bevestig lidmaatschap verwijdering van gebruikergroep \\\"{0}\\\"?",
"xloc": [ "xloc": [
"default.handlebars->29->1602" "default.handlebars->29->1604"
] ]
}, },
{ {
@ -5859,7 +5859,7 @@
"nl": "Bevestig verwijdering van toegangsrechten voor apparaatgroep \\\"{0}\\\"?", "nl": "Bevestig verwijdering van toegangsrechten voor apparaatgroep \\\"{0}\\\"?",
"xloc": [ "xloc": [
"default.handlebars->29->1494", "default.handlebars->29->1494",
"default.handlebars->29->1606" "default.handlebars->29->1608"
] ]
}, },
{ {
@ -5873,7 +5873,14 @@
"en": "Confirm removal of access rights for user group \\\"{0}\\\"?", "en": "Confirm removal of access rights for user group \\\"{0}\\\"?",
"nl": "Bevestig verwijdering van toegangsrechten voor gebruikergroep \\\"{0}\\\"?", "nl": "Bevestig verwijdering van toegangsrechten voor gebruikergroep \\\"{0}\\\"?",
"xloc": [ "xloc": [
"default.handlebars->29->1599" "default.handlebars->29->1600"
]
},
{
"en": "Confirm removal of access rights?",
"xloc": [
"default.handlebars->29->1598",
"default.handlebars->29->1601"
] ]
}, },
{ {
@ -6097,7 +6104,7 @@
"ru": "Подключено Intel® AMT", "ru": "Подключено Intel® AMT",
"zh-chs": "連接的英特爾®AMT", "zh-chs": "連接的英特爾®AMT",
"xloc": [ "xloc": [
"default.handlebars->29->1629" "default.handlebars->29->1631"
] ]
}, },
{ {
@ -6114,7 +6121,7 @@
"ru": "Подключенные пользователи", "ru": "Подключенные пользователи",
"zh-chs": "關聯用戶", "zh-chs": "關聯用戶",
"xloc": [ "xloc": [
"default.handlebars->29->1634" "default.handlebars->29->1636"
] ]
}, },
{ {
@ -6190,7 +6197,7 @@
"ru": "Подключений ", "ru": "Подключений ",
"zh-chs": "連接數", "zh-chs": "連接數",
"xloc": [ "xloc": [
"default.handlebars->29->1645" "default.handlebars->29->1647"
] ]
}, },
{ {
@ -6207,7 +6214,7 @@
"ru": "Ретранслятор подключения", "ru": "Ретранслятор подключения",
"zh-chs": "連接繼電器", "zh-chs": "連接繼電器",
"xloc": [ "xloc": [
"default.handlebars->29->1673" "default.handlebars->29->1675"
] ]
}, },
{ {
@ -6332,7 +6339,7 @@
"ru": "Cookie-кодировщик", "ru": "Cookie-кодировщик",
"zh-chs": "Cookie編碼器", "zh-chs": "Cookie編碼器",
"xloc": [ "xloc": [
"default.handlebars->29->1659" "default.handlebars->29->1661"
] ]
}, },
{ {
@ -6633,7 +6640,7 @@
"ru": "Основной сервер", "ru": "Основной сервер",
"zh-chs": "核心服務器", "zh-chs": "核心服務器",
"xloc": [ "xloc": [
"default.handlebars->29->1658" "default.handlebars->29->1660"
] ]
}, },
{ {
@ -7802,7 +7809,7 @@
"default.handlebars->29->1447", "default.handlebars->29->1447",
"default.handlebars->29->1469", "default.handlebars->29->1469",
"default.handlebars->29->1531", "default.handlebars->29->1531",
"default.handlebars->29->1632", "default.handlebars->29->1634",
"default.handlebars->container->column_l->p2->p2info->7" "default.handlebars->container->column_l->p2->p2info->7"
] ]
}, },
@ -8819,7 +8826,7 @@
"en": "Duplicate Agent", "en": "Duplicate Agent",
"nl": "Dubbele agent", "nl": "Dubbele agent",
"xloc": [ "xloc": [
"default.handlebars->29->1628" "default.handlebars->29->1630"
] ]
}, },
{ {
@ -9342,7 +9349,7 @@
"zh-chs": "电子邮件流量", "zh-chs": "电子邮件流量",
"es": "Tráfico de correo electrónico", "es": "Tráfico de correo electrónico",
"xloc": [ "xloc": [
"default.handlebars->29->1667" "default.handlebars->29->1669"
] ]
}, },
{ {
@ -10110,7 +10117,7 @@
"ru": "Внешний", "ru": "Внешний",
"zh-chs": "外部", "zh-chs": "外部",
"xloc": [ "xloc": [
"default.handlebars->29->1652" "default.handlebars->29->1654"
] ]
}, },
{ {
@ -10596,8 +10603,8 @@
"ru": "Свободно", "ru": "Свободно",
"zh-chs": "自由", "zh-chs": "自由",
"xloc": [ "xloc": [
"default.handlebars->29->1613", "default.handlebars->29->1615",
"default.handlebars->29->1615" "default.handlebars->29->1617"
] ]
}, },
{ {
@ -11486,7 +11493,7 @@
"ru": "Всего кучи", "ru": "Всего кучи",
"zh-chs": "堆總數", "zh-chs": "堆總數",
"xloc": [ "xloc": [
"default.handlebars->29->1654" "default.handlebars->29->1656"
] ]
}, },
{ {
@ -11503,7 +11510,7 @@
"ru": "Куча используется", "ru": "Куча используется",
"zh-chs": "堆使用", "zh-chs": "堆使用",
"xloc": [ "xloc": [
"default.handlebars->29->1653" "default.handlebars->29->1655"
] ]
}, },
{ {
@ -12275,8 +12282,8 @@
"xloc": [ "xloc": [
"default.handlebars->29->1301", "default.handlebars->29->1301",
"default.handlebars->29->1307", "default.handlebars->29->1307",
"default.handlebars->29->1650", "default.handlebars->29->1652",
"default.handlebars->29->1672" "default.handlebars->29->1674"
] ]
}, },
{ {
@ -12981,7 +12988,7 @@
"ru": "Некорректный тип группы устройств", "ru": "Некорректный тип группы устройств",
"zh-chs": "無效的設備組類型", "zh-chs": "無效的設備組類型",
"xloc": [ "xloc": [
"default.handlebars->29->1627" "default.handlebars->29->1629"
] ]
}, },
{ {
@ -12998,7 +13005,7 @@
"ru": "Некорректный JSON", "ru": "Некорректный JSON",
"zh-chs": "無效的JSON", "zh-chs": "無效的JSON",
"xloc": [ "xloc": [
"default.handlebars->29->1621" "default.handlebars->29->1623"
] ]
}, },
{ {
@ -13050,7 +13057,7 @@
"ru": "Некорректная сигнатура PKCS", "ru": "Некорректная сигнатура PKCS",
"zh-chs": "無效的PKCS簽名", "zh-chs": "無效的PKCS簽名",
"xloc": [ "xloc": [
"default.handlebars->29->1619" "default.handlebars->29->1621"
] ]
}, },
{ {
@ -13067,7 +13074,7 @@
"ru": "Некорректная сигнатура RSA", "ru": "Некорректная сигнатура RSA",
"zh-chs": "無效的RSA密碼", "zh-chs": "無效的RSA密碼",
"xloc": [ "xloc": [
"default.handlebars->29->1620" "default.handlebars->29->1622"
] ]
}, },
{ {
@ -14128,7 +14135,7 @@
"ru": "Меньше", "ru": "Меньше",
"zh-chs": "減", "zh-chs": "減",
"xloc": [ "xloc": [
"default.handlebars->29->1689" "default.handlebars->29->1691"
] ]
}, },
{ {
@ -15204,7 +15211,7 @@
"ru": "Сообщения главного сервера", "ru": "Сообщения главного сервера",
"zh-chs": "主服務器消息", "zh-chs": "主服務器消息",
"xloc": [ "xloc": [
"default.handlebars->29->1661" "default.handlebars->29->1663"
] ]
}, },
{ {
@ -15605,7 +15612,7 @@
"ru": "Достигнуто максимальное число сессий", "ru": "Достигнуто максимальное число сессий",
"zh-chs": "達到的會話數上限", "zh-chs": "達到的會話數上限",
"xloc": [ "xloc": [
"default.handlebars->29->1625" "default.handlebars->29->1627"
] ]
}, },
{ {
@ -15659,7 +15666,7 @@
"ru": "Мегабайт", "ru": "Мегабайт",
"zh-chs": "兆字節", "zh-chs": "兆字節",
"xloc": [ "xloc": [
"default.handlebars->29->1651" "default.handlebars->29->1653"
] ]
}, },
{ {
@ -15676,7 +15683,7 @@
"ru": "ОЗУ", "ru": "ОЗУ",
"zh-chs": "記憶", "zh-chs": "記憶",
"xloc": [ "xloc": [
"default.handlebars->29->1642", "default.handlebars->29->1644",
"default.handlebars->29->806", "default.handlebars->29->806",
"default.handlebars->container->column_l->p40->3->1->p40type->3" "default.handlebars->container->column_l->p40->3->1->p40type->3"
] ]
@ -15812,7 +15819,7 @@
"ru": "Трафик MeshAgent", "ru": "Трафик MeshAgent",
"zh-chs": "MeshAgent流量", "zh-chs": "MeshAgent流量",
"xloc": [ "xloc": [
"default.handlebars->29->1663" "default.handlebars->29->1665"
] ]
}, },
{ {
@ -15829,7 +15836,7 @@
"ru": "Обновление MeshAgent", "ru": "Обновление MeshAgent",
"zh-chs": "MeshAgent更新", "zh-chs": "MeshAgent更新",
"xloc": [ "xloc": [
"default.handlebars->29->1664" "default.handlebars->29->1666"
] ]
}, },
{ {
@ -15932,7 +15939,7 @@
"ru": "Соединения сервера MeshCentral", "ru": "Соединения сервера MeshCentral",
"zh-chs": "MeshCentral服務器對等", "zh-chs": "MeshCentral服務器對等",
"xloc": [ "xloc": [
"default.handlebars->29->1662" "default.handlebars->29->1664"
] ]
}, },
{ {
@ -16195,7 +16202,7 @@
"ru": "Диспетчер сообщения", "ru": "Диспетчер сообщения",
"zh-chs": "郵件調度程序", "zh-chs": "郵件調度程序",
"xloc": [ "xloc": [
"default.handlebars->29->1660" "default.handlebars->29->1662"
] ]
}, },
{ {
@ -16326,7 +16333,7 @@
"ru": "Еще", "ru": "Еще",
"zh-chs": "更多", "zh-chs": "更多",
"xloc": [ "xloc": [
"default.handlebars->29->1688" "default.handlebars->29->1690"
] ]
}, },
{ {
@ -17052,7 +17059,7 @@
"zh-chs": "找不到活動", "zh-chs": "找不到活動",
"xloc": [ "xloc": [
"default.handlebars->29->1350", "default.handlebars->29->1350",
"default.handlebars->29->1607", "default.handlebars->29->1609",
"default.handlebars->29->754" "default.handlebars->29->754"
] ]
}, },
@ -18162,7 +18169,7 @@
"ru": "Произошло в {0}", "ru": "Произошло в {0}",
"zh-chs": "發生在{0}", "zh-chs": "發生在{0}",
"xloc": [ "xloc": [
"default.handlebars->29->1610" "default.handlebars->29->1612"
] ]
}, },
{ {
@ -19192,7 +19199,7 @@
"zh-chs": "插件動作", "zh-chs": "插件動作",
"xloc": [ "xloc": [
"default.handlebars->29->164", "default.handlebars->29->164",
"default.handlebars->29->1685" "default.handlebars->29->1687"
] ]
}, },
{ {
@ -19908,7 +19915,7 @@
"ru": "RSS", "ru": "RSS",
"zh-chs": "的RSS", "zh-chs": "的RSS",
"xloc": [ "xloc": [
"default.handlebars->29->1655" "default.handlebars->29->1657"
] ]
}, },
{ {
@ -20092,7 +20099,7 @@
"ru": "Число ретрансляций", "ru": "Число ретрансляций",
"zh-chs": "中繼計數", "zh-chs": "中繼計數",
"xloc": [ "xloc": [
"default.handlebars->29->1637" "default.handlebars->29->1639"
] ]
}, },
{ {
@ -20109,7 +20116,7 @@
"ru": "Ошибки ретранслятора", "ru": "Ошибки ретранслятора",
"zh-chs": "中繼錯誤", "zh-chs": "中繼錯誤",
"xloc": [ "xloc": [
"default.handlebars->29->1630" "default.handlebars->29->1632"
] ]
}, },
{ {
@ -20126,8 +20133,8 @@
"ru": "Сессии ретранслятора", "ru": "Сессии ретранслятора",
"zh-chs": "接力會議", "zh-chs": "接力會議",
"xloc": [ "xloc": [
"default.handlebars->29->1636", "default.handlebars->29->1638",
"default.handlebars->29->1649" "default.handlebars->29->1651"
] ]
}, },
{ {
@ -20419,7 +20426,7 @@
"nl": "Apparaatgroepmachtigingen verwijderen", "nl": "Apparaatgroepmachtigingen verwijderen",
"xloc": [ "xloc": [
"default.handlebars->29->1493", "default.handlebars->29->1493",
"default.handlebars->29->1605" "default.handlebars->29->1607"
] ]
}, },
{ {
@ -20448,7 +20455,7 @@
"en": "Remove User Group Membership", "en": "Remove User Group Membership",
"nl": "Lidmaatschap van gebruikersgroep verwijderen", "nl": "Lidmaatschap van gebruikersgroep verwijderen",
"xloc": [ "xloc": [
"default.handlebars->29->1601" "default.handlebars->29->1603"
] ]
}, },
{ {
@ -20456,7 +20463,7 @@
"nl": "Gebruikersgroepmachtigingen verwijderen", "nl": "Gebruikersgroepmachtigingen verwijderen",
"xloc": [ "xloc": [
"default.handlebars->29->1277", "default.handlebars->29->1277",
"default.handlebars->29->1598" "default.handlebars->29->1599"
] ]
}, },
{ {
@ -21950,7 +21957,7 @@
"ru": "Сертификат сервера", "ru": "Сертификат сервера",
"zh-chs": "服務器證書", "zh-chs": "服務器證書",
"xloc": [ "xloc": [
"default.handlebars->29->1665" "default.handlebars->29->1667"
] ]
}, },
{ {
@ -21967,7 +21974,7 @@
"zh-chs": "服務器數據庫", "zh-chs": "服務器數據庫",
"es": "Base de Datos del Servidor", "es": "Base de Datos del Servidor",
"xloc": [ "xloc": [
"default.handlebars->29->1666" "default.handlebars->29->1668"
] ]
}, },
{ {
@ -22076,7 +22083,7 @@
"ru": "Состояние сервера", "ru": "Состояние сервера",
"zh-chs": "服務器狀態", "zh-chs": "服務器狀態",
"xloc": [ "xloc": [
"default.handlebars->29->1616" "default.handlebars->29->1618"
] ]
}, },
{ {
@ -22110,7 +22117,7 @@
"ru": "Трассировка сервера", "ru": "Трассировка сервера",
"zh-chs": "服務器跟踪", "zh-chs": "服務器跟踪",
"xloc": [ "xloc": [
"default.handlebars->29->1676" "default.handlebars->29->1678"
] ]
}, },
{ {
@ -22249,7 +22256,7 @@
"ru": "ServerStats.csv", "ru": "ServerStats.csv",
"zh-chs": "ServerStats.csv", "zh-chs": "ServerStats.csv",
"xloc": [ "xloc": [
"default.handlebars->29->1657" "default.handlebars->29->1659"
] ]
}, },
{ {
@ -24319,7 +24326,7 @@
"ru": "На данный момент уведомлений нет", "ru": "На данный момент уведомлений нет",
"zh-chs": "目前沒有任何通知", "zh-chs": "目前沒有任何通知",
"xloc": [ "xloc": [
"default.handlebars->29->1609" "default.handlebars->29->1611"
] ]
}, },
{ {
@ -25525,7 +25532,7 @@
"default-mobile.handlebars->9->174", "default-mobile.handlebars->9->174",
"default-mobile.handlebars->9->175", "default-mobile.handlebars->9->175",
"default.handlebars->29->13", "default.handlebars->29->13",
"default.handlebars->29->1600", "default.handlebars->29->1602",
"default.handlebars->29->374", "default.handlebars->29->374",
"default.handlebars->29->41", "default.handlebars->29->41",
"default.handlebars->29->42", "default.handlebars->29->42",
@ -25570,7 +25577,7 @@
"ru": "Неизвестное действие", "ru": "Неизвестное действие",
"zh-chs": "未知動作", "zh-chs": "未知動作",
"xloc": [ "xloc": [
"default.handlebars->29->1622" "default.handlebars->29->1624"
] ]
}, },
{ {
@ -25607,7 +25614,7 @@
"xloc": [ "xloc": [
"default.handlebars->29->1480", "default.handlebars->29->1480",
"default.handlebars->29->1578", "default.handlebars->29->1578",
"default.handlebars->29->1626" "default.handlebars->29->1628"
] ]
}, },
{ {
@ -25624,7 +25631,7 @@
"ru": "Неизвестная группа", "ru": "Неизвестная группа",
"zh-chs": "未知群組", "zh-chs": "未知群組",
"xloc": [ "xloc": [
"default.handlebars->29->1618" "default.handlebars->29->1620"
] ]
}, },
{ {
@ -25741,7 +25748,7 @@
"ru": "Актуально", "ru": "Актуально",
"zh-chs": "最新", "zh-chs": "最新",
"xloc": [ "xloc": [
"default.handlebars->29->1683" "default.handlebars->29->1685"
] ]
}, },
{ {
@ -25990,8 +25997,8 @@
"ru": "Использовано", "ru": "Использовано",
"zh-chs": "用過的", "zh-chs": "用過的",
"xloc": [ "xloc": [
"default.handlebars->29->1612", "default.handlebars->29->1614",
"default.handlebars->29->1614" "default.handlebars->29->1616"
] ]
}, },
{ {
@ -26067,7 +26074,7 @@
"ru": "Учетные записи пользователей", "ru": "Учетные записи пользователей",
"zh-chs": "用戶帳號", "zh-chs": "用戶帳號",
"xloc": [ "xloc": [
"default.handlebars->29->1631" "default.handlebars->29->1633"
] ]
}, },
{ {
@ -26126,7 +26133,7 @@
"default.handlebars->29->1211", "default.handlebars->29->1211",
"default.handlebars->29->1458", "default.handlebars->29->1458",
"default.handlebars->29->1586", "default.handlebars->29->1586",
"default.handlebars->29->1603", "default.handlebars->29->1605",
"default.handlebars->29->555" "default.handlebars->29->555"
] ]
}, },
@ -26277,7 +26284,7 @@
"ru": "Сессии пользователя", "ru": "Сессии пользователя",
"zh-chs": "用戶會話", "zh-chs": "用戶會話",
"xloc": [ "xloc": [
"default.handlebars->29->1648" "default.handlebars->29->1650"
] ]
}, },
{ {
@ -26462,7 +26469,7 @@
"xloc": [ "xloc": [
"default.handlebars->29->1446", "default.handlebars->29->1446",
"default.handlebars->29->1468", "default.handlebars->29->1468",
"default.handlebars->29->1647", "default.handlebars->29->1649",
"default.handlebars->container->topbar->1->1->UsersSubMenuSpan->UsersSubMenu->1->0->UsersGeneral" "default.handlebars->container->topbar->1->1->UsersSubMenuSpan->UsersSubMenu->1->0->UsersGeneral"
] ]
}, },
@ -26480,7 +26487,7 @@
"ru": "Сессии пользователей", "ru": "Сессии пользователей",
"zh-chs": "用戶會話", "zh-chs": "用戶會話",
"xloc": [ "xloc": [
"default.handlebars->29->1635" "default.handlebars->29->1637"
] ]
}, },
{ {
@ -26619,7 +26626,7 @@
"zh-chs": "版本不兼容请先升级您的MeshCentral安装", "zh-chs": "版本不兼容请先升级您的MeshCentral安装",
"es": "Versión Incompatible, por favor primero actualice su instalación de MeshCentral", "es": "Versión Incompatible, por favor primero actualice su instalación de MeshCentral",
"xloc": [ "xloc": [
"default.handlebars->29->1679" "default.handlebars->29->1681"
] ]
}, },
{ {
@ -26685,8 +26692,8 @@
"zh-chs": "查看变更日志", "zh-chs": "查看变更日志",
"es": "Ver registro de cambios", "es": "Ver registro de cambios",
"xloc": [ "xloc": [
"default.handlebars->29->1682", "default.handlebars->29->1684",
"default.handlebars->29->1684" "default.handlebars->29->1686"
] ]
}, },
{ {
@ -26929,8 +26936,8 @@
"ru": "Веб-сервер", "ru": "Веб-сервер",
"zh-chs": "網絡服務器", "zh-chs": "網絡服務器",
"xloc": [ "xloc": [
"default.handlebars->29->1668", "default.handlebars->29->1670",
"default.handlebars->29->1669" "default.handlebars->29->1671"
] ]
}, },
{ {
@ -26947,7 +26954,7 @@
"ru": "Запросы веб-сервера", "ru": "Запросы веб-сервера",
"zh-chs": "Web服務器請求", "zh-chs": "Web服務器請求",
"xloc": [ "xloc": [
"default.handlebars->29->1670" "default.handlebars->29->1672"
] ]
}, },
{ {
@ -26964,7 +26971,7 @@
"ru": "Ретранслятор Web Socket", "ru": "Ретранслятор Web Socket",
"zh-chs": "Web套接字中繼", "zh-chs": "Web套接字中繼",
"xloc": [ "xloc": [
"default.handlebars->29->1671" "default.handlebars->29->1673"
] ]
}, },
{ {
@ -27985,7 +27992,7 @@
"ru": "\\\\'", "ru": "\\\\'",
"zh-chs": "\\\\'", "zh-chs": "\\\\'",
"xloc": [ "xloc": [
"default.handlebars->29->1680" "default.handlebars->29->1682"
] ]
}, },
{ {
@ -28256,7 +28263,7 @@
"ru": "свободно", "ru": "свободно",
"zh-chs": "自由", "zh-chs": "自由",
"xloc": [ "xloc": [
"default.handlebars->29->1643" "default.handlebars->29->1645"
] ]
}, },
{ {
@ -28612,7 +28619,7 @@
"ru": "servertrace.csv", "ru": "servertrace.csv",
"zh-chs": "servertrace.csv", "zh-chs": "servertrace.csv",
"xloc": [ "xloc": [
"default.handlebars->29->1678" "default.handlebars->29->1680"
] ]
}, },
{ {
@ -28665,7 +28672,7 @@
"zh-chs": "時間conn.agentconn.usersconn.usersessionsconn.relaysessionconn.intelamtmem.externalmem.heapusedmem.heaptotalmem.rss", "zh-chs": "時間conn.agentconn.usersconn.usersessionsconn.relaysessionconn.intelamtmem.externalmem.heapusedmem.heaptotalmem.rss",
"es": "time, conn.agent, conn.users, conn.usersessions, conn.relaysession, conn.intelamt, mem.external, mem.heapused, mem.heaptotal, mem.rss", "es": "time, conn.agent, conn.users, conn.usersessions, conn.relaysession, conn.intelamt, mem.external, mem.heapused, mem.heaptotal, mem.rss",
"xloc": [ "xloc": [
"default.handlebars->29->1656" "default.handlebars->29->1658"
] ]
}, },
{ {
@ -28682,7 +28689,7 @@
"ru": "time, source, message", "ru": "time, source, message",
"zh-chs": "時間,來源,訊息", "zh-chs": "時間,來源,訊息",
"xloc": [ "xloc": [
"default.handlebars->29->1677" "default.handlebars->29->1679"
] ]
}, },
{ {
@ -28713,7 +28720,7 @@
"ru": "всего", "ru": "всего",
"zh-chs": "總", "zh-chs": "總",
"xloc": [ "xloc": [
"default.handlebars->29->1644" "default.handlebars->29->1646"
] ]
}, },
{ {

View File

@ -1811,11 +1811,11 @@
var groupCount = 0; var groupCount = 0;
if (Array.isArray(message.ugroups)) { if (Array.isArray(message.ugroups)) {
usergroups = {}; usergroups = {};
for (var i in message.ugroups) { groupCount++; usergroups[message.ugroups[i]._id] = message.ugroups[i]; } for (var i in message.ugroups) { groupCount++; usergroups[message.ugroups[i]._id] = message.ugroups[i]; }
if (groupCount == 0) { usergroups = null; } if (groupCount == 0) { usergroups = null; }
} else { } else {
usergroups = message.ugroups; usergroups = message.ugroups;
for (var i in message.ugroups) { groupCount++; } for (var i in message.ugroups) { groupCount++; message.ugroups[i]._id = i; }
if (groupCount == 0) { usergroups = null; } if (groupCount == 0) { usergroups = null; }
} }
masterUpdate(8192); masterUpdate(8192);
@ -8692,6 +8692,7 @@
if (userid == null) { if (userid == null) {
setDialogMode(2, "Add Users to Device Group", 3, p20showAddMeshUserDialogEx, x); setDialogMode(2, "Add Users to Device Group", 3, p20showAddMeshUserDialogEx, x);
QE('p20fulladmin', GetMeshRights(currentMesh) == 0xFFFFFFFF);
Q('dp20username').focus(); Q('dp20username').focus();
} else if (userid === 1) { } else if (userid === 1) {
setDialogMode(2, (selected == null)?"Add Device Group Permissions":"Edit Device Group Permissions", selected?7:3, p20showAddMeshUserDialogEx, x, userid); setDialogMode(2, (selected == null)?"Add Device Group Permissions":"Edit Device Group Permissions", selected?7:3, p20showAddMeshUserDialogEx, x, userid);
@ -8699,6 +8700,7 @@
if (urights == 0xFFFFFFFF) { Q('p20fulladmin').checked = true; urights = -1; } if (urights == 0xFFFFFFFF) { Q('p20fulladmin').checked = true; urights = -1; }
} else if (userid === 2) { } else if (userid === 2) {
setDialogMode(2, "Add User Group", 3, p20showAddMeshUserDialogEx, x, userid); setDialogMode(2, "Add User Group", 3, p20showAddMeshUserDialogEx, x, userid);
QE('p20fulladmin', GetMeshRights(currentMesh) == 0xFFFFFFFF);
} else if (userid === 3) { } else if (userid === 3) {
setDialogMode(2, (selected == null)?"Add Device Group":"Edit Device Group", selected?7:3, p20showAddMeshUserDialogEx, x, userid); setDialogMode(2, (selected == null)?"Add Device Group":"Edit Device Group", selected?7:3, p20showAddMeshUserDialogEx, x, userid);
QE('dp2groupid', selected == null); QE('dp2groupid', selected == null);
@ -8733,6 +8735,7 @@
} }
var cmeshrights = GetMeshRights(currentMesh), urights = GetMeshRights(currentMesh, userid); var cmeshrights = GetMeshRights(currentMesh), urights = GetMeshRights(currentMesh, userid);
if (urights == 0xFFFFFFFF) { Q('p20fulladmin').checked = true; urights = -1; } if (urights == 0xFFFFFFFF) { Q('p20fulladmin').checked = true; urights = -1; }
QE('p20fulladmin', GetMeshRights(currentMesh) == 0xFFFFFFFF);
} }
if (urights != -1) { if (urights != -1) {
@ -10808,12 +10811,14 @@
function p30removeUserFromNode(event, userid) { function p30removeUserFromNode(event, userid) {
if (xxdialogMode) return; if (xxdialogMode) return;
var user = users[decodeURIComponent(userid)]; var user = null, name = '';
if (user != null) { userid = decodeURIComponent(userid);
setDialogMode(2, "Remove User Permissions", 3, function(b, user) { meshserver.send({ action: 'adddeviceuser', nodeid: currentNode._id, nodename: currentNode.name, userids: [ user._id ], rights: 0, remove: true }); }, format("Confirm removal of access rights for user \"{0}\"?", user.name), user); if (userid.startsWith('user/')) {
} else if (usergroups != null) { if (users) { user = users[userid]; if (user != null) { name = user.name; } }
user = usergroups[decodeURIComponent(userid)]; setDialogMode(2, "Remove User Permissions", 3, function(b, user) { meshserver.send({ action: 'adddeviceuser', nodeid: currentNode._id, nodename: currentNode.name, userids: [ userid ], rights: 0, remove: true }); }, name?format("Confirm removal of access rights for user \"{0}\"?", name):"Confirm removal of access rights?", user);
if (user != null) { setDialogMode(2, "Remove User Group Permissions", 3, function(b, user) { meshserver.send({ action: 'adddeviceuser', nodeid: currentNode._id, nodename: currentNode.name, userids: [ user._id ], rights: 0, remove: true }); }, format("Confirm removal of access rights for user group \"{0}\"?", user.name), user); } } else if (userid.startsWith('ugrp/')) {
if (usergroups) { user = usergroups[userid]; if (user != null) { name = user.name; } }
setDialogMode(2, "Remove User Group Permissions", 3, function(b, user) { meshserver.send({ action: 'adddeviceuser', nodeid: currentNode._id, nodename: currentNode.name, userids: [ userid ], rights: 0, remove: true }); }, name?format("Confirm removal of access rights for user group \"{0}\"?", name):"Confirm removal of access rights?", user);
} }
} }
@ -11483,8 +11488,14 @@
if (event && (event.shiftKey == true) && (x != 15) && ('{{currentNode}}' == '')) { if (event && (event.shiftKey == true) && (x != 15) && ('{{currentNode}}' == '')) {
// Open the device in a different tab // Open the device in a different tab
if ((x >= 10) && (x <= 19)) { if ((x >= 10) && (x <= 19)) {
if (currentNode) { window.open(window.location.origin + '?node=' + currentNode._id.split('/')[2] + '&viewmode=' + x + '&hide=16', 'meshcentral:' + currentNode._id); } if (currentNode) { window.open(window.location.origin + '?gotonode=' + currentNode._id.split('/')[2] + '&viewmode=' + x + '&hide=16', 'meshcentral:' + currentNode._id); }
} else if (x < 10) { } else if ((x >= 20) && (x <= 29)) {
if (currentMesh) { window.open(window.location.origin + '?gotomesh=' + currentMesh._id.split('/')[2] + '&viewmode=' + x + '&hide=16', 'meshcentral:' + currentMesh._id); }
} else if ((x >= 30) && (x <= 39)) {
if (currentUser) { window.open(window.location.origin + '?gotouser=' + currentUser._id.split('/')[2] + '&viewmode=' + x + '&hide=16', 'meshcentral:' + currentUser._id); }
} else if ((x >= 50) && (x <= 59)) {
if (currentUserGroup) { window.open(window.location.origin + '?gotougrp=' + currentUserGroup._id.split('/')[2] + '&viewmode=' + x + '&hide=16', 'meshcentral:' + currentUserGroup._id); }
} else { // if (x < 10))
window.open(window.location.origin + '?viewmode=' + x + '&hide=0', 'meshcentral:' + x); window.open(window.location.origin + '?viewmode=' + x + '&hide=0', 'meshcentral:' + x);
} }
return; return;