Example #1
0
    $ZBX_TR_EXPR_ALLOWED_FUNCTIONS['fuzzytime'] = array('args' => null, 'item_types' => array(ITEM_VALUE_TYPE_FLOAT, ITEM_VALUE_TYPE_UINT64));
    $ZBX_TR_EXPR_ALLOWED_FUNCTIONS['iregexp'] = array('args' => array(0 => array('type' => 'str', 'mandat' => true)), 'item_types' => array(ITEM_VALUE_TYPE_STR, ITEM_VALUE_TYPE_LOG));
    $ZBX_TR_EXPR_ALLOWED_FUNCTIONS['last'] = array('args' => null, 'item_types' => array(ITEM_VALUE_TYPE_FLOAT, ITEM_VALUE_TYPE_UINT64, ITEM_VALUE_TYPE_STR, ITEM_VALUE_TYPE_TEXT));
    $ZBX_TR_EXPR_ALLOWED_FUNCTIONS['max'] = array('args' => array(0 => array('type' => 'sec_num', 'mandat' => true)), 'item_types' => array(ITEM_VALUE_TYPE_FLOAT, ITEM_VALUE_TYPE_UINT64));
    $ZBX_TR_EXPR_ALLOWED_FUNCTIONS['min'] = array('args' => array(0 => array('type' => 'sec_num', 'mandat' => true)), 'item_types' => array(ITEM_VALUE_TYPE_FLOAT, ITEM_VALUE_TYPE_UINT64));
    $ZBX_TR_EXPR_ALLOWED_FUNCTIONS['nodata'] = array('args' => array(0 => array('type' => 'sec', 'mandat' => true)), 'item_types' => null);
    $ZBX_TR_EXPR_ALLOWED_FUNCTIONS['now'] = array('args' => null, 'item_types' => null);
    $ZBX_TR_EXPR_ALLOWED_FUNCTIONS['prev'] = array('args' => null, 'item_types' => array(ITEM_VALUE_TYPE_FLOAT, ITEM_VALUE_TYPE_UINT64, ITEM_VALUE_TYPE_STR, ITEM_VALUE_TYPE_TEXT));
    $ZBX_TR_EXPR_ALLOWED_FUNCTIONS['str'] = array('args' => array(0 => array('type' => 'str', 'mandat' => true)), 'item_types' => array(ITEM_VALUE_TYPE_STR, ITEM_VALUE_TYPE_LOG));
    $ZBX_TR_EXPR_ALLOWED_FUNCTIONS['sum'] = array('args' => array(0 => array('type' => 'sec_num', 'mandat' => true)), 'item_types' => array(ITEM_VALUE_TYPE_FLOAT, ITEM_VALUE_TYPE_UINT64));
    $ZBX_TR_EXPR_ALLOWED_FUNCTIONS['logseverity'] = array('args' => null, 'item_types' => array(ITEM_VALUE_TYPE_LOG));
    $ZBX_TR_EXPR_ALLOWED_FUNCTIONS['logsource'] = array('args' => array(0 => array('type' => 'str', 'mandat' => true)), 'item_types' => array(ITEM_VALUE_TYPE_LOG));
    $ZBX_TR_EXPR_ALLOWED_FUNCTIONS['regexp'] = array('args' => array(0 => array('type' => 'str', 'mandat' => true)), 'item_types' => array(ITEM_VALUE_TYPE_STR, ITEM_VALUE_TYPE_LOG));
    $ZBX_TR_EXPR_ALLOWED_FUNCTIONS['time'] = array('args' => null, 'item_types' => null);
}
INIT_TRIGGER_EXPRESSION_STRUCTURES();
/*
 * Function: get_accessible_triggers
 *
 * Description:
 *     returns string of accessible triggers
 *
 * Author:
 *     Aly
 *
 */
function get_accessible_triggers($perm, $hostids, $perm_res = null, $nodeid = null, $cache = 1)
{
    global $USER_DETAILS;
    static $available_triggers;
    zbx_value2array($hostids);
 private function initializeVars()
 {
     $this->allowed = INIT_TRIGGER_EXPRESSION_STRUCTURES();
     $this->errors = array();
     $this->expressions = array();
     $this->data = array('hosts' => array(), 'usermacros' => array(), 'macros' => array(), 'items' => array(), 'itemParams' => array(), 'functions' => array(), 'functionParams' => array());
     $this->newExpr = array('part' => array('expression' => false, 'usermacro' => false, 'host' => false, 'item' => false, 'itemParam' => false, 'function' => false, 'functionParam' => false), 'object' => array('expression' => '', 'macro' => '', 'usermacro' => '', 'host' => '', 'item' => '', 'itemParam' => '', 'itemParamReal' => '', 'itemParamList' => '', 'function' => '', 'functionName' => '', 'functionParam' => '', 'functionParamReal' => '', 'functionParamList' => ''), 'params' => array('quoteClose' => false, 'comma' => 0, 'count' => 0, 'item' => array(), 'function' => array()));
     $this->currExpr = $this->newExpr;
     $this->symbols = array('sequence' => 0, 'open' => array('(' => 0, '{' => 0), 'close' => array(')' => 0, '}' => 0), 'linkage' => array('+' => 0, '-' => 0, '*' => 0, '/' => 0, '#' => 0, '=' => 0, '<' => 0, '>' => 0, '&' => 0, '|' => 0), 'expr' => array('$' => 0, '\\' => 0, ':' => 0, '.' => 0), 'params' => array('"' => 0, '[' => 0, ']' => 0, '(' => 0, ')' => 0));
     $this->previous = array('sequence' => '', 'last' => '', 'prelast' => '', 'lastNoSpace' => '', 'preLastNoSpace' => '');
 }