Use Config helper (#10339)

remove usage of global variable
This commit is contained in:
Tony Murray
2019-06-23 00:29:12 -05:00
committed by GitHub
parent 342acf50f1
commit f3ba8947f7
367 changed files with 1589 additions and 1857 deletions

View File

@@ -12,6 +12,7 @@
namespace LibreNMS\Alert\Transport;
use LibreNMS\Alert\Transport;
use LibreNMS\Config;
class Kayako extends Transport
{
@@ -28,11 +29,10 @@ class Kayako extends Transport
public function contactKayako($host, $kayako)
{
global $config;
$url = $kayako['url']."/Tickets/Ticket";
$key = $kayako['key'];
$secret = $kayako['secret'];
$user = $config['email_from'];
$user = Config::get('email_from');
$department = $kayako['department'];
$ticket_type= 1;
$ticket_status = 1;

View File

@@ -12,6 +12,7 @@
namespace LibreNMS\Alert\Transport;
use LibreNMS\Alert\Transport;
use LibreNMS\Config;
class Osticket extends Transport
{
@@ -26,12 +27,10 @@ class Osticket extends Transport
public function contactOsticket($obj, $opts)
{
global $config;
$url = $opts['url'];
$token = $opts['token'];
foreach (parse_email($config['email_from']) as $from => $from_name) {
foreach (parse_email(Config::get('email_from')) as $from => $from_name) {
$email = $from_name . ' <' . $from . '>';
break;
}