-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[stable30] fix(cardav): only show users from enabled addressBooks in contacts menu #51538
Conversation
58303c5
to
031cf2f
Compare
@@ -262,12 +262,11 @@ | |||
$cm->setupContactsProvider($contactsManager, $userID, $urlGenerator); | |||
} | |||
|
|||
private function setupSystemContactsProvider(IContactsManager $contactsManager, | |||
IAppContainer $container): void { | |||
private function setupSystemContactsProvider(IContactsManager $contactsManager, IAppContainer $container): void { |
Check notice
Code scanning / Psalm
DeprecatedInterface Note
} | ||
|
||
$path = 'addressbooks/users/' . $user . '/' . $uri; | ||
$properties = $this->propertyMapper->findPropertyByPathAndName($user, $path, '{http://owncloud.org/ns}enabled'); |
Check notice
Code scanning / Psalm
PossiblyInvalidArgument Note
* @param IURLGenerator $urlGenerator | ||
*/ | ||
public function setupSystemContactsProvider(IManager $cm, IURLGenerator $urlGenerator) { | ||
public function setupSystemContactsProvider(IManager $cm, ?string $userId, IURLGenerator $urlGenerator) { |
Check notice
Code scanning / Psalm
MissingReturnType Note
*/ | ||
private function register(IManager $cm, $addressBooks, $urlGenerator) { | ||
private function register(IManager $cm, $addressBooks, $urlGenerator, ?string $userId) { |
Check notice
Code scanning / Psalm
MissingReturnType Note
*/ | ||
private function register(IManager $cm, $addressBooks, $urlGenerator) { | ||
private function register(IManager $cm, $addressBooks, $urlGenerator, ?string $userId) { |
Check notice
Code scanning / Psalm
MissingParamType Note
Signed-off-by: Hamza Mahjoubi <hamzamahjoubi221@gmail.com>
031cf2f
to
e55a375
Compare
@@ -323,4 +336,25 @@ | |||
$this->addressBookInfo['{DAV:}displayname'] === $this->urlGenerator->getBaseUrl() | |||
); | |||
} | |||
|
|||
public function isEnabled(): bool { | |||
if (!$this->userId) { |
Check notice
Code scanning / Psalm
RiskyTruthyFalsyComparison Note
$uri = $this->addressBookInfo['uri']; | ||
} | ||
|
||
$path = 'addressbooks/users/' . $user . '/' . $uri; |
Check notice
Code scanning / Psalm
PossiblyInvalidOperand Note
Cypress looks unrelated |
Backport of #51380
Warning, This backport's changes differ from the original and might be incomplete⚠️
Todo
Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.