mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 20:19:22 +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
|
||||
{
|
||||
if (static::IsIntegrated()) {
|
||||
\SnappyMail\Log::debug('Nextcloud', 'integrated');
|
||||
$this->UseLangs(true);
|
||||
|
||||
$this->addHook('main.fabrica', 'MainFabrica');
|
||||
|
|
@ -39,6 +40,7 @@ class NextcloudPlugin extends \RainLoop\Plugins\AbstractPlugin
|
|||
$this->addHook('smtp.before-login', 'oidcLogin');
|
||||
$this->addHook('sieve.before-login', 'oidcLogin');
|
||||
} else {
|
||||
\SnappyMail\Log::debug('Nextcloud', 'NOT integrated');
|
||||
// \OC::$server->getConfig()->getAppValue('snappymail', 'snappymail-no-embed');
|
||||
$this->addHook('main.content-security-policy', 'ContentSecurityPolicy');
|
||||
}
|
||||
|
|
@ -215,6 +217,15 @@ class NextcloudPlugin extends \RainLoop\Plugins\AbstractPlugin
|
|||
if ($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 ?: '';
|
||||
} else if (!empty($aResult['ContactsSync'])) {
|
||||
$bSave = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue