Cleanup for Scrutinizer

This commit is contained in:
f0o
2014-12-15 14:33:31 +00:00
parent 7d3fd3a29a
commit aeccdbb942
3 changed files with 5 additions and 4 deletions

View File

@@ -102,6 +102,7 @@ function RunAlerts() {
*/
function ExtTransports($obj) {
global $config;
$tmp = false; //To keep scrutinizer from naging because it doesnt understand eval
foreach( $config['alert']['transports'] as $transport=>$opts ) {
if( file_exists($config['install_dir']."/includes/alerts/transport.".$transport.".php") ) {
echo $transport." => ";
@@ -160,12 +161,11 @@ function FormatAlertTpl($tpl,$obj) {
* @return array
*/
function DescribeAlert($alert) {
$tmp = array();
$obj = array();
$i = 0;
$device = dbFetchRow("SELECT hostname FROM devices WHERE device_id = ?",array($alert['device_id']));
$obj['hostname'] = $device['hostname'];
$extra = $alert['details'];
$s = (sizeof($extra['rule']) > 1);
if( $alert['state'] == 1 ) {
$obj['title'] = 'Alert for device '.$device['hostname'].' Alert-ID #'.$alert['id'];
foreach( $extra['rule'] as $incident ) {
@@ -182,7 +182,6 @@ function DescribeAlert($alert) {
return false;
}
$extra = json_decode(gzuncompress($id['details']),true);
$s = (sizeof($extra['rule']) > 1);
$obj['title'] = 'Device '.$device['hostname'].' recovered from Alert-ID #'.$id['id'];
$obj['elapsed'] = TimeFormat(strtotime($alert['time_logged'])-strtotime($id['time_logged']));
$obj['id'] = $id['id'];
@@ -213,6 +212,7 @@ function TimeFormat($secs){
'm' => $secs / 60 % 60,
's' => $secs % 60
);
$ret = array();
foreach($bit as $k => $v){
if($v > 0) {
$ret[] = $v . $k;

View File

@@ -111,7 +111,6 @@ function GetContacts($results) {
$contacts = array();
$uids = array();
foreach( $results as $result ) {
$tmpa = array();
$tmp = NULL;
if( is_numeric($result["port_id"]) ) {
$tmpa = dbFetchRows("SELECT user_id FROM ports_perms WHERE access_level >= 0 AND port_id = ?",array($result["port_id"]));

View File

@@ -26,6 +26,8 @@ require_once("includes/discovery/functions.inc.php");
error_reporting(E_ERROR);
class ircbot {
private $data = "";
private $authd = array();
private $debug = false;
private $server = "";
private $port = "";