Skip to content
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

[stable29] fix(caldav): Do not load IMipPlugin before user auth and session is c… #47790

Merged
merged 2 commits into from
Oct 2, 2024

Conversation

SebastianKrupinski
Copy link
Contributor

Back port for #45081

Do not load IMipPlugin before user is authenticated and user session is initialized

Copy link
Contributor

@miaulalala miaulalala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the commented out code, otherwise it looks good!

Comment on lines 116 to 119
/*
$this->user->method('getUID');
$this->user->method('getDisplayName');
*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/*
$this->user->method('getUID');
$this->user->method('getDisplayName');
*/

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

$senderName = $this->userManager->getDisplayName($this->userId);
// Due to a bug in sabre, the senderName property for an iTIP message can actually also be a VObject Property
// If the iTIP message senderName is null or empty use the user session name as the senderName
if (($iTipMessage->senderName instanceof Parameter) && !empty(trim($iTipMessage->senderName->getValue()))) {

Check notice

Code scanning / Psalm

PossiblyNullArgument Note

Argument 1 of trim cannot be null, possibly null value provided
// Due to a bug in sabre, the senderName property for an iTIP message can actually also be a VObject Property
// If the iTIP message senderName is null or empty use the user session name as the senderName
if (($iTipMessage->senderName instanceof Parameter) && !empty(trim($iTipMessage->senderName->getValue()))) {
$senderName = trim($iTipMessage->senderName->getValue());

Check notice

Code scanning / Psalm

PossiblyNullArgument Note

Argument 1 of trim cannot be null, possibly null value provided
} elseif (is_string($iTipMessage->senderName) && !empty(trim($iTipMessage->senderName))) {
$senderName = trim($iTipMessage->senderName);
} elseif ($this->userSession->getUser() !== null) {
$senderName = trim($this->userSession->getUser()->getDisplayName());

Check notice

Code scanning / Psalm

PossiblyNullReference Note

Cannot call method getDisplayName on possibly null value
@@ -180,12 +181,10 @@

// calendar plugins
if ($this->requestIsForSubtree(['calendars', 'public-calendars', 'system-calendars', 'principals'])) {
$this->server->addPlugin(new DAV\Sharing\Plugin($authBackend, \OC::$server->getRequest(), \OC::$server->getConfig()));

Check notice

Code scanning / Psalm

DeprecatedMethod Note

The method OC\Server::getRequest has been marked as deprecated
@@ -180,12 +181,10 @@

// calendar plugins
if ($this->requestIsForSubtree(['calendars', 'public-calendars', 'system-calendars', 'principals'])) {
$this->server->addPlugin(new DAV\Sharing\Plugin($authBackend, \OC::$server->getRequest(), \OC::$server->getConfig()));

Check notice

Code scanning / Psalm

DeprecatedMethod Note

The method OC\Server::getConfig has been marked as deprecated
@@ -315,6 +313,18 @@
\OC::$server->getCommentsManager(),
$userSession
));
if (\OC::$server->getConfig()->getAppValue('dav', 'sendInvitations', 'yes') === 'yes') {

Check notice

Code scanning / Psalm

DeprecatedMethod Note

The method OC\Server::getConfig has been marked as deprecated
@@ -315,6 +313,18 @@
\OC::$server->getCommentsManager(),
$userSession
));
if (\OC::$server->getConfig()->getAppValue('dav', 'sendInvitations', 'yes') === 'yes') {

Check notice

Code scanning / Psalm

DeprecatedMethod Note

The method OCP\IConfig::getAppValue has been marked as deprecated
…reated

Signed-off-by: SebastianKrupinski <krupinskis05@gmail.com>
@miaulalala miaulalala changed the title fix(caldav): Do not load IMipPlugin before user auth and session is c… [stable29] fix(caldav): Do not load IMipPlugin before user auth and session is c… Sep 5, 2024
@solracsf solracsf added this to the Nextcloud 29.0.7 milestone Sep 6, 2024
@solracsf solracsf added the 3. to review Waiting for reviews label Sep 6, 2024
@Altahrim Altahrim mentioned this pull request Sep 11, 2024
14 tasks
@Altahrim Altahrim mentioned this pull request Oct 1, 2024
1 task
@SebastianKrupinski SebastianKrupinski merged commit 6ead1ed into stable29 Oct 2, 2024
177 checks passed
@SebastianKrupinski SebastianKrupinski deleted the backport/45098/stable29 branch October 2, 2024 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants