/** * @param string $sName * @param bool $bFindWithWildCard = false * @param bool $bCheckDisabled = true * * @return \RainLoop\Model\Domain|null */ public function Load($sName, $bFindWithWildCard = false, $bCheckDisabled = true) { $oDomain = $this->oDriver->Load($sName, $bFindWithWildCard, $bCheckDisabled); if ($oDomain instanceof \RainLoop\Model\Domain) { $this->oPlugins->RunHook('filter.domain', array(&$oDomain)); } return $oDomain; }
/** * @param string $sName * @param string $sPlace * @param string $sHtml * @param bool $bPrepend = false * * @return self */ protected function addTemplateHook($sName, $sPlace, $sLocalTemplateName, $bPrepend = false) { if ($this->oPluginManager) { $this->oPluginManager->AddProcessTemplateAction($sName, $sPlace, '<!-- ko template: \'' . $sLocalTemplateName . '\' --><!-- /ko -->', $bPrepend); } return $this; }
/** * @param array $aSettings * * @return bool */ public function saveUserSettings($aSettings) { if ($this->oPluginManager && \is_array($aSettings)) { return $this->oPluginManager->SaveUserPluginSettings($this->Name(), $aSettings); } return false; }
/** * @return \RainLoop\Plugins\Manager */ public function Plugins() { if (null === $this->oPlugins) { $this->oPlugins = new \RainLoop\Plugins\Manager($this); $this->oPlugins->SetLogger($this->Logger()); } return $this->oPlugins; }
/** * @param \RainLoop\Plugins\Manager $oPlugins * @param \MailSo\Sieve\ManageSieveClient $oSieveClient * @param \RainLoop\Application $oConfig */ public function SieveConnectAndLoginHelper($oPlugins, $oSieveClient, $oConfig) { $bLogin = false; $aSieveCredentials = array('UseConnect' => true, 'UseAuth' => true, 'Host' => $this->DomainSieveHost(), 'Port' => $this->DomainSievePort(), 'Secure' => $this->DomainSieveSecure(), 'Login' => $this->IncLogin(), 'Password' => $this->Password(), 'VerifySsl' => !!$oConfig->Get('ssl', 'verify_certificate', false), 'AllowSelfSigned' => !!$oConfig->Get('ssl', 'allow_self_signed', true)); $oPlugins->RunHook('filter.sieve-credentials', array($this, &$aSieveCredentials)); $oPlugins->RunHook('event.sieve-pre-connect', array($this, $aSieveCredentials['UseConnect'], $aSieveCredentials)); if ($aSieveCredentials['UseConnect'] && $oSieveClient) { $oSieveClient->Connect($aSieveCredentials['Host'], $aSieveCredentials['Port'], $aSieveCredentials['Secure'], $aSieveCredentials['VerifySsl'], $aSieveCredentials['AllowSelfSigned']); } $oPlugins->RunHook('event.sieve-post-connect', array($this, $aSieveCredentials['UseConnect'], $aSieveCredentials)); $oPlugins->RunHook('event.sieve-pre-login', array($this, $aSieveCredentials['UseAuth'], $aSieveCredentials)); if ($aSieveCredentials['UseAuth']) { $oSieveClient->Login($aSieveCredentials['Login'], $aSieveCredentials['Password']); $bLogin = true; } $oPlugins->RunHook('event.sieve-post-login', array($this, $aSieveCredentials['UseAuth'], $bLogin, $aSieveCredentials)); return $bLogin; }