Fix Capa handling

This commit is contained in:
the-djmaze 2024-03-10 19:00:46 +01:00
parent c450965cb6
commit 986b3a79f1
6 changed files with 9 additions and 7 deletions

View file

@ -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) {

View file

@ -2,7 +2,6 @@
namespace RainLoop\Actions;
use RainLoop\Enumerations\Capa;
use RainLoop\Exceptions\ClientException;
use RainLoop\Notifications;
use MailSo\Imap\Enumerations\FolderType;

View file

@ -2,7 +2,6 @@
namespace RainLoop\Actions;
use RainLoop\Enumerations\Capa;
use RainLoop\Exceptions\ClientException;
use RainLoop\Model\Account;
use RainLoop\Notifications;

View file

@ -2,7 +2,6 @@
namespace RainLoop\Actions;
use RainLoop\Enumerations\Capa;
use RainLoop\Notifications;
use RainLoop\Utils;

View file

@ -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();
}

View file

@ -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);