From b5127f2842164d6af2bf31d240efd9dad5546ece Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Tue, 14 Dec 2010 16:00:49 +0000 Subject: [PATCH] --- inc/ws/Controlleur/class.ws.services.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/inc/ws/Controlleur/class.ws.services.php b/inc/ws/Controlleur/class.ws.services.php index d4d177d75..58a93f73e 100644 --- a/inc/ws/Controlleur/class.ws.services.php +++ b/inc/ws/Controlleur/class.ws.services.php @@ -11,6 +11,26 @@ class wsServices extends cubeFlashGateway { public function sendEmail() { + // Check protection hash + $hash = md5(substr($this->args['fromemail'], 2, 6) . substr($this->args['email'], 3, 5) . 'SFGHF566!S' . $this->args['id']); + if ($hash != $this->args['hash']) { + $this->xml->addChild('ok', '0'); + return; + } + // Send the email + $mail = new cubeMail(); + $mail->acknowledge = isset($this->args['askAcknowledge']) && $this->args['askAcknowledge']; + $mail->charset = 'UTF-8'; + $mail->to = $this->args['email']; + $mail->from = $this->args['fromname'] . '<' . $this->args['fromemail'] . '>'; + $mail->subject = $this->args['subject']; + /*if ($this->args['attachPDFInEmail'] == '1') { + $doc_name = isset($this->args['attachmentName'])?$this->args['attachmentName']:'document.pdf'; + $file = fwsConverter::extractPages($this->args['id'], $this->args['attachPDFInEmail'], false); + $mail->addFile($doc_name, $file); + }*/ + $mail->body = $this->args['body']; + $this->xml->addChild('ok', $mail->send()?'1':'0'); } public function shortenURL() -- 2.39.5