Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorMichael Gapczynski <mtgap@owncloud.com>2012-07-28 19:06:36 +0400
committerMichael Gapczynski <mtgap@owncloud.com>2012-07-30 18:07:20 +0400
commitdab708b6255f5ca064c7471f74fa8cd795f093d6 (patch)
tree3a06c1ff09146f2f9a3fbc08639deb021f12d1f0 /apps
parent519eb39422ec9ceb2f5d0023723c8e8a678c54af (diff)
Correction for 'Fix group detection for sharing in case username contains '@', fix for oc-1270'
Diffstat (limited to 'apps')
-rw-r--r--apps/files_sharing/lib_share.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/apps/files_sharing/lib_share.php b/apps/files_sharing/lib_share.php
index b939132a9a0..29a69360d39 100644
--- a/apps/files_sharing/lib_share.php
+++ b/apps/files_sharing/lib_share.php
@@ -182,10 +182,13 @@ class OC_Share {
$uid_shared_with = OC_Group::usersInGroup($uid_shared_with);
// Remove the owner from the list of users in the group
$uid_shared_with = array_diff($uid_shared_with, array(OCP\USER::getUser()));
- } else if ($uid = strrchr($uid_shared_with, '@', true)) {
- $uid_shared_with = array($uid);
} else {
- $uid_shared_with = array($uid_shared_with);
+ $pos = strrpos($uid_shared_with, '@');
+ if ($pos !== false && OC_Group::groupExists(substr($uid_shared_with, $pos + 1))) {
+ $uid_shared_with = array(substr($uid_shared_with, 0, $pos));
+ } else {
+ $uid_shared_with = array($uid_shared_with);
+ }
}
foreach ($uid_shared_with as $uid) {
$sharedFolder = $uid.'/files/Shared';