diff --git a/meshuser.js b/meshuser.js index 7c3d4d27..57a63ce6 100644 --- a/meshuser.js +++ b/meshuser.js @@ -37,6 +37,8 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain) { } else if (splitid[0] == 'mesh') { // Check mesh access var meshrights = user.links[meshpath[0]]; + if (meshrights == null) return null; // No meth rights for this user + meshrights = meshrights.rights; // Get the rights bit mask if ((meshrights == null) || ((meshrights & 32) == 0)) return null; // This user must have mesh rights to "server files" } else return null; var rootfolder = meshpath[0], rootfoldersplit = rootfolder.split('/'), domainx = 'domain'; @@ -1283,7 +1285,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain) { var mesh = obj.parent.meshes[i]; if (mesh) { var meshsplit = mesh._id.split('/'); - files.filetree.f[mesh._id] = { t: 1, n: mesh.name, f: {} }; + files.filetree.f[mesh._id] = { t: 4, n: mesh.name, f: {} }; files.filetree.f[mesh._id].maxbytes = obj.parent.getQuota(mesh._id, domain); // Read all files recursively diff --git a/package.json b/package.json index 8f1c3f44..b3b52b7b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "meshcentral", - "version": "0.1.8-e", + "version": "0.1.8-f", "keywords": [ "Remote Management", "Intel AMT", diff --git a/public/images/MeshIcon100.png b/public/images/MeshIcon100.png new file mode 100644 index 00000000..cd063f97 Binary files /dev/null and b/public/images/MeshIcon100.png differ diff --git a/public/images/meshicon16.png b/public/images/meshicon16.png new file mode 100644 index 00000000..64fbc826 Binary files /dev/null and b/public/images/meshicon16.png differ diff --git a/public/styles/style.css b/public/styles/style.css index dfadeb9f..b483f563 100644 --- a/public/styles/style.css +++ b/public/styles/style.css @@ -278,6 +278,16 @@ a { margin-top: 1px; } +.fileIcon4 { + background: url(../images/meshicon16.png); + height: 16px; + width: 16px; + cursor: pointer; + border: none; + float: left; + margin-top: 1px; +} + .filelist { -moz-user-select: none; -khtml-user-select: none; diff --git a/views/default-mobile.handlebars b/views/default-mobile.handlebars index 4bb08011..34eaaf17 100644 --- a/views/default-mobile.handlebars +++ b/views/default-mobile.handlebars @@ -86,6 +86,16 @@ margin-top: 1px; } + .fileIcon4 { + background: url(../images/meshicon16.png); + height: 16px; + width: 16px; + cursor: pointer; + border: none; + float: left; + margin-top: 1px; + } + .filelist { -moz-user-select: none; -khtml-user-select: none; @@ -233,8 +243,11 @@ --> - - +
 
+ + + +
 
@@ -1013,8 +1026,8 @@ if (f.s != null) { fsize = getFileSizeStr(f.s); } var h = ''; - if (f.t < 3) { - var right = (f.t == 1)?p5getQuotabar(f):'', title = ''; + if (f.t < 3 || f.t == 4) { + var right = (f.t == 1 || f.t == 4)?p5getQuotabar(f):'', title = ''; h = "
 " + right + "
" + shortname + "
"; } else { var link = shortname; @@ -1028,7 +1041,7 @@ } //if (f.parent == null) { } - //QH('p5rightOfButtons', p5getQuotabar(filetreex)); + QH('p5rightOfButtons', p5getQuotabar(filetreex)); QH('p5files', html1 + html2); QH('p5currentpath', displayPath); @@ -1047,8 +1060,8 @@ } function p5getQuotabar(f) { - while (f.t > 1) { f = f.parent; } - if ((f.t != 1) || (f.maxbytes == null)) return ''; + while (f.t > 1 && f.t != 4) { f = f.parent; } + if ((f.t != 1 && f.t != 4) || (f.maxbytes == null)) return ''; var tf = Math.floor(f.s / 1024), tq = Math.floor((f.maxbytes - f.s) / 1024); return ' 1?'s':'') + ". " + (Math.floor(f.maxbytes / 1024)) + 'k maxinum">' + ((tq < 0)?('Storage limit exceed'):(tq + 'k remaining')) + ' '; } @@ -1081,7 +1094,7 @@ Q('p5SelectAllButton').value = (cc > 0 ? 'Select None' : 'Select All'); QE('p5CutButton', (sfc > 0) && (cc == sfc)); QE('p5CopyButton', (sfc > 0) && (cc == sfc)); - QE('p5PasteButton', (p5clipboard != null) && (p5clipboard.length > 0)); + QE('p5PasteButton', (p5clipboard != null) && (p5clipboard.length > 0) && (filetreelocation.length > 0)); } function getFileSelCount(includeDirs) { var cc = 0; var checkboxes = document.getElementsByName('fc'); for (var i = 0; i < checkboxes.length; i++) { if ((checkboxes[i].checked) && ((includeDirs != false) || (checkboxes[i].attributes.file.value == "3"))) cc++; } return cc; } diff --git a/views/default.handlebars b/views/default.handlebars index d061bb86..886e57a3 100644 --- a/views/default.handlebars +++ b/views/default.handlebars @@ -4899,8 +4899,8 @@ if (f.s != null) { fsize = getFileSizeStr(f.s); } var h = ''; - if (f.t < 3) { - var right = (f.t == 1)?p5getQuotabar(f):'', title = ''; + if (f.t < 3 || f.t == 4) { + var right = (f.t == 1 || f.t == 4)?p5getQuotabar(f):'', title = ''; h = "
 " + right + "
" + shortname + "
"; } else { var link = shortname; @@ -4933,8 +4933,8 @@ } function p5getQuotabar(f) { - while (f.t > 1) { f = f.parent; } - if ((f.t != 1) || (f.maxbytes == null)) return ''; + while (f.t > 1 && f.t != 4) { f = f.parent; } + if ((f.t != 1 && f.t != 4) || (f.maxbytes == null)) return ''; var tf = Math.floor(f.s / 1024), tq = Math.floor((f.maxbytes - f.s) / 1024); return ' 1?'s':'') + ". " + (Math.floor(f.maxbytes / 1024)) + 'k maxinum">' + ((tq < 0)?('Storage limit exceed'):(tq + 'k remaining')) + ' '; } @@ -4967,7 +4967,7 @@ Q('p5SelectAllButton').value = (cc > 0 ? 'Select None' : 'Select All'); QE('p5CutButton', (sfc > 0) && (cc == sfc)); QE('p5CopyButton', (sfc > 0) && (cc == sfc)); - QE('p5PasteButton', (p5clipboard != null) && (p5clipboard.length > 0)); + QE('p5PasteButton', (p5clipboard != null) && (p5clipboard.length > 0) && (filetreelocation.length > 0)); } function getFileSelCount(includeDirs) { var cc = 0; var checkboxes = document.getElementsByName('fc'); for (var i = 0; i < checkboxes.length; i++) { if ((checkboxes[i].checked) && ((includeDirs != false) || (checkboxes[i].attributes.file.value == "3"))) cc++; } return cc; }