fix public folder sharing for domains without dns

Signed-off-by: si458 <simonsmith5521@gmail.com>
This commit is contained in:
si458 2024-10-01 12:10:48 +01:00
parent 952bcde25f
commit 37729269ba
1 changed files with 1 additions and 0 deletions

View File

@ -3757,6 +3757,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates, doneF
if (obj.common.validateString(req.path, 1, 4096) == false) { res.sendStatus(404); return; } if (obj.common.validateString(req.path, 1, 4096) == false) { res.sendStatus(404); return; }
var domainname = 'domain', spliturl = decodeURIComponent(req.path).split('/'), filename = ''; var domainname = 'domain', spliturl = decodeURIComponent(req.path).split('/'), filename = '';
if (spliturl[1] != 'userfiles') { spliturl.splice(1,1); } // remove domain.id from url for domains without dns
if ((spliturl.length < 3) || (obj.common.IsFilenameValid(spliturl[2]) == false) || (domain.userQuota == -1)) { res.sendStatus(404); return; } if ((spliturl.length < 3) || (obj.common.IsFilenameValid(spliturl[2]) == false) || (domain.userQuota == -1)) { res.sendStatus(404); return; }
if (domain.id != '') { domainname = 'domain-' + domain.id; } if (domain.id != '') { domainname = 'domain-' + domain.id; }
var path = obj.path.join(obj.filespath, domainname + '/user-' + spliturl[2] + '/Public'); var path = obj.path.join(obj.filespath, domainname + '/user-' + spliturl[2] + '/Public');