mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-09-20 15:45:55 +08:00
Example Nextcloud login override for #1544
This commit is contained in:
parent
41fc41984a
commit
3ced479ac9
|
@ -36,10 +36,11 @@ class NextcloudPlugin extends \RainLoop\Plugins\AbstractPlugin
|
|||
$this->addTemplate('templates/PopupsNextcloudFiles.html');
|
||||
$this->addTemplate('templates/PopupsNextcloudCalendars.html');
|
||||
/*
|
||||
// DISABLED https://github.com/the-djmaze/snappymail/issues/1420#issuecomment-1933045917
|
||||
$this->addHook('imap.before-login', 'oidcLogin');
|
||||
$this->addHook('smtp.before-login', 'oidcLogin');
|
||||
$this->addHook('sieve.before-login', 'oidcLogin');
|
||||
$this->addHook('login.credentials.step-2', 'loginCredentials');
|
||||
$this->addHook('login.credentials', 'loginCredentials');
|
||||
$this->addHook('imap.before-login', 'beforeLogin');
|
||||
$this->addHook('smtp.before-login', 'beforeLogin');
|
||||
$this->addHook('sieve.before-login', 'beforeLogin');
|
||||
*/
|
||||
} else {
|
||||
\SnappyMail\Log::debug('Nextcloud', 'NOT integrated');
|
||||
|
@ -70,6 +71,19 @@ class NextcloudPlugin extends \RainLoop\Plugins\AbstractPlugin
|
|||
return static::IsIntegrated() && \OC::$server->getUserSession()->isLoggedIn();
|
||||
}
|
||||
|
||||
public function loginCredentials(string &$sEmail, string &$sLogin, ?string &$sPassword = null) : void
|
||||
{
|
||||
$ocUser = \OC::$server->getUserSession()->getUser();
|
||||
// $sEmail = $ocUser->getEMailAddress() ?: $oc->user->getPrimaryEMailAddress();
|
||||
// $sLogin = $ocUser->getUID();
|
||||
}
|
||||
|
||||
public function beforeLogin(\RainLoop\Model\Account $oAccount, \MailSo\Net\NetClient $oClient, \MailSo\Net\ConnectSettings $oSettings) : void
|
||||
{
|
||||
// $oSettings->username = \OC::$server->getUserSession()->getUser()->getUID();
|
||||
// $this->oidcLogin($oAccount, $oClient, $oSettings);
|
||||
}
|
||||
|
||||
// https://apps.nextcloud.com/apps/oidc_login
|
||||
// DISABLED https://github.com/the-djmaze/snappymail/issues/1420#issuecomment-1933045917
|
||||
public function oidcLogin(\RainLoop\Model\Account $oAccount, \MailSo\Net\NetClient $oClient, \MailSo\Net\ConnectSettings $oSettings) : void
|
||||
|
|
Loading…
Reference in a new issue