Fixed web app exception when going to view a user.

Ylian Saint-Hilaire committed May 15, 2020 at 16:28 UTC 08071b75406fe3db05dbd6a152c79204dbdd3087
1 file changed +9 -7
views/default.handlebars
+9 -7
@@ -487,7 +487,7 @@
487 </td>
488 <td style=width:20px></td>
489 <td style=width:200px;vertical-align:top;position:relative valign=top>
490 - <img id="p10deviceNotify" onclick=showDeviceSessions() class=deviceNotifyLargeDot src=images/icon-relay-notify-40.png width=40 height=40>
490 + <img id="p10deviceNotify" onclick=showDeviceSessions(null,null,event) class=deviceNotifyLargeDot src=images/icon-relay-notify-40.png width=40 height=40>
491 <a href=# onclick=p10showiconselector()><img id=MainComputerImage></a>
492 <div id=MainComputerState></div>
493 </td>
@@ -3177,9 +3177,9 @@
3177 var devNotify = '';
3178 if (node.sessions != null) {
3179 if (view == 2) {
3180 - devNotify = '<img onclick=showDeviceSessions(\'' + node._id + '\') class=deviceNotifySmallDot src=images/icon-relay-notify10.png width=10 height=10>';
3180 + devNotify = '<img onclick=showDeviceSessions(\'' + node._id + '\',null,event) class=deviceNotifySmallDot src=images/icon-relay-notify10.png width=10 height=10>';
3181 } else {
3182 - devNotify = '<img onclick=showDeviceSessions(\'' + node._id + '\') class=deviceNotifyDot src=images/icon-relay-notify.png width=16 height=16>';
3182 + devNotify = '<img onclick=showDeviceSessions(\'' + node._id + '\',null,event) class=deviceNotifyDot src=images/icon-relay-notify.png width=16 height=16>';
3183 }
3184 }
3185
@@ -3426,11 +3426,12 @@
3426 }
3427
3428 // Show currently active sessions on this device
3429 - function showDeviceSessions(nodeid, force) {
3430 - if (xxdialogMode && !force) return;
3429 + function showDeviceSessions(nodeid, force, e) {
3430 + if (e) haltEvent(e);
3431 + if (xxdialogMode && !force) return false;
3432 var node = null, x = '';
3433 if (nodeid == null) { node = currentNode; } else { node = getNodeFromId(nodeid); }
3433 - if ((node == null) || (node.sessions == null)) { setDialogMode(0); return; }
3434 + if ((node == null) || (node.sessions == null)) { setDialogMode(0); return false; }
3435 for (var i in node.sessions) {
3436 if ((i == 'kvm') && (node.sessions.multidesk == null)) {
3437 x += '<u>' + "Remote Desktop" + '</u>';
@@ -3447,6 +3448,7 @@
3448 }
3449 }
3450 if (x != '') setDialogMode(2, "Sessions" + ' - ' + EscapeHtml(node.name), 1, null, x, 'SESSIONS-' + node._id);
3451 + return false;
3452 }
3453
3454 function toggleCollapseGroup(id, id2, type) {
@@ -10964,7 +10966,7 @@
10966 if (userAdminRights) { x += '<a href=# style=cursor:pointer onclick=\'return p30showDeleteUserDialog()\' title="' + "Remove this user" + '">' + "Delete User" + '</a>'; }
10967 x += '</div><div style=font-size:x-small>';
10968 // If user admin rights and not SSPI/LDAP and UserID does not start with ~, show change password
10967 - if (userAdminRights && ((features & 0x00080000) == 0) && (userid.split('/')[2][0] != '~')) { x += '<a href=# style=cursor:pointer onclick=\'return p30showUserChangePassDialog(' + multiFactor + ')\' title="' + "Change the password for this user" + '">' + "Change Password" + '</a>'; }
10969 + if (userAdminRights && ((features & 0x00080000) == 0) && (user._id.split('/')[2][0] != '~')) { x += '<a href=# style=cursor:pointer onclick=\'return p30showUserChangePassDialog(' + multiFactor + ')\' title="' + "Change the password for this user" + '">' + "Change Password" + '</a>'; }
10970 x += '</div><br>'
10971 QH('p30html3', x);
10972