Permalink
Browse files

Fix Mailer

  • Loading branch information...
1 parent 8d2ac44 commit 0eceb18e9b204da0b144dcb7d6ca0c0387abdef0 @cdujeu cdujeu committed Jun 24, 2016
@@ -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){
}
-}
+}
@@ -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;
@@ -411,7 +411,7 @@ public function stream_write($data)
*/
public function unlink($path)
{
- // TODO: Implement unlink() method.
+ // Do nothing
}
/**
@@ -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"];
@@ -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.");
}

0 comments on commit 0eceb18

Please sign in to comment.