From cd8b3936fbdb022936feff7535fbcbde6f485f42 Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Wed, 24 Apr 2024 02:02:37 +0200 Subject: [PATCH] Move OAuth2 to core --- plugins/login-gmail/index.php | 11 ++--------- .../v/0.0.0/app/libraries}/OAuth2/Client.php | 2 +- .../libraries}/OAuth2/GrantType/AuthorizationCode.php | 0 .../libraries}/OAuth2/GrantType/ClientCredentials.php | 0 .../app/libraries}/OAuth2/GrantType/IGrantType.php | 0 .../app/libraries}/OAuth2/GrantType/Password.php | 0 .../app/libraries}/OAuth2/GrantType/RefreshToken.php | 0 .../v/0.0.0/app/libraries}/OAuth2/LICENSE | 0 .../v/0.0.0/app/libraries}/OAuth2/README.md | 0 9 files changed, 3 insertions(+), 10 deletions(-) rename {plugins/login-gmail => snappymail/v/0.0.0/app/libraries}/OAuth2/Client.php (99%) rename {plugins/login-gmail => snappymail/v/0.0.0/app/libraries}/OAuth2/GrantType/AuthorizationCode.php (100%) rename {plugins/login-gmail => snappymail/v/0.0.0/app/libraries}/OAuth2/GrantType/ClientCredentials.php (100%) rename {plugins/login-gmail => snappymail/v/0.0.0/app/libraries}/OAuth2/GrantType/IGrantType.php (100%) rename {plugins/login-gmail => snappymail/v/0.0.0/app/libraries}/OAuth2/GrantType/Password.php (100%) rename {plugins/login-gmail => snappymail/v/0.0.0/app/libraries}/OAuth2/GrantType/RefreshToken.php (100%) rename {plugins/login-gmail => snappymail/v/0.0.0/app/libraries}/OAuth2/LICENSE (100%) rename {plugins/login-gmail => snappymail/v/0.0.0/app/libraries}/OAuth2/README.md (100%) diff --git a/plugins/login-gmail/index.php b/plugins/login-gmail/index.php index 706a8e738..3269d7997 100644 --- a/plugins/login-gmail/index.php +++ b/plugins/login-gmail/index.php @@ -14,8 +14,8 @@ class LoginGMailPlugin extends \RainLoop\Plugins\AbstractPlugin const NAME = 'GMail OAuth2', VERSION = '2.36', - RELEASE = '2024-03-27', - REQUIRED = '2.36.0', + RELEASE = '2024-04-23', + REQUIRED = '2.36.1', CATEGORY = 'Login', DESCRIPTION = 'GMail IMAP, Sieve & SMTP login using RFC 7628 OAuth2'; @@ -33,13 +33,6 @@ class LoginGMailPlugin extends \RainLoop\Plugins\AbstractPlugin $this->addHook('smtp.before-login', 'clientLogin'); $this->addHook('sieve.before-login', 'clientLogin'); -// set_include_path(get_include_path() . PATH_SEPARATOR . __DIR__); - spl_autoload_register(function($classname){ - if (str_starts_with($classname, 'OAuth2\\')) { - include_once __DIR__ . strtr("\\{$classname}", '\\', DIRECTORY_SEPARATOR) . '.php'; - } - }); - $this->addPartHook('LoginGMail', 'ServiceLoginGMail'); // Prevent Disallowed Sec-Fetch Dest: document Mode: navigate Site: cross-site User: true diff --git a/plugins/login-gmail/OAuth2/Client.php b/snappymail/v/0.0.0/app/libraries/OAuth2/Client.php similarity index 99% rename from plugins/login-gmail/OAuth2/Client.php rename to snappymail/v/0.0.0/app/libraries/OAuth2/Client.php index 46f34c42f..c09fa5a4d 100644 --- a/plugins/login-gmail/OAuth2/Client.php +++ b/snappymail/v/0.0.0/app/libraries/OAuth2/Client.php @@ -22,7 +22,7 @@ * * @author Pierrick Charron * @author Anis Berejeb - * @version 1.3.1-dev + * @version 1.3.1 */ namespace OAuth2; diff --git a/plugins/login-gmail/OAuth2/GrantType/AuthorizationCode.php b/snappymail/v/0.0.0/app/libraries/OAuth2/GrantType/AuthorizationCode.php similarity index 100% rename from plugins/login-gmail/OAuth2/GrantType/AuthorizationCode.php rename to snappymail/v/0.0.0/app/libraries/OAuth2/GrantType/AuthorizationCode.php diff --git a/plugins/login-gmail/OAuth2/GrantType/ClientCredentials.php b/snappymail/v/0.0.0/app/libraries/OAuth2/GrantType/ClientCredentials.php similarity index 100% rename from plugins/login-gmail/OAuth2/GrantType/ClientCredentials.php rename to snappymail/v/0.0.0/app/libraries/OAuth2/GrantType/ClientCredentials.php diff --git a/plugins/login-gmail/OAuth2/GrantType/IGrantType.php b/snappymail/v/0.0.0/app/libraries/OAuth2/GrantType/IGrantType.php similarity index 100% rename from plugins/login-gmail/OAuth2/GrantType/IGrantType.php rename to snappymail/v/0.0.0/app/libraries/OAuth2/GrantType/IGrantType.php diff --git a/plugins/login-gmail/OAuth2/GrantType/Password.php b/snappymail/v/0.0.0/app/libraries/OAuth2/GrantType/Password.php similarity index 100% rename from plugins/login-gmail/OAuth2/GrantType/Password.php rename to snappymail/v/0.0.0/app/libraries/OAuth2/GrantType/Password.php diff --git a/plugins/login-gmail/OAuth2/GrantType/RefreshToken.php b/snappymail/v/0.0.0/app/libraries/OAuth2/GrantType/RefreshToken.php similarity index 100% rename from plugins/login-gmail/OAuth2/GrantType/RefreshToken.php rename to snappymail/v/0.0.0/app/libraries/OAuth2/GrantType/RefreshToken.php diff --git a/plugins/login-gmail/OAuth2/LICENSE b/snappymail/v/0.0.0/app/libraries/OAuth2/LICENSE similarity index 100% rename from plugins/login-gmail/OAuth2/LICENSE rename to snappymail/v/0.0.0/app/libraries/OAuth2/LICENSE diff --git a/plugins/login-gmail/OAuth2/README.md b/snappymail/v/0.0.0/app/libraries/OAuth2/README.md similarity index 100% rename from plugins/login-gmail/OAuth2/README.md rename to snappymail/v/0.0.0/app/libraries/OAuth2/README.md