diff options
author | Michael Gapczynski <GapczynskiM@gmail.com> | 2011-08-07 15:20:57 -0400 |
---|---|---|
committer | Michael Gapczynski <GapczynskiM@gmail.com> | 2011-08-07 15:20:57 -0400 |
commit | 5d521d7c7c8f8e796a3ddc81e1e4430238ba5451 (patch) | |
tree | 4a6cac924a71eed163e481823b29a8614abbf21c /apps/files_sharing/ajax | |
parent | fbdd65bf7b4cb5572e38099a840d48a9644f52e3 (diff) | |
download | nextcloud-server-5d521d7c7c8f8e796a3ddc81e1e4430238ba5451.tar.gz nextcloud-server-5d521d7c7c8f8e796a3ddc81e1e4430238ba5451.zip |
Sharing dropdown changes: show users that have a parent folder shared with them and add the ability to change permissions
Diffstat (limited to 'apps/files_sharing/ajax')
-rw-r--r-- | apps/files_sharing/ajax/getitem.php | 17 | ||||
-rw-r--r-- | apps/files_sharing/ajax/setpermissions.php | 12 |
2 files changed, 27 insertions, 2 deletions
diff --git a/apps/files_sharing/ajax/getitem.php b/apps/files_sharing/ajax/getitem.php index 580b6ca5585..3a3be404a30 100644 --- a/apps/files_sharing/ajax/getitem.php +++ b/apps/files_sharing/ajax/getitem.php @@ -4,6 +4,19 @@ $RUNTIME_NOAPPS = true; require_once('../../../lib/base.php'); require_once('../lib_share.php'); -$source = "/".OC_User::getUser()."/files".$_GET['source']; -echo json_encode(OC_Share::getMySharedItem($source)); +$userDirectory = "/".OC_User::getUser()."/files"; +$source = $userDirectory.$_GET['source']; +$users = OC_Share::getMySharedItem($source); +$source = dirname($source); +while ($source != "" && $source != "/" && $source != "." && $source != $userDirectory) { + $parentUsers = array(); + $values = array_values(OC_Share::getMySharedItem($source)); + for ($i = 0; $i < count($values); $i++) { + $parentUsers[basename($source)."-".$i] = $values[$i]; + } + $users = array_merge($users, $parentUsers); + $source = dirname($source); +} +echo json_encode($users); + ?>
\ No newline at end of file diff --git a/apps/files_sharing/ajax/setpermissions.php b/apps/files_sharing/ajax/setpermissions.php new file mode 100644 index 00000000000..8e0bac0b06f --- /dev/null +++ b/apps/files_sharing/ajax/setpermissions.php @@ -0,0 +1,12 @@ +<?php +$RUNTIME_NOAPPS = true; + +require_once('../../../lib/base.php'); +require_once('../lib_share.php'); + +$source = "/".OC_User::getUser()."/files".$_GET['source']; +$uid_shared_with = $_GET['uid_shared_with']; +$permissions = $_GET['permissions']; +OC_Share::setPermissions($source, $uid_shared_with, $permissions); + +?>
\ No newline at end of file |