This commit is contained in:
the-djmaze 2024-08-13 01:14:15 +02:00
parent 17c4f87fa5
commit e22414d908
2 changed files with 8 additions and 10 deletions

View file

@ -18,9 +18,9 @@ class LoginO365Plugin extends \RainLoop\Plugins\AbstractPlugin
{ {
const const
NAME = 'Office365/Outlook OAuth2', NAME = 'Office365/Outlook OAuth2',
VERSION = '0.1', VERSION = '0.2',
RELEASE = '2024-07-01', RELEASE = '2024-08-13',
REQUIRED = '2.36.5', REQUIRED = '2.36.1',
CATEGORY = 'Login', CATEGORY = 'Login',
DESCRIPTION = 'Office365/Outlook IMAP, Sieve & SMTP login using RFC 7628 OAuth2'; DESCRIPTION = 'Office365/Outlook IMAP, Sieve & SMTP login using RFC 7628 OAuth2';
@ -45,8 +45,12 @@ class LoginO365Plugin extends \RainLoop\Plugins\AbstractPlugin
$this->addHook('filter.http-paths', 'httpPaths'); $this->addHook('filter.http-paths', 'httpPaths');
} }
public function httpPaths(array $aPaths) : void public function httpPaths(array &$aPaths) : void
{ {
if (!empty($_SERVER['PATH_INFO']) && \str_ends_with($_SERVER['PATH_INFO'], 'LoginO365')) {
$aPaths = ['LoginO365'];
}
if (!empty($aPaths[0]) && 'LoginO365' === $aPaths[0]) { if (!empty($aPaths[0]) && 'LoginO365' === $aPaths[0]) {
$oConfig = \RainLoop\Api::Config(); $oConfig = \RainLoop\Api::Config();
$oConfig->Set('security', 'secfetch_allow', $oConfig->Set('security', 'secfetch_allow',

View file

@ -66,12 +66,6 @@ abstract class Service
} }
$sQuery = \trim($_SERVER['QUERY_STRING'] ?? ''); $sQuery = \trim($_SERVER['QUERY_STRING'] ?? '');
/*
https://github.com/the-djmaze/snappymail/commit/47d18cafa38dd526b4221c2a72d1529e4fa1d255#r144395031
if (!empty($_SERVER['PATH_INFO'])) {
$sQuery = \ltrim($_SERVER['PATH_INFO'],'/') . '&' . $sQuery;
}
*/
$iPos = \strpos($sQuery, '&'); $iPos = \strpos($sQuery, '&');
if (0 < $iPos) { if (0 < $iPos) {
$sQuery = \substr($sQuery, 0, $iPos); $sQuery = \substr($sQuery, 0, $iPos);