mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Bugfix: Nextcloud getPrimaryEMailAddress() on null
This commit is contained in:
parent
4bb1b41505
commit
ab2f646496
1 changed files with 3 additions and 3 deletions
|
|
@ -74,14 +74,14 @@ class NextcloudPlugin extends \RainLoop\Plugins\AbstractPlugin
|
||||||
public function loginCredentials(string &$sEmail, string &$sLogin, ?string &$sPassword = null) : void
|
public function loginCredentials(string &$sEmail, string &$sLogin, ?string &$sPassword = null) : void
|
||||||
{
|
{
|
||||||
$ocUser = \OC::$server->getUserSession()->getUser();
|
$ocUser = \OC::$server->getUserSession()->getUser();
|
||||||
$sEmail = $ocUser->getEMailAddress() ?: $oc->user->getPrimaryEMailAddress();
|
$sEmail = $ocUser->getEMailAddress() ?: $ocUser->getPrimaryEMailAddress();
|
||||||
$sLogin = $ocUser->getUID();
|
$sLogin = $ocUser->getUID();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function loginCredentials2(string &$sEmail, ?string &$sPassword = null) : void
|
public function loginCredentials2(string &$sEmail, ?string &$sPassword = null) : void
|
||||||
{
|
{
|
||||||
$ocUser = \OC::$server->getUserSession()->getUser();
|
$ocUser = \OC::$server->getUserSession()->getUser();
|
||||||
$sEmail = $ocUser->getEMailAddress() ?: $oc->user->getPrimaryEMailAddress();
|
$sEmail = $ocUser->getEMailAddress() ?: $ocUser->getPrimaryEMailAddress();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function beforeLogin(\RainLoop\Model\Account $oAccount, \MailSo\Net\NetClient $oClient, \MailSo\Net\ConnectSettings $oSettings) : void
|
public function beforeLogin(\RainLoop\Model\Account $oAccount, \MailSo\Net\NetClient $oClient, \MailSo\Net\ConnectSettings $oSettings) : void
|
||||||
|
|
@ -243,7 +243,7 @@ class NextcloudPlugin extends \RainLoop\Plugins\AbstractPlugin
|
||||||
}
|
}
|
||||||
if (!$sEmail) {
|
if (!$sEmail) {
|
||||||
$sEmail = $ocUser->getEMailAddress();
|
$sEmail = $ocUser->getEMailAddress();
|
||||||
// ?: $oc->user->getPrimaryEMailAddress();
|
// ?: $ocUser->getPrimaryEMailAddress();
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
if ($config->getAppValue('snappymail', 'snappymail-autologin-oidc', false)) {
|
if ($config->getAppValue('snappymail', 'snappymail-autologin-oidc', false)) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue