mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-09-12 16:14:27 +08:00
Resolve #1663
This commit is contained in:
parent
2ea68e88b0
commit
3161961faa
1 changed files with 10 additions and 10 deletions
|
@ -12,9 +12,9 @@ use RainLoop\Providers\Storage\Enumerations\StorageType;
|
||||||
class LoginGMailPlugin extends \RainLoop\Plugins\AbstractPlugin
|
class LoginGMailPlugin extends \RainLoop\Plugins\AbstractPlugin
|
||||||
{
|
{
|
||||||
const
|
const
|
||||||
NAME = 'GMail OAuth2',
|
NAME = 'Login GMail OAuth2',
|
||||||
VERSION = '2.36',
|
VERSION = '2.37',
|
||||||
RELEASE = '2024-04-23',
|
RELEASE = '2024-07-15',
|
||||||
REQUIRED = '2.36.1',
|
REQUIRED = '2.36.1',
|
||||||
CATEGORY = 'Login',
|
CATEGORY = 'Login',
|
||||||
DESCRIPTION = 'GMail IMAP, Sieve & SMTP login using RFC 7628 OAuth2';
|
DESCRIPTION = 'GMail IMAP, Sieve & SMTP login using RFC 7628 OAuth2';
|
||||||
|
@ -55,18 +55,18 @@ class LoginGMailPlugin extends \RainLoop\Plugins\AbstractPlugin
|
||||||
$oHttp = $oActions->Http();
|
$oHttp = $oActions->Http();
|
||||||
$oHttp->ServerNoCache();
|
$oHttp->ServerNoCache();
|
||||||
|
|
||||||
|
$uri = \preg_replace('/.LoginGMail.*$/D', '', $_SERVER['REQUEST_URI']);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (isset($_GET['error'])) {
|
if (isset($_GET['error'])) {
|
||||||
throw new \RuntimeException($_GET['error']);
|
throw new \RuntimeException($_GET['error']);
|
||||||
}
|
}
|
||||||
if (!isset($_GET['code']) || empty($_GET['state']) || 'gmail' !== $_GET['state']) {
|
if (isset($_GET['code']) && isset($_GET['state']) && 'gmail' === $_GET['state']) {
|
||||||
$oActions->Location(\RainLoop\Utils::WebPath());
|
$oGMail = $this->gmailConnector();
|
||||||
exit;
|
|
||||||
}
|
}
|
||||||
$oGMail = $this->gmailConnector();
|
if (empty($oGMail)) {
|
||||||
if (!$oGMail) {
|
$oActions->Location($uri);
|
||||||
$oActions->Location(\RainLoop\Utils::WebPath());
|
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -137,7 +137,7 @@ class LoginGMailPlugin extends \RainLoop\Plugins\AbstractPlugin
|
||||||
{
|
{
|
||||||
$oActions->Logger()->WriteException($oException, \LOG_ERR);
|
$oActions->Logger()->WriteException($oException, \LOG_ERR);
|
||||||
}
|
}
|
||||||
$oActions->Location(\RainLoop\Utils::WebPath());
|
$oActions->Location($uri);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue