From 0eceb18e9b204da0b144dcb7d6ca0c0387abdef0 Mon Sep 17 00:00:00 2001 From: cdujeu Date: Fri, 24 Jun 2016 13:49:19 +0200 Subject: [PATCH] Fix Mailer --- core/src/plugins/access.ajxp_conf/ConfAccessDriver.php | 6 ++---- core/src/plugins/access.inbox/InboxAccessDriver.php | 6 +++--- core/src/plugins/access.inbox/InboxAccessWrapper.php | 2 +- core/src/plugins/core.mailer/Mailer.php | 5 +++-- core/src/plugins/mailer.phpmailer-lite/PhpMailLite.php | 2 +- 5 files changed, 10 insertions(+), 11 deletions(-) diff --git a/core/src/plugins/access.ajxp_conf/ConfAccessDriver.php b/core/src/plugins/access.ajxp_conf/ConfAccessDriver.php index 048c2cf21c..cd0236513e 100644 --- a/core/src/plugins/access.ajxp_conf/ConfAccessDriver.php +++ b/core/src/plugins/access.ajxp_conf/ConfAccessDriver.php @@ -3190,8 +3190,6 @@ public static function availableDriversToXML($filterByTagName = "", $filterByDri /** * @param ContextInterface $ctx */ - protected function initRepository(ContextInterface $ctx) - { - // TODO: Implement initRepository() method. + protected function initRepository(ContextInterface $ctx){ } -} +} \ No newline at end of file diff --git a/core/src/plugins/access.inbox/InboxAccessDriver.php b/core/src/plugins/access.inbox/InboxAccessDriver.php index a942327854..53d449aebc 100644 --- a/core/src/plugins/access.inbox/InboxAccessDriver.php +++ b/core/src/plugins/access.inbox/InboxAccessDriver.php @@ -161,9 +161,9 @@ public static function getNodes(ContextInterface $parentContext, $checkStats = f $repoId = $repo->getId(); // DISABLE REMOTE SHARE FOR TESTING -// if(strpos($repoId, "ocs_remote_share_") === 0){ -// continue; -// } + if(strpos($repoId, "ocs_remote_share_") === 0){ + continue; + } if(strpos($repoId, "ocs_remote_share_") !== 0){ $touchReposIds[] = $repoId; diff --git a/core/src/plugins/access.inbox/InboxAccessWrapper.php b/core/src/plugins/access.inbox/InboxAccessWrapper.php index 30b373d8f1..d2b418f38c 100644 --- a/core/src/plugins/access.inbox/InboxAccessWrapper.php +++ b/core/src/plugins/access.inbox/InboxAccessWrapper.php @@ -411,7 +411,7 @@ public function stream_write($data) */ public function unlink($path) { - // TODO: Implement unlink() method. + // Do nothing } /** diff --git a/core/src/plugins/core.mailer/Mailer.php b/core/src/plugins/core.mailer/Mailer.php index 587d570ef0..07c657610d 100644 --- a/core/src/plugins/core.mailer/Mailer.php +++ b/core/src/plugins/core.mailer/Mailer.php @@ -433,6 +433,7 @@ protected function sendMailImpl(ContextInterface $ctx, $recipients, $subject, $b public function sendMailAction(\Psr\Http\Message\ServerRequestInterface &$requestInterface, \Psr\Http\Message\ResponseInterface &$responseInterface) { $mess = LocaleService::getMessages(); + /** @var ContextInterface $ctx */ $ctx = $requestInterface->getAttribute("ctx"); $mailers = PluginsService::getInstance($ctx)->getActivePluginsForType("mailer"); if (!count($mailers)) { @@ -446,8 +447,8 @@ public function sendMailAction(\Psr\Http\Message\ServerRequestInterface &$reques //$toGroups = explode(",", $httpVars["groups_ids"]); $toUsers = $httpVars["emails"]; - $emails = $this->resolveAdresses($requestInterface->getAttribute("ctx"), $toUsers); - $from = $this->resolveFrom($httpVars["from"]); + $emails = $this->resolveAdresses($ctx, $toUsers); + $from = $this->resolveFrom($ctx, $httpVars["from"]); $imageLink = isSet($httpVars["link"]) ? $httpVars["link"] : null; $subject = $httpVars["subject"]; diff --git a/core/src/plugins/mailer.phpmailer-lite/PhpMailLite.php b/core/src/plugins/mailer.phpmailer-lite/PhpMailLite.php index 5cd7d59c39..f4ca695fd4 100644 --- a/core/src/plugins/mailer.phpmailer-lite/PhpMailLite.php +++ b/core/src/plugins/mailer.phpmailer-lite/PhpMailLite.php @@ -57,7 +57,7 @@ protected function sendMailImpl(ContextInterface $ctx, $recipients, $subject, $b $mail = new PHPMailerLite(true); $mail->Mailer = $this->getContextualOption(Context::emptyContext(), "MAILER"); $mail->Sendmail = $this->getContextualOption(Context::emptyContext(), "SENDMAIL_PATH"); - $from = $this->resolveFrom($from); + $from = $this->resolveFrom($ctx, $from); if (!is_array($from) || empty($from["adress"])) { throw new Exception("Cannot send email without a FROM address. Please check your core.mailer configuration."); }