Small fixes

This commit is contained in:
RainLoop Team 2016-05-06 22:06:16 +03:00
parent b6fcd8e992
commit 768ce1d85e
5 changed files with 90 additions and 90 deletions

View file

@ -1380,6 +1380,81 @@ class Actions
return !$this->PremProvider();
}
/**
* @param bool $bAdmin = false
* @param bool $bMobile = false
* @param bool $bMobileDevice = false
*
* @return array
*/
public function AppDataSystem($bAdmin = false, $bMobile = false, $bMobileDevice = false)
{
$oConfig = $this->Config();
$sRsaPublicKey = '';
if ($oConfig->Get('security', 'use_rsa_encryption', false) &&
\file_exists(APP_PRIVATE_DATA.'rsa/public') && \file_exists(APP_PRIVATE_DATA.'rsa/private'))
{
$sRsaPublicKey = @\file_get_contents(APP_PRIVATE_DATA.'rsa/public') || '';
if (false === \strpos($sRsaPublicKey, 'PUBLIC KEY'))
{
$sRsaPublicKey = '';
}
}
$aAttachmentsActions = array();
if ($this->GetCapa(false, $bMobile, \RainLoop\Enumerations\Capa::ATTACHMENTS_ACTIONS))
{
if (!!\class_exists('ZipArchive'))
{
$aAttachmentsActions[] = 'zip';
}
if (\RainLoop\Utils::IsOwnCloudLoggedIn() && \class_exists('OCP\Files'))
{
$aAttachmentsActions[] = 'owncloud';
}
if ($oConfig->Get('social', 'dropbox_enable', false) && 0 < \strlen(\trim($oConfig->Get('social', 'dropbox_api_key', ''))))
{
$aAttachmentsActions[] = 'dropbox';
}
}
return \array_merge(array(
'version' => APP_VERSION,
'mobile' => $bMobile,
'mobileDevice' => $bMobileDevice,
'webPath' => \RainLoop\Utils::WebPath(),
'webVersionPath' => \RainLoop\Utils::WebVersionPath(),
'token' => $oConfig->Get('security', 'csrf_protection', false) ? \RainLoop\Utils::GetCsrfToken() : '',
'inIframe' => (bool) $oConfig->Get('labs', 'in_iframe', false),
'allowHtmlEditorSourceButton' => (bool) $oConfig->Get('labs', 'allow_html_editor_source_button', false),
'allowHtmlEditorBitiButtons' => (bool) $oConfig->Get('labs', 'allow_html_editor_biti_buttons', false),
'allowCtrlEnterOnCompose' => (bool) $oConfig->Get('labs', 'allow_ctrl_enter_on_compose', false),
'customLoginLink' => $oConfig->Get('labs', 'custom_login_link', ''),
'customLogoutLink' => $oConfig->Get('labs', 'custom_logout_link', ''),
'forgotPasswordLinkUrl' => \trim($oConfig->Get('login', 'forgot_password_link_url', '')),
'registrationLinkUrl' => \trim($oConfig->Get('login', 'registration_link_url', '')),
'jsHash' => \md5(\RainLoop\Utils::GetConnectionToken()),
'useImapThread' => (bool) $oConfig->Get('labs', 'use_imap_thread', false),
'useImapSubscribe' => (bool) $oConfig->Get('labs', 'use_imap_list_subscribe', true),
'allowAppendMessage' => (bool) $oConfig->Get('labs', 'allow_message_append', false),
'materialDesign' => (bool) $oConfig->Get('labs', 'use_material_design', true),
'folderSpecLimit' => (int) $oConfig->Get('labs', 'folders_spec_limit', 50),
'faviconStatus' => (bool) $oConfig->Get('labs', 'favicon_status', true),
'listPermanentFiltered' => '' !== \trim(\RainLoop\Api::Config()->Get('labs', 'imap_message_list_permanent_filter', '')),
'themes' => $this->GetThemes($bMobile, false),
'languages' => $this->GetLanguages(false),
'languagesAdmin' => $this->GetLanguages(true),
'attachmentsActions' => $aAttachmentsActions,
'rsaPublicKey' => $sRsaPublicKey
), $bAdmin ? array(
'adminPath' => \strtolower($oConfig->Get('security', 'admin_panel_key', 'admin')),
'allowAdminPanel' => (bool) $oConfig->Get('security', 'allow_admin_panel', true),
) : array());
}
/**
* @param bool $bAdmin
* @param bool $bMobile = false
@ -1387,7 +1462,7 @@ class Actions
*
* @return array
*/
public function AppData($bAdmin, $bMobile = false, $sAuthAccountHash = '')
public function AppData($bAdmin, $bMobile = false, $bMobileDevice = false, $sAuthAccountHash = '')
{
if (0 < \strlen($sAuthAccountHash) && \preg_match('/[^_\-\.a-zA-Z0-9]/', $sAuthAccountHash))
{
@ -1440,7 +1515,8 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack
'PremType' => false,
'Admin' => array(),
'Capa' => array(),
'Plugins' => array()
'Plugins' => array(),
'System' => $this->AppDataSystem($bAdmin, $bMobile, $bMobileDevice)
);
if (0 < \strlen($sAuthAccountHash))