mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-06 07:57:02 +03:00
Changes for #1420 to detect OIDC
This commit is contained in:
parent
cbcab5b981
commit
e1d95f8632
1 changed files with 11 additions and 0 deletions
|
|
@ -13,6 +13,7 @@ class NextcloudPlugin extends \RainLoop\Plugins\AbstractPlugin
|
||||||
public function Init() : void
|
public function Init() : void
|
||||||
{
|
{
|
||||||
if (static::IsIntegrated()) {
|
if (static::IsIntegrated()) {
|
||||||
|
\SnappyMail\Log::debug('Nextcloud', 'integrated');
|
||||||
$this->UseLangs(true);
|
$this->UseLangs(true);
|
||||||
|
|
||||||
$this->addHook('main.fabrica', 'MainFabrica');
|
$this->addHook('main.fabrica', 'MainFabrica');
|
||||||
|
|
@ -39,6 +40,7 @@ class NextcloudPlugin extends \RainLoop\Plugins\AbstractPlugin
|
||||||
$this->addHook('smtp.before-login', 'oidcLogin');
|
$this->addHook('smtp.before-login', 'oidcLogin');
|
||||||
$this->addHook('sieve.before-login', 'oidcLogin');
|
$this->addHook('sieve.before-login', 'oidcLogin');
|
||||||
} else {
|
} else {
|
||||||
|
\SnappyMail\Log::debug('Nextcloud', 'NOT integrated');
|
||||||
// \OC::$server->getConfig()->getAppValue('snappymail', 'snappymail-no-embed');
|
// \OC::$server->getConfig()->getAppValue('snappymail', 'snappymail-no-embed');
|
||||||
$this->addHook('main.content-security-policy', 'ContentSecurityPolicy');
|
$this->addHook('main.content-security-policy', 'ContentSecurityPolicy');
|
||||||
}
|
}
|
||||||
|
|
@ -215,6 +217,15 @@ class NextcloudPlugin extends \RainLoop\Plugins\AbstractPlugin
|
||||||
if ($sCustomEmail) {
|
if ($sCustomEmail) {
|
||||||
$sEmail = $sCustomEmail;
|
$sEmail = $sCustomEmail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!$sEmail && $this->Config()->Get('plugin', 'oidc', false)) {
|
||||||
|
if (\OC::$server->getSession()->get('is_oidc')) {
|
||||||
|
$sEmail = "{$sUID}@nextcloud";
|
||||||
|
$aResult['DevPassword'] = \OC::$server->getSession()->get('oidc_access_token');
|
||||||
|
} else {
|
||||||
|
\SnappyMail\Log::debug('Nextcloud', 'Not an OIDC login');
|
||||||
|
}
|
||||||
|
}
|
||||||
$aResult['DevEmail'] = $sEmail ?: '';
|
$aResult['DevEmail'] = $sEmail ?: '';
|
||||||
} else if (!empty($aResult['ContactsSync'])) {
|
} else if (!empty($aResult['ContactsSync'])) {
|
||||||
$bSave = false;
|
$bSave = false;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue