Skip to content
This repository was archived by the owner on Nov 4, 2024. It is now read-only.

Commit 047fd62

Browse files
author
the-djmaze
committed
Hopefully solved Nextcloud login issues #1602
1 parent 68218e4 commit 047fd62

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

plugins/nextcloud/index.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ class NextcloudPlugin extends \RainLoop\Plugins\AbstractPlugin
44
{
55
const
66
NAME = 'Nextcloud',
7-
VERSION = '2.36.1',
7+
VERSION = '2.36.2',
88
RELEASE = '2024-05-27',
99
CATEGORY = 'Integrations',
1010
DESCRIPTION = 'Integrate with Nextcloud v20+',
@@ -36,12 +36,11 @@ public function Init() : void
3636
$this->addTemplate('templates/PopupsNextcloudFiles.html');
3737
$this->addTemplate('templates/PopupsNextcloudCalendars.html');
3838

39-
$this->addHook('login.credentials.step-2', 'loginCredentials2');
40-
$this->addHook('login.credentials', 'loginCredentials');
39+
// $this->addHook('login.credentials.step-2', 'loginCredentials2');
40+
// $this->addHook('login.credentials', 'loginCredentials');
4141
$this->addHook('imap.before-login', 'beforeLogin');
4242
$this->addHook('smtp.before-login', 'beforeLogin');
4343
$this->addHook('sieve.before-login', 'beforeLogin');
44-
4544
} else {
4645
\SnappyMail\Log::debug('Nextcloud', 'NOT integrated');
4746
// \OC::$server->getConfig()->getAppValue('snappymail', 'snappymail-no-embed');
@@ -73,9 +72,13 @@ public static function IsLoggedIn()
7372

7473
public function loginCredentials(string &$sEmail, string &$sLogin, ?string &$sPassword = null) : void
7574
{
76-
$ocUser = \OC::$server->getUserSession()->getUser();
77-
$sEmail = $ocUser->getEMailAddress() ?: $ocUser->getPrimaryEMailAddress() ?: $sEmail;
78-
$sLogin = $ocUser->getUID();
75+
/**
76+
* This has an issue.
77+
* When user changes email address, all settings are gone as the new
78+
* _data_/_default_/storage/{domain}/{local-part} is used
79+
*/
80+
// $ocUser = \OC::$server->getUserSession()->getUser();
81+
// $sEmail = $ocUser->getEMailAddress() ?: $ocUser->getPrimaryEMailAddress() ?: $sEmail;
7982
}
8083

8184
public function loginCredentials2(string &$sEmail, ?string &$sPassword = null) : void
@@ -86,8 +89,6 @@ public function loginCredentials2(string &$sEmail, ?string &$sPassword = null) :
8689

8790
public function beforeLogin(\RainLoop\Model\Account $oAccount, \MailSo\Net\NetClient $oClient, \MailSo\Net\ConnectSettings $oSettings) : void
8891
{
89-
$oSettings->username = \OC::$server->getUserSession()->getUser()->getUID();
90-
9192
// https://apps.nextcloud.com/apps/oidc_login
9293
if (\OC::$server->getConfig()->getAppValue('snappymail', 'snappymail-autologin-oidc', false)
9394
&& \OC::$server->getSession()->get('is_oidc')
@@ -99,7 +100,6 @@ public function beforeLogin(\RainLoop\Model\Account $oAccount, \MailSo\Net\NetCl
99100
\array_unshift($oSettings->SASLMechanisms, 'OAUTHBEARER');
100101
}
101102
}
102-
103103
}
104104

105105
/*

0 commit comments

Comments
 (0)