PHPCI/Plugin/Xmpp.php : Fix command to send to system

This commit is contained in:
Alexandre Russo 2014-05-21 12:25:05 +02:00
parent 70ac59e65b
commit bb500d49b4

View file

@ -189,17 +189,24 @@ class XMPP implements \PHPCI\Plugin
/* /*
* Send XMPP notification for all recipients * Send XMPP notification for all recipients
*/ */
$success = array() $cmd = $sendxmpp . "%s -f .sendxmpprc -m %s %s";
$recipients = '';
foreach($this->recipients as $recipient) { foreach($this->recipients as $recipient) {
if($cmd = $this->phpci->executeCommand('echo %s | ' . $sendxmpp . if(!empty($recipients))
' %s %s', $this->getMessage(), $tls, $recipients)) { $recipients .= ' ';
$success[] = $cmd; $recipients .= $recipient;
}
print $this->phpci->getLastOutput();
} }
return (count($success) === count($this->recipients)); $success = $this->phpci->executeCommand(
$cmd, $tls, $message_file, $recipients);
print $this->phpci->getLastOutput();
/*
* Remove temp message file
*/
$this->phpci->executeCommand("rm -rf ".$message_file);
return $success;
} }
/** /**