/**
  * @param bool $bAdmin
  * @param \RainLoop\Model\Account $oAccount = null
  *
  * @return array
  */
 public function Capa($bAdmin, $oAccount = null)
 {
     $oConfig = $this->Config();
     $aResult = array();
     if ($oConfig->Get('capa', 'folders', true)) {
         $aResult[] = \RainLoop\Enumerations\Capa::FOLDERS;
         if ($oConfig->Get('capa', 'messagelist_actions', true)) {
             $aResult[] = \RainLoop\Enumerations\Capa::MESSAGELIST_ACTIONS;
             if ($oConfig->Get('capa', 'dangerous_actions', true)) {
                 $aResult[] = \RainLoop\Enumerations\Capa::DANGEROUS_ACTIONS;
             }
         }
     }
     if ($oConfig->Get('capa', 'reload', true)) {
         $aResult[] = \RainLoop\Enumerations\Capa::RELOAD;
     }
     if ($oConfig->Get('capa', 'quota', true)) {
         $aResult[] = \RainLoop\Enumerations\Capa::QUOTA;
     }
     if ($oConfig->Get('capa', 'settings', true)) {
         $aResult[] = \RainLoop\Enumerations\Capa::SETTINGS;
         if ($oConfig->Get('webmail', 'allow_additional_accounts', false)) {
             $aResult[] = \RainLoop\Enumerations\Capa::ADDITIONAL_ACCOUNTS;
         }
         if ($oConfig->Get('webmail', 'allow_additional_identities', false)) {
             $aResult[] = \RainLoop\Enumerations\Capa::IDENTITIES;
         }
         if ($oConfig->Get('capa', 'x-templates', true)) {
             $aResult[] = \RainLoop\Enumerations\Capa::TEMPLATES;
         }
         if ($oConfig->Get('webmail', 'allow_themes', false)) {
             $aResult[] = \RainLoop\Enumerations\Capa::THEMES;
         }
         if ($oConfig->Get('webmail', 'allow_user_background', false)) {
             $aResult[] = \RainLoop\Enumerations\Capa::USER_BACKGROUND;
         }
         if ($oConfig->Get('security', 'openpgp', false)) {
             $aResult[] = \RainLoop\Enumerations\Capa::OPEN_PGP;
         }
         if ($oConfig->Get('capa', 'filters', false)) {
             $aResult[] = \RainLoop\Enumerations\Capa::FILTERS;
             if ($bAdmin || $oAccount && $oAccount->Domain()->UseSieve()) {
                 $aResult[] = \RainLoop\Enumerations\Capa::SIEVE;
             }
         }
     }
     if ($oConfig->Get('security', 'allow_two_factor_auth', false) && ($bAdmin || $oAccount && !$oAccount->IsAdditionalAccount())) {
         $aResult[] = \RainLoop\Enumerations\Capa::TWO_FACTOR;
         if ($oConfig->Get('security', 'force_two_factor_auth', false) && ($bAdmin || $oAccount && !$oAccount->IsAdditionalAccount())) {
             $aResult[] = \RainLoop\Enumerations\Capa::TWO_FACTOR_FORCE;
         }
     }
     if ($oConfig->Get('capa', 'help', true)) {
         $aResult[] = \RainLoop\Enumerations\Capa::HELP;
     }
     if ($oConfig->Get('capa', 'attachments_actions', false)) {
         $aResult[] = \RainLoop\Enumerations\Capa::ATTACHMENTS_ACTIONS;
     }
     if ($oConfig->Get('capa', 'message_actions', true)) {
         $aResult[] = \RainLoop\Enumerations\Capa::MESSAGE_ACTIONS;
     }
     if ($oConfig->Get('capa', 'composer', true)) {
         $aResult[] = \RainLoop\Enumerations\Capa::COMPOSER;
         if ($oConfig->Get('capa', 'contacts', true)) {
             $aResult[] = \RainLoop\Enumerations\Capa::CONTACTS;
         }
     }
     if ($oConfig->Get('capa', 'search', true)) {
         $aResult[] = \RainLoop\Enumerations\Capa::SEARCH;
         if ($oConfig->Get('capa', 'search_adv', true)) {
             $aResult[] = \RainLoop\Enumerations\Capa::SEARCH_ADV;
         }
     }
     if ($oConfig->Get('labs', 'allow_gravatar', false)) {
         $aResult[] = \RainLoop\Enumerations\Capa::GRAVATAR;
     }
     if ($oConfig->Get('interface', 'show_attachment_thumbnail', true)) {
         $aResult[] = \RainLoop\Enumerations\Capa::ATTACHMENT_THUMBNAILS;
     }
     if ($oConfig->Get('labs', 'allow_prefetch', false)) {
         $aResult[] = \RainLoop\Enumerations\Capa::PREFETCH;
     }
     if (!\RainLoop\Utils::IsOwnCloud()) {
         $aResult[] = \RainLoop\Enumerations\Capa::AUTOLOGOUT;
     }
     return $aResult;
 }
Esempio n. 2
0
 /**
  * @param bool $bAdmin
  * @param \RainLoop\Model\Account $oAccount = null
  *
  * @return array
  */
 public function Capa($bAdmin, $oAccount = null)
 {
     $oConfig = $this->Config();
     $aResult = array();
     if ($oConfig->Get('capa', 'filters', false)) {
         $aResult[] = \RainLoop\Enumerations\Capa::FILTERS;
         if ($bAdmin || $oAccount && $oAccount->Domain()->UseSieve()) {
             $aResult[] = \RainLoop\Enumerations\Capa::SIEVE;
         }
     }
     //		if ($oConfig->Get('capa', 'templates', true))
     //		{
     //			$aResult[] = \RainLoop\Enumerations\Capa::TEMPLATES;
     //		}
     if ($oConfig->Get('webmail', 'allow_additional_accounts', false)) {
         $aResult[] = \RainLoop\Enumerations\Capa::ADDITIONAL_ACCOUNTS;
     }
     if ($oConfig->Get('security', 'allow_two_factor_auth', false) && ($bAdmin || $oAccount && !$oAccount->IsAdditionalAccount())) {
         $aResult[] = \RainLoop\Enumerations\Capa::TWO_FACTOR;
     }
     if ($oConfig->Get('labs', 'allow_gravatar', false)) {
         $aResult[] = \RainLoop\Enumerations\Capa::GRAVATAR;
     }
     if ($oConfig->Get('interface', 'show_attachment_thumbnail', true)) {
         $aResult[] = \RainLoop\Enumerations\Capa::ATTACHMENT_THUMBNAILS;
     }
     if ($oConfig->Get('labs', 'allow_prefetch', false)) {
         $aResult[] = \RainLoop\Enumerations\Capa::PREFETCH;
     }
     if ($oConfig->Get('webmail', 'allow_themes', false)) {
         $aResult[] = \RainLoop\Enumerations\Capa::THEMES;
     }
     if ($oConfig->Get('webmail', 'allow_user_background', false)) {
         $aResult[] = \RainLoop\Enumerations\Capa::USER_BACKGROUND;
     }
     if ($oConfig->Get('security', 'openpgp', false)) {
         $aResult[] = \RainLoop\Enumerations\Capa::OPEN_PGP;
     }
     if (!\RainLoop\Utils::IsOwnCloud()) {
         $aResult[] = \RainLoop\Enumerations\Capa::AUTOLOGOUT;
     }
     return $aResult;
 }