aboutsummaryrefslogtreecommitdiffstats
path: root/mod/filestorage.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/filestorage.php')
-rw-r--r--mod/filestorage.php20
1 files changed, 10 insertions, 10 deletions
diff --git a/mod/filestorage.php b/mod/filestorage.php
index 8b52c086b..7ba8c1801 100644
--- a/mod/filestorage.php
+++ b/mod/filestorage.php
@@ -28,20 +28,20 @@ function filestorage_post(&$a) {
return;
}
- $str_group_allow = perms2str($_REQUEST['group_allow']);
- $str_contact_allow = perms2str($_REQUEST['contact_allow']);
- $str_group_deny = perms2str($_REQUEST['group_deny']);
- $str_contact_deny = perms2str($_REQUEST['contact_deny']);
-
$channel = $a->get_channel();
+
+ $acl = new AccessList($channel);
+ $acl->set_from_array($_REQUEST);
+ $x = $acl->get();
+
$cloudPath = get_parent_cloudpath($channel_id, $channel['channel_address'], $resource);
//get the object before permissions change so we can catch eventual former allowed members
$object = get_file_activity_object($channel_id, $resource, $cloudPath);
- attach_change_permissions($channel_id, $resource, $str_contact_allow, $str_group_allow, $str_contact_deny, $str_group_deny, $recurse);
+ attach_change_permissions($channel_id, $resource, $x['allow_cid'], $x['allow_gid'], $x['deny_cid'], $x['deny_gid'], $recurse);
- file_activity($channel_id, $object, $str_contact_allow, $str_group_allow, $str_contact_deny, $str_group_deny, 'post', $notify);
+ file_activity($channel_id, $object, $x['allow_cid'], $x['allow_gid'], $x['deny_cid'], $x['deny_gid'], 'post', $notify);
goaway($cloudPath);
}
@@ -117,7 +117,7 @@ function filestorage_content(&$a) {
}
$file = intval(argv(2));
- $r = q("select id, uid, folder, filename, revision, flags, hash, allow_cid, allow_gid, deny_cid, deny_gid from attach where id = %d and uid = %d limit 1",
+ $r = q("select id, uid, folder, filename, revision, flags, is_dir, os_storage, hash, allow_cid, allow_gid, deny_cid, deny_gid from attach where id = %d and uid = %d limit 1",
intval($file),
intval($owner)
);
@@ -125,11 +125,11 @@ function filestorage_content(&$a) {
$f = $r[0];
$channel = $a->get_channel();
- $cloudpath = get_cloudpath($f) . (($f['flags'] & ATTACH_FLAG_DIR) ? '?f=&davguest=1' : '');
+ $cloudpath = get_cloudpath($f) . (intval($f['is_dir']) ? '?f=&davguest=1' : '');
$parentpath = get_parent_cloudpath($channel['channel_id'], $channel['channel_address'], $f['hash']);
$aclselect_e = populate_acl($f, false);
- $is_a_dir = (($f['flags'] & ATTACH_FLAG_DIR) ? true : false);
+ $is_a_dir = (intval($f['is_dir']) ? true : false);
$lockstate = (($f['allow_cid'] || $f['allow_gid'] || $f['deny_cid'] || $f['deny_gid']) ? 'lock' : 'unlock');