mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 20:19:22 +03:00
Merge branch 'master' into rtl-support
This commit is contained in:
commit
9cabfe7570
12 changed files with 92 additions and 48 deletions
|
|
@ -4,8 +4,8 @@ class NextcloudPlugin extends \RainLoop\Plugins\AbstractPlugin
|
|||
{
|
||||
const
|
||||
NAME = 'Nextcloud',
|
||||
VERSION = '2.22',
|
||||
RELEASE = '2023-03-28',
|
||||
VERSION = '2.23',
|
||||
RELEASE = '2023-04-11',
|
||||
CATEGORY = 'Integrations',
|
||||
DESCRIPTION = 'Integrate with Nextcloud v20+',
|
||||
REQUIRED = '2.27.0';
|
||||
|
|
@ -34,6 +34,9 @@ class NextcloudPlugin extends \RainLoop\Plugins\AbstractPlugin
|
|||
$this->addTemplate('templates/PopupsNextcloudFiles.html');
|
||||
$this->addTemplate('templates/PopupsNextcloudCalendars.html');
|
||||
|
||||
$this->addHook('imap.before-login', 'oidcLogin');
|
||||
$this->addHook('smtp.before-login', 'oidcLogin');
|
||||
$this->addHook('sieve.before-login', 'oidcLogin');
|
||||
} else {
|
||||
// \OC::$server->getConfig()->getAppValue('snappymail', 'snappymail-no-embed');
|
||||
$this->addHook('main.content-security-policy', 'ContentSecurityPolicy');
|
||||
|
|
@ -62,6 +65,20 @@ class NextcloudPlugin extends \RainLoop\Plugins\AbstractPlugin
|
|||
return static::IsIntegrated() && \OC::$server->getUserSession()->isLoggedIn();
|
||||
}
|
||||
|
||||
public function oidcLogin(\RainLoop\Model\Account $oAccount, \MailSo\Net\NetClient $oClient, \MailSo\Net\ConnectSettings $oSettings) : void
|
||||
{
|
||||
if ($this->Config()->Get('plugin', 'oidc', false)
|
||||
&& \OC::$server->getSession()->get('is_oidc')
|
||||
// && $oClient->supportsAuthType('OAUTHBEARER') // v2.28
|
||||
) {
|
||||
$sAccessToken = \OC::$server->getSession()->get('oidc_access_token');
|
||||
if ($sAccessToken) {
|
||||
$oSettings->Password = $sAccessToken;
|
||||
\array_unshift($oSettings->SASLMechanisms, 'OAUTHBEARER');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
\OC::$server->getCalendarManager();
|
||||
\OC::$server->getLDAPProvider();
|
||||
|
|
@ -254,6 +271,9 @@ class NextcloudPlugin extends \RainLoop\Plugins\AbstractPlugin
|
|||
->SetType(\RainLoop\Enumerations\PluginPropertyType::BOOL)
|
||||
->SetDefaultValue(true),
|
||||
\RainLoop\Plugins\Property::NewInstance('calendar')->SetLabel('Enable "Put ICS in calendar"')
|
||||
->SetType(\RainLoop\Enumerations\PluginPropertyType::BOOL)
|
||||
->SetDefaultValue(false),
|
||||
\RainLoop\Plugins\Property::NewInstance('oidc')->SetLabel('Login with OIDC')
|
||||
->SetType(\RainLoop\Enumerations\PluginPropertyType::BOOL)
|
||||
->SetDefaultValue(false)
|
||||
);
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@ class TwoFactorAuthPlugin extends \RainLoop\Plugins\AbstractPlugin
|
|||
{
|
||||
const
|
||||
NAME = 'Two Factor Authentication',
|
||||
VERSION = '2.16.1',
|
||||
RELEASE = '2022-09-20',
|
||||
VERSION = '2.16.2',
|
||||
RELEASE = '2023-04-11',
|
||||
REQUIRED = '2.15.2',
|
||||
CATEGORY = 'Login',
|
||||
DESCRIPTION = 'Provides support for TOTP 2FA';
|
||||
|
|
@ -167,10 +167,10 @@ class TwoFactorAuthPlugin extends \RainLoop\Plugins\AbstractPlugin
|
|||
return $this->jsonResponse(__FUNCTION__, false);
|
||||
}
|
||||
|
||||
$oSettings = $this->Manager()->Actions()->SettingsProvider()->Load($oAccount);
|
||||
if ($this->Manager()->Actions()->HasActionParam('EnableTwoFactor')) {
|
||||
$sValue = $this->GetActionParam('EnableTwoFactor', '');
|
||||
$oSettings->SetConf('EnableTwoFactor', !empty($sValue));
|
||||
$oActions = $this->Manager()->Actions();
|
||||
if ($oActions->HasActionParam('EnableTwoFactor')) {
|
||||
$sValue = $oActions->GetActionParam('EnableTwoFactor', '');
|
||||
$oActions->SettingsProvider()->Load($oAccount)->SetConf('EnableTwoFactor', !empty($sValue));
|
||||
}
|
||||
|
||||
$sEmail = $oAccount->Email();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue