bring back acl for cloud file uploads
This commit is contained in:
parent
b6db0f72f5
commit
4f0b138692
@ -279,7 +279,7 @@ class Browser extends DAV\Browser\Plugin {
|
||||
$aclselect = null;
|
||||
$lockstate = '';
|
||||
|
||||
if($this->auth-owner_id) {
|
||||
if($this->auth->owner_id) {
|
||||
$channel = channelx_by_n($this->auth->owner_id);
|
||||
if($channel) {
|
||||
$acl = new \Zotlabs\Access\AccessList($channel);
|
||||
@ -330,6 +330,7 @@ class Browser extends DAV\Browser\Plugin {
|
||||
'$deny_gid' => acl2json($channel_acl['deny_gid']),
|
||||
'$lockstate' => $lockstate,
|
||||
'$return_url' => \App::$cmd,
|
||||
'$path' => str_replace('cloud/' . $this->auth->owner_nick . '/', '', $path),
|
||||
'$dragdroptext' => t('Drop files here to immediately upload')
|
||||
));
|
||||
}
|
||||
|
@ -1977,4 +1977,4 @@ function get_filename_by_cloudname($cloudname, $channel, $storepath) {
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -202,7 +202,7 @@ function UploadFile(file, idx) {
|
||||
});
|
||||
|
||||
// POST to the entire cloud path
|
||||
xhr.open('post', window.location.pathname, true);
|
||||
xhr.open('post', 'file_upload', true);
|
||||
|
||||
var formfields = $("#ajax-upload-files").serializeArray();
|
||||
|
||||
@ -210,7 +210,7 @@ function UploadFile(file, idx) {
|
||||
$.each(formfields, function(i, field) {
|
||||
data.append(field.name, field.value);
|
||||
});
|
||||
data.append('file', file);
|
||||
data.append('userfile', file);
|
||||
|
||||
xhr.send(data);
|
||||
}
|
||||
|
@ -1,20 +1,31 @@
|
||||
<div id="files-mkdir-tools" class="section-content-tools-wrapper">
|
||||
<label for="files-mkdir">{{$folder_header}}</label>
|
||||
<form method="post" action="">
|
||||
<input type="hidden" name="sabreAction" value="mkcol">
|
||||
<input id="files-mkdir" type="text" name="name" class="form-control form-group">
|
||||
<button class="btn btn-primary btn-sm pull-right" type="submit" value="{{$folder_submit}}">{{$folder_submit}}</button>
|
||||
</form>
|
||||
<div class="clear"></div>
|
||||
<label for="files-mkdir">{{$folder_header}}</label>
|
||||
<form method="post" action="">
|
||||
<input type="hidden" name="sabreAction" value="mkcol">
|
||||
<input id="files-mkdir" type="text" name="name" class="form-control form-group">
|
||||
<button class="btn btn-primary btn-sm pull-right" type="submit" value="{{$folder_submit}}">{{$folder_submit}}</button>
|
||||
</form>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
<div id="files-upload-tools" class="section-content-tools-wrapper">
|
||||
{{if $quota.limit || $quota.used}}<div class="{{if $quota.warning}}section-content-danger-wrapper{{else}}section-content-info-wrapper{{/if}}">{{if $quota.warning}}<strong>{{$quota.warning}} </strong>{{/if}}{{$quota.desc}}</div>{{/if}}
|
||||
<form id="ajax-upload-files" method="post" action="" enctype="multipart/form-data" class="acl-form" data-form_id="ajax-upload-files" data-allow_cid='{{$allow_cid}}' data-allow_gid='{{$allow_gid}}' data-deny_cid='{{$deny_cid}}' data-deny_gid='{{$deny_gid}}'>
|
||||
<input type="hidden" name="sabreAction" value="put">
|
||||
<label for="files-upload">{{$upload_header}}</label>
|
||||
<input class="form-group pull-left" id="files-upload" type="file" name="file">
|
||||
<button id="upload-submit" class="btn btn-primary btn-sm pull-right" type="submit" value="{{$upload_submit}}">{{$upload_submit}}</button>
|
||||
</form>
|
||||
<div class="clear"></div>
|
||||
{{if $quota.limit || $quota.used}}<div class="{{if $quota.warning}}section-content-danger-wrapper{{else}}section-content-info-wrapper{{/if}}">{{if $quota.warning}}<strong>{{$quota.warning}} </strong>{{/if}}{{$quota.desc}}</div>{{/if}}
|
||||
<form id="ajax-upload-files" method="post" action="file_upload" enctype="multipart/form-data" class="acl-form" data-form_id="ajax-upload-files" data-allow_cid='{{$allow_cid}}' data-allow_gid='{{$allow_gid}}' data-deny_cid='{{$deny_cid}}' data-deny_gid='{{$deny_gid}}'>
|
||||
<input type="hidden" name="directory" value="{{$path}}" />
|
||||
<input type="hidden" name="channick" value="{{$channick}}" />
|
||||
<input type="hidden" name="return_url" value="{{$return_url}}" />
|
||||
<label for="files-upload">{{$upload_header}}</label>
|
||||
<input class="form-group pull-left" id="files-upload" type="file" name="userfile">
|
||||
<div class="pull-right btn-group">
|
||||
<div class="btn-group">
|
||||
{{if $lockstate}}
|
||||
<button id="dbtn-acl" class="btn btn-default btn-sm" data-toggle="modal" data-target="#aclModal" onclick="return false;">
|
||||
<i id="jot-perms-icon" class="fa fa-{{$lockstate}}"></i>
|
||||
</button>
|
||||
{{/if}}
|
||||
<button id="upload-submit" class="btn btn-primary btn-sm pull-right" type="submit" name="submit" value="{{$upload_submit}}">{{$upload_submit}}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
{{$aclselect}}
|
||||
|
Reference in New Issue
Block a user