diff options
author | Michael Gapczynski <mtgap@owncloud.com> | 2012-07-27 15:34:51 -0400 |
---|---|---|
committer | Michael Gapczynski <mtgap@owncloud.com> | 2012-07-30 10:07:19 -0400 |
commit | 7d17c59a51d06e7aeaf8b52fb5268dc14a7b51dd (patch) | |
tree | 7cf5bcd9181de5305859fe146679c68c027fa852 /apps/files_sharing/ajax | |
parent | f378415377a4afc44a55f4aedec3dfefc87ad890 (diff) | |
download | nextcloud-server-7d17c59a51d06e7aeaf8b52fb5268dc14a7b51dd.tar.gz nextcloud-server-7d17c59a51d06e7aeaf8b52fb5268dc14a7b51dd.zip |
Fix group detection for sharing in case username contains '@', fix for oc-1270
Diffstat (limited to 'apps/files_sharing/ajax')
-rw-r--r-- | apps/files_sharing/ajax/getitem.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/apps/files_sharing/ajax/getitem.php b/apps/files_sharing/ajax/getitem.php index 36ac372cad4..852e5a24571 100644 --- a/apps/files_sharing/ajax/getitem.php +++ b/apps/files_sharing/ajax/getitem.php @@ -23,8 +23,13 @@ while ($path != $userDirectory) { } } else { // Check if uid_shared_with is a group - if (($pos = strpos($uid_shared_with, '@')) !== false) { + $pos = strrpos($uid_shared_with, '@'); + if ($pos !== false) { $gid = substr($uid_shared_with, $pos + 1); + } else { + $gid = false; + } + if ($gid && OC_Group::groupExists($gid)) { // Include users in the group so the users can be removed from the list of people to share with if ($path == $source) { $group = array(array('gid' => $gid, 'permissions' => $rows[$i]['permissions'], 'users' => OC_Group::usersInGroup($gid), 'parentFolder' => false)); |