@@ -36,10 +36,11 @@ public function Init() : void
36
36
$ this ->addTemplate ('templates/PopupsNextcloudFiles.html ' );
37
37
$ this ->addTemplate ('templates/PopupsNextcloudCalendars.html ' );
38
38
/*
39
- // DISABLED https://github.com/the-djmaze/snappymail/issues/1420#issuecomment-1933045917
40
- $this->addHook('imap.before-login', 'oidcLogin');
41
- $this->addHook('smtp.before-login', 'oidcLogin');
42
- $this->addHook('sieve.before-login', 'oidcLogin');
39
+ $this->addHook('login.credentials.step-2', 'loginCredentials');
40
+ $this->addHook('login.credentials', 'loginCredentials');
41
+ $this->addHook('imap.before-login', 'beforeLogin');
42
+ $this->addHook('smtp.before-login', 'beforeLogin');
43
+ $this->addHook('sieve.before-login', 'beforeLogin');
43
44
*/
44
45
} else {
45
46
\SnappyMail \Log::debug ('Nextcloud ' , 'NOT integrated ' );
@@ -70,6 +71,19 @@ public static function IsLoggedIn()
70
71
return static ::IsIntegrated () && \OC ::$ server ->getUserSession ()->isLoggedIn ();
71
72
}
72
73
74
+ public function loginCredentials (string &$ sEmail , string &$ sLogin , ?string &$ sPassword = null ) : void
75
+ {
76
+ $ ocUser = \OC ::$ server ->getUserSession ()->getUser ();
77
+ // $sEmail = $ocUser->getEMailAddress() ?: $oc->user->getPrimaryEMailAddress();
78
+ // $sLogin = $ocUser->getUID();
79
+ }
80
+
81
+ public function beforeLogin (\RainLoop \Model \Account $ oAccount , \MailSo \Net \NetClient $ oClient , \MailSo \Net \ConnectSettings $ oSettings ) : void
82
+ {
83
+ // $oSettings->username = \OC::$server->getUserSession()->getUser()->getUID();
84
+ // $this->oidcLogin($oAccount, $oClient, $oSettings);
85
+ }
86
+
73
87
// https://apps.nextcloud.com/apps/oidc_login
74
88
// DISABLED https://github.com/the-djmaze/snappymail/issues/1420#issuecomment-1933045917
75
89
public function oidcLogin (\RainLoop \Model \Account $ oAccount , \MailSo \Net \NetClient $ oClient , \MailSo \Net \ConnectSettings $ oSettings ) : void
0 commit comments