Skip to content

Commit

Permalink
Merge remote branch 'upstream/develop-next' into develop-next
Browse files Browse the repository at this point in the history
  • Loading branch information
protich committed Apr 23, 2019
2 parents fb8a4bf + 9cdbe45 commit ed1381e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 21 deletions.
32 changes: 14 additions & 18 deletions include/class.client.php
Expand Up @@ -58,25 +58,21 @@ function getVar($tag) {
switch (strtolower($tag)) {
case 'ticket_link':
$qstr = array();
$ticket = $this->getTicket();
if ($cfg && $cfg->isAuthTokenEnabled()
&& ($ticket=$this->getTicket())) {
if (!$ticket->getThread()->getNumCollaborators()) {
$qstr['auth'] = $ticket->getAuthToken($this);
return sprintf('%s/view.php?%s',
$cfg->getBaseUrl(),
Http::build_query($qstr, false)
);
}
else {
return sprintf('%s/tickets.php?id=%s',
$cfg->getBaseUrl(),
$ticket->getId()
);
}
}



&& $ticket
&& !$ticket->getNumCollaborators()) {
$qstr['auth'] = $ticket->getAuthToken($this);
return sprintf('%s/view.php?%s',
$cfg->getBaseUrl(),
Http::build_query($qstr, false)
);
} else {
return sprintf('%s/tickets.php?id=%s',
$cfg->getBaseUrl(),
$ticket ? $ticket->getId() : 0
);
}
break;
}
}
Expand Down
8 changes: 5 additions & 3 deletions include/class.mailer.php
Expand Up @@ -587,7 +587,9 @@ function($match) use ($domain, $mime, $self) {

//No SMTP or it failed....use php's native mail function.
$args = array();
if ($this->getEmail())
if (isset($options['from_address']))
$args[] = '-f '.$options['from_address'];
elseif ($this->getEmail())
$args = array('-f '.$this->getEmail()->getEmail());
$mail = mail::factory('mail', $args);
$to = $headers['To'];
Expand All @@ -612,10 +614,10 @@ function logError($error) {

//Emails using native php mail function - if DB connection doesn't exist.
//Don't use this function if you can help it.
function sendmail($to, $subject, $message, $from) {
function sendmail($to, $subject, $message, $from, $options=null) {
$mailer = new Mailer(null, array('notice'=>true, 'nobounce'=>true));
$mailer->setFromAddress($from);
return $mailer->send($to, $subject, $message);
return $mailer->send($to, $subject, $message, $options);
}
}
?>

0 comments on commit ed1381e

Please sign in to comment.