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('/');
arry.pop();
var removeFromBreadcrumbs = arry.indexOf(dir) + 1;
var notearry = vm.breadcrumbs;
notearry.pop();
var newArry = vm.breadcrumbs;
newArry.pop();
vm.breadcrumbsPath = arry.splice(0,removeFromBreadcrumbs);
vm.breadcrumbs = vm.breadcrumbs.splice(0,removeFromBreadcrumbs);
vm.Sites.contents(vm.copyR, vm.breadcrumbsPath.join('/'));
} else {
vm.breadcrumbsPath.unshift('');
var removeFromBreadcrumbs = vm.breadcrumbsPath.indexOf(dir) + 1;
vm.breadcrumbsPath = vm.breadcrumbsPath.splice(0,removeFromBreadcrumbs);
vm.breadcrumbs = vm.breadcrumbs.splice(0,removeFromBreadcrumbs);
vm.Sites.contents(vm.copyR, vm.breadcrumbsPath.join('/'));
if (dir === 'root') {
vm.breadcrumbs = ['root'];
vm.breadcrumbsPath = [''];
vm.breadcrumbsPath = [];
}
}
};
@ -519,10 +520,17 @@ app.controller('websiteCtrl', [
};
vm.createNewFolder = function (r) {
if (vm.breadcrumbsPath.join('/') === '') {
r.folderName = '/' + vm.folderName + '/';
if (r.shareAccess.path !== '/') {
vm.breadcrumbsPath;
vm.breadcrumbs;
r.folderName = vm.breadcrumbsPath + vm.folderName;
debugger;
} else {
r.folderName = vm.breadcrumbsPath.join('/') + '/' + vm.folderName + '/';
if (vm.breadcrumbsPath.join('/') === '') {
r.folderName = '/' + vm.folderName + '/';
} else {
r.folderName = vm.breadcrumbsPath.join('/') + '/' + vm.folderName + '/';
}
}
};
@ -674,6 +682,12 @@ app.controller('websiteCtrl', [
}, 0);
};
vm.cleanArrays = function () {
vm.breadcrumbsPath = [];
vm.breadcrumbs = [];
vm.siteFiles = [];
vm.siteDirectories = [];
};
vm.checkShareRights = function (r) {
if (r.invitedBy) {

View File

@ -157,7 +157,7 @@
</div>
<div class="col-md-3">
<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>
<h2 class="ssb-title">Files</h2>
</a>