mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-06-27 00:36:44 +03:00
Improved example for #1544
This commit is contained in:
parent
fffc044998
commit
24681f8955
1 changed files with 11 additions and 5 deletions
|
|
@ -36,7 +36,7 @@ class NextcloudPlugin extends \RainLoop\Plugins\AbstractPlugin
|
|||
$this->addTemplate('templates/PopupsNextcloudFiles.html');
|
||||
$this->addTemplate('templates/PopupsNextcloudCalendars.html');
|
||||
/*
|
||||
$this->addHook('login.credentials.step-2', 'loginCredentials');
|
||||
$this->addHook('login.credentials.step-2', 'loginCredentials2');
|
||||
$this->addHook('login.credentials', 'loginCredentials');
|
||||
$this->addHook('imap.before-login', 'beforeLogin');
|
||||
$this->addHook('smtp.before-login', 'beforeLogin');
|
||||
|
|
@ -74,14 +74,20 @@ class NextcloudPlugin extends \RainLoop\Plugins\AbstractPlugin
|
|||
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();
|
||||
$sEmail = $ocUser->getEMailAddress() ?: $oc->user->getPrimaryEMailAddress();
|
||||
$sLogin = $ocUser->getUID();
|
||||
}
|
||||
|
||||
public function loginCredentials2(string &$sEmail, ?string &$sPassword = null) : void
|
||||
{
|
||||
$ocUser = \OC::$server->getUserSession()->getUser();
|
||||
$sEmail = $ocUser->getEMailAddress() ?: $oc->user->getPrimaryEMailAddress();
|
||||
}
|
||||
|
||||
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);
|
||||
$oSettings->username = \OC::$server->getUserSession()->getUser()->getUID();
|
||||
$this->oidcLogin($oAccount, $oClient, $oSettings);
|
||||
}
|
||||
|
||||
// https://apps.nextcloud.com/apps/oidc_login
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue