Add transport to alert_template vars

This commit is contained in:
Eldon Koyle
2016-03-01 11:39:06 -07:00
parent 9b3b563fb2
commit b34ee3932f

View File

@@ -121,8 +121,6 @@ function IssueAlert($alert) {
$obj = DescribeAlert($alert);
if (is_array($obj)) {
echo 'Issuing Alert-UID #'.$alert['id'].'/'.$alert['state'].': ';
$msg = FormatAlertTpl($obj);
$obj['msg'] = $msg;
if (!empty($config['alert']['transports'])) {
ExtTransports($obj);
}
@@ -336,6 +334,9 @@ function ExtTransports($obj) {
$opts = array_filter($opts);
}
if (($opts === true || !empty($opts)) && $opts != false && file_exists($config['install_dir'].'/includes/alerts/transport.'.$transport.'.php')) {
$obj['transport'] = $transport;
$msg = FormatAlertTpl($obj);
$obj['msg'] = $msg;
echo $transport.' => ';
eval('$tmp = function($obj,$opts) { global $config; '.file_get_contents($config['install_dir'].'/includes/alerts/transport.'.$transport.'.php').' return false; };');
$tmp = $tmp($obj,$opts);