|
@@ -211,11 +211,11 @@ discard block |
|
|
block discarded – undo |
|
211
|
211
|
// "name (type, owner) [id]", depending on the Circles app version. |
|
212
|
212
|
$hasCircleId = (substr($share->getSharedWith(), -1) === ']'); |
|
213
|
213
|
|
|
214
|
|
- $displayNameLength = ($hasCircleId? strrpos($share->getSharedWith(), ' '): strlen($share->getSharedWith())); |
|
|
214
|
+ $displayNameLength = ($hasCircleId ? strrpos($share->getSharedWith(), ' ') : strlen($share->getSharedWith())); |
|
215
|
215
|
$result['share_with_displayname'] = substr($share->getSharedWith(), 0, $displayNameLength); |
|
216
|
216
|
|
|
217
|
|
- $shareWithStart = ($hasCircleId? strrpos($share->getSharedWith(), '[') + 1: 0); |
|
218
|
|
- $shareWithLength = ($hasCircleId? -1: strpos($share->getSharedWith(), ' ')); |
|
|
217
|
+ $shareWithStart = ($hasCircleId ? strrpos($share->getSharedWith(), '[') + 1 : 0); |
|
|
218
|
+ $shareWithLength = ($hasCircleId ? -1 : strpos($share->getSharedWith(), ' ')); |
|
219
|
219
|
$result['share_with'] = substr($share->getSharedWith(), $shareWithStart, $shareWithLength); |
|
220
|
220
|
} |
|
221
|
221
|
|
|
@@ -237,7 +237,7 @@ discard block |
|
|
block discarded – undo |
|
237
|
237
|
// FIXME: If we inject the contacts manager it gets initialized bofore any address books are registered |
|
238
|
238
|
$result = \OC::$server->getContactsManager()->search($query, [$property]); |
|
239
|
239
|
foreach ($result as $r) { |
|
240
|
|
- foreach($r[$property] as $value) { |
|
|
240
|
+ foreach ($r[$property] as $value) { |
|
241
|
241
|
if ($value === $query) { |
|
242
|
242
|
return $r['FN']; |
|
243
|
243
|
} |
|
@@ -518,7 +518,7 @@ discard block |
|
|
block discarded – undo |
|
518
|
518
|
|
|
519
|
519
|
$shares = array_merge($userShares, $groupShares, $circleShares); |
|
520
|
520
|
|
|
521
|
|
- $shares = array_filter($shares, function (IShare $share) { |
|
|
521
|
+ $shares = array_filter($shares, function(IShare $share) { |
|
522
|
522
|
return $share->getShareOwner() !== $this->currentUser; |
|
523
|
523
|
}); |
|
524
|
524
|
|
|
@@ -557,7 +557,7 @@ discard block |
|
|
block discarded – undo |
|
557
|
557
|
$shares = array_merge($shares, $this->shareManager->getSharesBy($this->currentUser, \OCP\Share::SHARE_TYPE_USER, $node, false, -1, 0)); |
|
558
|
558
|
$shares = array_merge($shares, $this->shareManager->getSharesBy($this->currentUser, \OCP\Share::SHARE_TYPE_GROUP, $node, false, -1, 0)); |
|
559
|
559
|
$shares = array_merge($shares, $this->shareManager->getSharesBy($this->currentUser, \OCP\Share::SHARE_TYPE_LINK, $node, false, -1, 0)); |
|
560
|
|
- if($this->shareManager->shareProviderExists(\OCP\Share::SHARE_TYPE_EMAIL)) { |
|
|
560
|
+ if ($this->shareManager->shareProviderExists(\OCP\Share::SHARE_TYPE_EMAIL)) { |
|
561
|
561
|
$shares = array_merge($shares, $this->shareManager->getSharesBy($this->currentUser, \OCP\Share::SHARE_TYPE_EMAIL, $node, false, -1, 0)); |
|
562
|
562
|
} |
|
563
|
563
|
if ($this->shareManager->outgoingServer2ServerSharesAllowed()) { |
|
@@ -719,7 +719,7 @@ discard block |
|
|
block discarded – undo |
|
719
|
719
|
} |
|
720
|
720
|
|
|
721
|
721
|
if ($permissions !== null) { |
|
722
|
|
- $newPermissions = (int)$permissions; |
|
|
722
|
+ $newPermissions = (int) $permissions; |
|
723
|
723
|
$newPermissions = $newPermissions & ~Constants::PERMISSION_SHARE; |
|
724
|
724
|
} |
|
725
|
725
|
|
|
@@ -777,7 +777,7 @@ discard block |
|
|
block discarded – undo |
|
777
|
777
|
|
|
778
|
778
|
} else { |
|
779
|
779
|
if ($permissions !== null) { |
|
780
|
|
- $permissions = (int)$permissions; |
|
|
780
|
+ $permissions = (int) $permissions; |
|
781
|
781
|
$share->setPermissions($permissions); |
|
782
|
782
|
} |
|
783
|
783
|
|
|
@@ -909,7 +909,7 @@ discard block |
|
|
block discarded – undo |
|
909
|
909
|
|
|
910
|
910
|
// First check if it is an internal share. |
|
911
|
911
|
try { |
|
912
|
|
- $share = $this->shareManager->getShareById('ocinternal:' . $id); |
|
|
912
|
+ $share = $this->shareManager->getShareById('ocinternal:'.$id); |
|
913
|
913
|
return $share; |
|
914
|
914
|
} catch (ShareNotFound $e) { |
|
915
|
915
|
// Do nothing, just try the other share type |
|
@@ -918,7 +918,7 @@ discard block |
|
|
block discarded – undo |
|
918
|
918
|
|
|
919
|
919
|
try { |
|
920
|
920
|
if ($this->shareManager->shareProviderExists(\OCP\Share::SHARE_TYPE_CIRCLE)) { |
|
921
|
|
- $share = $this->shareManager->getShareById('ocCircleShare:' . $id); |
|
|
921
|
+ $share = $this->shareManager->getShareById('ocCircleShare:'.$id); |
|
922
|
922
|
return $share; |
|
923
|
923
|
} |
|
924
|
924
|
} catch (ShareNotFound $e) { |
|
@@ -927,7 +927,7 @@ discard block |
|
|
block discarded – undo |
|
927
|
927
|
|
|
928
|
928
|
try { |
|
929
|
929
|
if ($this->shareManager->shareProviderExists(\OCP\Share::SHARE_TYPE_EMAIL)) { |
|
930
|
|
- $share = $this->shareManager->getShareById('ocMailShare:' . $id); |
|
|
930
|
+ $share = $this->shareManager->getShareById('ocMailShare:'.$id); |
|
931
|
931
|
return $share; |
|
932
|
932
|
} |
|
933
|
933
|
} catch (ShareNotFound $e) { |
|
@@ -937,7 +937,7 @@ discard block |
|
|
block discarded – undo |
|
937
|
937
|
if (!$this->shareManager->outgoingServer2ServerSharesAllowed()) { |
|
938
|
938
|
throw new ShareNotFound(); |
|
939
|
939
|
} |
|
940
|
|
- $share = $this->shareManager->getShareById('ocFederatedSharing:' . $id); |
|
|
940
|
+ $share = $this->shareManager->getShareById('ocFederatedSharing:'.$id); |
|
941
|
941
|
|
|
942
|
942
|
return $share; |
|
943
|
943
|
} |