@@ -4,7 +4,7 @@ class NextcloudPlugin extends \RainLoop\Plugins\AbstractPlugin
4
4
{
5
5
const
6
6
NAME = 'Nextcloud ' ,
7
- VERSION = '2.36.1 ' ,
7
+ VERSION = '2.36.2 ' ,
8
8
RELEASE = '2024-05-27 ' ,
9
9
CATEGORY = 'Integrations ' ,
10
10
DESCRIPTION = 'Integrate with Nextcloud v20+ ' ,
@@ -36,12 +36,11 @@ public function Init() : void
36
36
$ this ->addTemplate ('templates/PopupsNextcloudFiles.html ' );
37
37
$ this ->addTemplate ('templates/PopupsNextcloudCalendars.html ' );
38
38
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');
41
41
$ this ->addHook ('imap.before-login ' , 'beforeLogin ' );
42
42
$ this ->addHook ('smtp.before-login ' , 'beforeLogin ' );
43
43
$ this ->addHook ('sieve.before-login ' , 'beforeLogin ' );
44
-
45
44
} else {
46
45
\SnappyMail \Log::debug ('Nextcloud ' , 'NOT integrated ' );
47
46
// \OC::$server->getConfig()->getAppValue('snappymail', 'snappymail-no-embed');
@@ -73,9 +72,13 @@ public static function IsLoggedIn()
73
72
74
73
public function loginCredentials (string &$ sEmail , string &$ sLogin , ?string &$ sPassword = null ) : void
75
74
{
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;
79
82
}
80
83
81
84
public function loginCredentials2 (string &$ sEmail , ?string &$ sPassword = null ) : void
@@ -86,8 +89,6 @@ public function loginCredentials2(string &$sEmail, ?string &$sPassword = null) :
86
89
87
90
public function beforeLogin (\RainLoop \Model \Account $ oAccount , \MailSo \Net \NetClient $ oClient , \MailSo \Net \ConnectSettings $ oSettings ) : void
88
91
{
89
- $ oSettings ->username = \OC ::$ server ->getUserSession ()->getUser ()->getUID ();
90
-
91
92
// https://apps.nextcloud.com/apps/oidc_login
92
93
if (\OC ::$ server ->getConfig ()->getAppValue ('snappymail ' , 'snappymail-autologin-oidc ' , false )
93
94
&& \OC ::$ server ->getSession ()->get ('is_oidc ' )
@@ -99,7 +100,6 @@ public function beforeLogin(\RainLoop\Model\Account $oAccount, \MailSo\Net\NetCl
99
100
\array_unshift ($ oSettings ->SASLMechanisms , 'OAUTHBEARER ' );
100
101
}
101
102
}
102
-
103
103
}
104
104
105
105
/*
0 commit comments