From 986b3a79f1f4310674b943380dfe701fddee6f9e Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Sun, 10 Mar 2024 19:00:46 +0100 Subject: [PATCH] Fix Capa handling --- .../v/0.0.0/app/libraries/RainLoop/Actions/Contacts.php | 4 +++- .../v/0.0.0/app/libraries/RainLoop/Actions/Folders.php | 1 - .../v/0.0.0/app/libraries/RainLoop/Actions/Messages.php | 1 - .../v/0.0.0/app/libraries/RainLoop/Actions/Response.php | 1 - .../v/0.0.0/app/libraries/RainLoop/Actions/Themes.php | 6 ++++-- .../v/0.0.0/app/libraries/RainLoop/Actions/UserAuth.php | 3 ++- 6 files changed, 9 insertions(+), 7 deletions(-) diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Contacts.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Contacts.php index b92bbb6d5..64566fd2d 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Contacts.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Contacts.php @@ -2,6 +2,8 @@ namespace RainLoop\Actions; +use RainLoop\Enumerations\Capa; + trait Contacts { /** @@ -15,7 +17,7 @@ trait Contacts $oDriver = null; try { // if ($this->oConfig->Get('contacts', 'enable', false)) { - if ($this->GetCapa(\RainLoop\Capa::CONTACTS)) { + if ($this->GetCapa(Capa::CONTACTS)) { $oDriver = $this->fabrica('address-book', $oAccount); } if ($oAccount && $oDriver) { diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Folders.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Folders.php index e7ff3bc57..23caff42f 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Folders.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Folders.php @@ -2,7 +2,6 @@ namespace RainLoop\Actions; -use RainLoop\Enumerations\Capa; use RainLoop\Exceptions\ClientException; use RainLoop\Notifications; use MailSo\Imap\Enumerations\FolderType; diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Messages.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Messages.php index 3cfc834a2..6b7b713fc 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Messages.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Messages.php @@ -2,7 +2,6 @@ namespace RainLoop\Actions; -use RainLoop\Enumerations\Capa; use RainLoop\Exceptions\ClientException; use RainLoop\Model\Account; use RainLoop\Notifications; diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Response.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Response.php index a61ba47fc..153f70931 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Response.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Response.php @@ -2,7 +2,6 @@ namespace RainLoop\Actions; -use RainLoop\Enumerations\Capa; use RainLoop\Notifications; use RainLoop\Utils; diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Themes.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Themes.php index 89a60d884..01779808d 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Themes.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Themes.php @@ -2,6 +2,8 @@ namespace RainLoop\Actions; +use RainLoop\Enumerations\Capa; + trait Themes { public function GetTheme(bool $bAdmin): string @@ -11,7 +13,7 @@ trait Themes $sTheme = $this->Config()->Get('webmail', 'theme', 'Default'); if (!$bAdmin && ($oAccount = $this->getAccountFromToken(false)) - && $this->GetCapa(\RainLoop\Enumerations\Capa::THEMES) + && $this->GetCapa(Capa::THEMES) && ($oSettingsLocal = $this->SettingsProvider(true)->Load($oAccount))) { $sTheme = (string) $oSettingsLocal->GetConf('Theme', $sTheme); } @@ -146,7 +148,7 @@ trait Themes { $oAccount = $this->getAccountFromToken(); - if (!$this->GetCapa(\RainLoop\Enumerations\Capa::USER_BACKGROUND)) { + if (!$this->GetCapa(Capa::USER_BACKGROUND)) { return $this->FalseResponse(); } diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/UserAuth.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/UserAuth.php index 35c56297b..ba3f841d5 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/UserAuth.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/UserAuth.php @@ -2,6 +2,7 @@ namespace RainLoop\Actions; +use RainLoop\Enumerations\Capa; use RainLoop\Notifications; use RainLoop\Utils; use RainLoop\Model\Account; @@ -164,7 +165,7 @@ trait UserAuth { $this->Http()->ServerNoCache(); $oMainAccount = $this->getMainAccountFromToken(false); - if ($sEmail && $oMainAccount && $this->GetCapa(\RainLoop\Enumerations\Capa::ADDITIONAL_ACCOUNTS)) { + if ($sEmail && $oMainAccount && $this->GetCapa(Capa::ADDITIONAL_ACCOUNTS)) { $oAccount = null; if ($oMainAccount->Email() === $sEmail) { $this->SetAdditionalAuthToken($oAccount);