fixing restricted paths

This commit is contained in:
Jon Lambson 2017-10-17 17:59:18 -06:00
parent f26468d3dc
commit 0b52305043
2 changed files with 21 additions and 7 deletions

View File

@ -415,19 +415,20 @@ app.controller('websiteCtrl', [
var arry = vm.breadcrumbsPath.split('/'); var arry = vm.breadcrumbsPath.split('/');
arry.pop(); arry.pop();
var removeFromBreadcrumbs = arry.indexOf(dir) + 1; var removeFromBreadcrumbs = arry.indexOf(dir) + 1;
var notearry = vm.breadcrumbs; var newArry = vm.breadcrumbs;
notearry.pop(); newArry.pop();
vm.breadcrumbsPath = arry.splice(0,removeFromBreadcrumbs); vm.breadcrumbsPath = arry.splice(0,removeFromBreadcrumbs);
vm.breadcrumbs = vm.breadcrumbs.splice(0,removeFromBreadcrumbs); vm.breadcrumbs = vm.breadcrumbs.splice(0,removeFromBreadcrumbs);
vm.Sites.contents(vm.copyR, vm.breadcrumbsPath.join('/')); vm.Sites.contents(vm.copyR, vm.breadcrumbsPath.join('/'));
} else { } else {
vm.breadcrumbsPath.unshift('');
var removeFromBreadcrumbs = vm.breadcrumbsPath.indexOf(dir) + 1; var removeFromBreadcrumbs = vm.breadcrumbsPath.indexOf(dir) + 1;
vm.breadcrumbsPath = vm.breadcrumbsPath.splice(0,removeFromBreadcrumbs); vm.breadcrumbsPath = vm.breadcrumbsPath.splice(0,removeFromBreadcrumbs);
vm.breadcrumbs = vm.breadcrumbs.splice(0,removeFromBreadcrumbs); vm.breadcrumbs = vm.breadcrumbs.splice(0,removeFromBreadcrumbs);
vm.Sites.contents(vm.copyR, vm.breadcrumbsPath.join('/')); vm.Sites.contents(vm.copyR, vm.breadcrumbsPath.join('/'));
if (dir === 'root') { if (dir === 'root') {
vm.breadcrumbs = ['root']; vm.breadcrumbs = ['root'];
vm.breadcrumbsPath = ['']; vm.breadcrumbsPath = [];
} }
} }
}; };
@ -519,11 +520,18 @@ app.controller('websiteCtrl', [
}; };
vm.createNewFolder = function (r) { vm.createNewFolder = function (r) {
if (r.shareAccess.path !== '/') {
vm.breadcrumbsPath;
vm.breadcrumbs;
r.folderName = vm.breadcrumbsPath + vm.folderName;
debugger;
} else {
if (vm.breadcrumbsPath.join('/') === '') { if (vm.breadcrumbsPath.join('/') === '') {
r.folderName = '/' + vm.folderName + '/'; r.folderName = '/' + vm.folderName + '/';
} else { } else {
r.folderName = vm.breadcrumbsPath.join('/') + '/' + vm.folderName + '/'; r.folderName = vm.breadcrumbsPath.join('/') + '/' + vm.folderName + '/';
} }
}
}; };
vm.Sites.upload = function (r) { vm.Sites.upload = function (r) {
@ -674,6 +682,12 @@ app.controller('websiteCtrl', [
}, 0); }, 0);
}; };
vm.cleanArrays = function () {
vm.breadcrumbsPath = [];
vm.breadcrumbs = [];
vm.siteFiles = [];
vm.siteDirectories = [];
};
vm.checkShareRights = function (r) { vm.checkShareRights = function (r) {
if (r.invitedBy) { if (r.invitedBy) {

View File

@ -157,7 +157,7 @@
</div> </div>
<div class="col-md-3"> <div class="col-md-3">
<div class="square-service-block"> <div class="square-service-block">
<a ng-click="vm.showAction('files'); vm.Sites.allContents(r);" class="cp trigger-files-list-refresh"> <a ng-click="vm.cleanArrays(); vm.showAction('files'); vm.Sites.allContents(r);" class="cp trigger-files-list-refresh">
<div class="ssb-icon"><i class="fa fa-sitemap" aria-hidden="true"></i></div> <div class="ssb-icon"><i class="fa fa-sitemap" aria-hidden="true"></i></div>
<h2 class="ssb-title">Files</h2> <h2 class="ssb-title">Files</h2>
</a> </a>