Fix group detection for sharing in case username contains '@', fix for oc-1270
This commit is contained in:
parent
f378415377
commit
7d17c59a51
|
@ -23,8 +23,13 @@ while ($path != $userDirectory) {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Check if uid_shared_with is a group
|
// 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);
|
$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
|
// Include users in the group so the users can be removed from the list of people to share with
|
||||||
if ($path == $source) {
|
if ($path == $source) {
|
||||||
$group = array(array('gid' => $gid, 'permissions' => $rows[$i]['permissions'], 'users' => OC_Group::usersInGroup($gid), 'parentFolder' => false));
|
$group = array(array('gid' => $gid, 'permissions' => $rows[$i]['permissions'], 'users' => OC_Group::usersInGroup($gid), 'parentFolder' => false));
|
||||||
|
|
|
@ -182,7 +182,7 @@ class OC_Share {
|
||||||
$uid_shared_with = OC_Group::usersInGroup($uid_shared_with);
|
$uid_shared_with = OC_Group::usersInGroup($uid_shared_with);
|
||||||
// Remove the owner from the list of users in the group
|
// Remove the owner from the list of users in the group
|
||||||
$uid_shared_with = array_diff($uid_shared_with, array(OCP\USER::getUser()));
|
$uid_shared_with = array_diff($uid_shared_with, array(OCP\USER::getUser()));
|
||||||
} else if ($uid = strstr($uid_shared_with, '@', true)) {
|
} else if ($uid = strrchr($uid_shared_with, '@', true)) {
|
||||||
$uid_shared_with = array($uid);
|
$uid_shared_with = array($uid);
|
||||||
} else {
|
} else {
|
||||||
$uid_shared_with = array($uid_shared_with);
|
$uid_shared_with = array($uid_shared_with);
|
||||||
|
|
Loading…
Reference in New Issue