mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-07 16:37:02 +03:00
Improve Capa handling
This commit is contained in:
parent
6e1aae3f61
commit
118587dcf3
2 changed files with 25 additions and 23 deletions
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
namespace RainLoop;
|
namespace RainLoop;
|
||||||
|
|
||||||
|
use RainLoop\Enumerations\Capa;
|
||||||
|
|
||||||
class Actions
|
class Actions
|
||||||
{
|
{
|
||||||
use Actions\Admin;
|
use Actions\Admin;
|
||||||
|
|
@ -471,7 +473,7 @@ class Actions
|
||||||
$oDriver = null;
|
$oDriver = null;
|
||||||
try {
|
try {
|
||||||
// if ($this->oConfig->Get('contacts', 'enable', false)) {
|
// if ($this->oConfig->Get('contacts', 'enable', false)) {
|
||||||
if ($this->GetCapa(Enumerations\Capa::CONTACTS)) {
|
if ($this->GetCapa(Capa::CONTACTS)) {
|
||||||
$oDriver = $this->fabrica('address-book', $oAccount);
|
$oDriver = $this->fabrica('address-book', $oAccount);
|
||||||
}
|
}
|
||||||
if ($oAccount && $oDriver) {
|
if ($oAccount && $oDriver) {
|
||||||
|
|
@ -712,7 +714,7 @@ class Actions
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$aAttachmentsActions = array();
|
$aAttachmentsActions = array();
|
||||||
if ($this->GetCapa(Enumerations\Capa::ATTACHMENTS_ACTIONS)) {
|
if ($this->GetCapa(Capa::ATTACHMENTS_ACTIONS)) {
|
||||||
if (\class_exists('PharData') || \class_exists('ZipArchive')) {
|
if (\class_exists('PharData') || \class_exists('ZipArchive')) {
|
||||||
$aAttachmentsActions[] = 'zip';
|
$aAttachmentsActions[] = 'zip';
|
||||||
}
|
}
|
||||||
|
|
@ -809,7 +811,7 @@ class Actions
|
||||||
$aResult['fontSerif'] = $oSettings->GetConf('fontSerif', '');
|
$aResult['fontSerif'] = $oSettings->GetConf('fontSerif', '');
|
||||||
$aResult['fontMono'] = $oSettings->GetConf('fontMono', '');
|
$aResult['fontMono'] = $oSettings->GetConf('fontMono', '');
|
||||||
|
|
||||||
if ($this->GetCapa(Enumerations\Capa::USER_BACKGROUND)) {
|
if ($this->GetCapa(Capa::USER_BACKGROUND)) {
|
||||||
$aResult['userBackgroundName'] = (string)$oSettings->GetConf('UserBackgroundName', '');
|
$aResult['userBackgroundName'] = (string)$oSettings->GetConf('UserBackgroundName', '');
|
||||||
$aResult['userBackgroundHash'] = (string)$oSettings->GetConf('UserBackgroundHash', '');
|
$aResult['userBackgroundHash'] = (string)$oSettings->GetConf('UserBackgroundHash', '');
|
||||||
}
|
}
|
||||||
|
|
@ -971,26 +973,26 @@ class Actions
|
||||||
if (!$aResult) {
|
if (!$aResult) {
|
||||||
$oConfig = $this->oConfig;
|
$oConfig = $this->oConfig;
|
||||||
$aResult = array(
|
$aResult = array(
|
||||||
'AdditionalAccounts' => (bool) $oConfig->Get('webmail', 'allow_additional_accounts', false),
|
Capa::ADDITIONAL_ACCOUNTS => (bool) $oConfig->Get('webmail', 'allow_additional_accounts', false),
|
||||||
'AttachmentThumbnails' => (bool) $oConfig->Get('interface', 'show_attachment_thumbnail', true)
|
Capa::ATTACHMENT_THUMBNAILS => (bool) $oConfig->Get('interface', 'show_attachment_thumbnail', true)
|
||||||
&& ($bAdmin
|
&& ($bAdmin
|
||||||
|| \extension_loaded('gd')
|
|| \extension_loaded('gd')
|
||||||
|| \extension_loaded('gmagick')
|
|| \extension_loaded('gmagick')
|
||||||
|| \extension_loaded('imagick')
|
|| \extension_loaded('imagick')
|
||||||
),
|
),
|
||||||
'AttachmentsActions' => (bool) $oConfig->Get('capa', 'attachments_actions', false),
|
Capa::ATTACHMENTS_ACTIONS => (bool) $oConfig->Get('capa', 'attachments_actions', false),
|
||||||
'Contacts' => (bool) $oConfig->Get('contacts', 'enable', false),
|
Capa::CONTACTS => (bool) $oConfig->Get('contacts', 'enable', false),
|
||||||
'DangerousActions' => (bool) $oConfig->Get('capa', 'dangerous_actions', true),
|
Capa::DANGEROUS_ACTIONS => (bool) $oConfig->Get('capa', 'dangerous_actions', true),
|
||||||
'GnuPG' => (bool) $oConfig->Get('security', 'openpgp', false) && \SnappyMail\PGP\GnuPG::isSupported(),
|
Capa::GNUPG => (bool) $oConfig->Get('security', 'openpgp', false) && \SnappyMail\PGP\GnuPG::isSupported(),
|
||||||
'Identities' => (bool) $oConfig->Get('webmail', 'allow_additional_identities', false),
|
Capa::IDENTITIES => (bool) $oConfig->Get('webmail', 'allow_additional_identities', false),
|
||||||
'Kolab' => false, // See Kolab plugin
|
Capa::OPENPGP => (bool) $oConfig->Get('security', 'openpgp', false),
|
||||||
'OpenPGP' => (bool) $oConfig->Get('security', 'openpgp', false),
|
Capa::SIEVE => false,
|
||||||
'Sieve' => false,
|
Capa::THEMES => (bool) $oConfig->Get('webmail', 'allow_themes', false),
|
||||||
'Themes' => (bool) $oConfig->Get('webmail', 'allow_themes', false),
|
Capa::USER_BACKGROUND => (bool) $oConfig->Get('webmail', 'allow_user_background', false),
|
||||||
'UserBackground' => (bool) $oConfig->Get('webmail', 'allow_user_background', false)
|
'Kolab' => false, // See Kolab plugin
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
$aResult['Sieve'] = $bAdmin || ($oAccount && $oAccount->Domain()->UseSieve());
|
$aResult[Capa::SIEVE] = $bAdmin || ($oAccount && $oAccount->Domain()->UseSieve());
|
||||||
return $aResult;
|
return $aResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,15 +4,15 @@ namespace RainLoop\Enumerations;
|
||||||
|
|
||||||
abstract class Capa
|
abstract class Capa
|
||||||
{
|
{
|
||||||
|
const ADDITIONAL_ACCOUNTS = 'AdditionalAccounts';
|
||||||
|
const ATTACHMENTS_ACTIONS = 'AttachmentsActions';
|
||||||
|
const ATTACHMENT_THUMBNAILS = 'AttachmentThumbnails';
|
||||||
|
const CONTACTS = 'Contacts';
|
||||||
|
const DANGEROUS_ACTIONS = 'DangerousActions';
|
||||||
const GNUPG = 'GnuPG';
|
const GNUPG = 'GnuPG';
|
||||||
|
const IDENTITIES = 'Identities';
|
||||||
const OPENPGP = 'OpenPGP';
|
const OPENPGP = 'OpenPGP';
|
||||||
|
const SIEVE = 'Sieve';
|
||||||
const THEMES = 'Themes';
|
const THEMES = 'Themes';
|
||||||
const USER_BACKGROUND = 'UserBackground';
|
const USER_BACKGROUND = 'UserBackground';
|
||||||
const SIEVE = 'Sieve';
|
|
||||||
const ATTACHMENT_THUMBNAILS = 'AttachmentThumbnails';
|
|
||||||
const ADDITIONAL_ACCOUNTS = 'AdditionalAccounts';
|
|
||||||
const IDENTITIES = 'Identities';
|
|
||||||
const CONTACTS = 'Contacts';
|
|
||||||
const ATTACHMENTS_ACTIONS = 'AttachmentsActions';
|
|
||||||
const DANGEROUS_ACTIONS = 'DangerousActions';
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue