Skip to content
Snippets Groups Projects
Commit 11e4a0cf authored by Peter Rotich's avatar Peter Rotich
Browse files

Credit @greezybacon

parent dab78a3e
No related branches found
No related tags found
No related merge requests found
......@@ -36,25 +36,7 @@ implements EmailContact, ITicketUser, TemplateVariable {
? call_user_func_array(array($this->user, $name), $args)
: call_user_func(array($this->user, $name));
if ($rv) return $rv;
$tag = substr($name, 3);
switch (strtolower($tag)) {
case 'ticket_link':
$qstr = array();
if ($cfg && $cfg->isAuthTokenEnabled()
&& ($ticket=$this->getTicket()))
$qstr['auth'] = $ticket->getAuthToken($this);
return sprintf('%s/view.php?%s',
$cfg->getBaseUrl(),
Http::build_query($qstr, false)
);
break;
}
return false;
return $rv ?: false;
}
// Required for Internationalization::getCurrentLanguage() in templates
......@@ -70,6 +52,22 @@ implements EmailContact, ITicketUser, TemplateVariable {
);
}
function getVar($tag) {
switch (strtolower($tag)) {
case 'ticket_link':
$qstr = array();
if ($cfg && $cfg->isAuthTokenEnabled()
&& ($ticket=$this->getTicket()))
$qstr['auth'] = $ticket->getAuthToken($this);
return sprintf('%s/view.php?%s',
$cfg->getBaseUrl(),
Http::build_query($qstr, false)
);
break;
}
}
function getId() { return ($this->user) ? $this->user->getId() : null; }
function getEmail() { return ($this->user) ? $this->user->getEmail() : null; }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment