array(T_ZBX_INT, O_NO, null, DB_ID, '{form}=="update"'), "name"=> array(T_ZBX_STR, O_OPT, null, NOT_EMPTY, 'isset({save})'), "timezone"=> array(T_ZBX_INT, O_OPT, null, BETWEEN(-12,+13),'isset({save})'), "ip"=> array(T_ZBX_IP, O_OPT, null, null, 'isset({save})'), "port"=> array(T_ZBX_INT, O_OPT, null, BETWEEN(1,65535),'isset({save})'), "slave_history"=> array(T_ZBX_INT, O_OPT, null, BETWEEN(0,65535),'isset({save})'), "slave_trends"=> array(T_ZBX_INT, O_OPT, null, BETWEEN(0,65535),'isset({save})'), /* actions */ "save"=> array(T_ZBX_STR, O_OPT, P_SYS|P_ACT, NULL, NULL), "delete"=> array(T_ZBX_STR, O_OPT, P_SYS|P_ACT, NULL, NULL), "cancel"=> array(T_ZBX_STR, O_OPT, P_SYS|P_ACT, NULL, NULL), /* other */ "form"=> array(T_ZBX_STR, O_OPT, P_SYS, NULL, NULL), "form_refresh"=> array(T_ZBX_INT, O_OPT, NULL, NULL, NULL) ); check_fields($fields); $accessible_nodes = get_accessible_nodes_by_user($USER_DETAILS,PERM_READ_LIST); if(isset($_REQUEST["nodeid"]) && !in_array($_REQUEST["nodeid"], explode(',',$accessible_nodes))) { access_deny(); } ?> AddItem(new CButton('form',S_NEW_NODE)); show_table_header(S_NODES_BIG,$form); $table=new CTableInfo(S_NO_NODES_DEFINED); $table->SetHeader(array(S_NAME,S_TYPE,S_TIME_ZONE,S_IP.':'.S_PORT)); $db_nodes = DBselect('select * from nodes where nodeid in ('. get_accessible_nodes_by_user($USER_DETAILS,PERM_READ_LIST).') '. ' order by nodetype desc, masterid, name '); while($row=DBfetch($db_nodes)) { $table->AddRow(array( array( get_node_path($row['masterid']), new CLink( ($row['nodetype'] ? new CSpan($row["name"], 'bold') : $row["name"]), "?&form=update&nodeid=".$row["nodeid"],'action')), $row['nodetype'] ? new CSpan(S_LOCAL,'bold') : S_REMOTE, new CSpan("GMT".sprintf("%+03d:00", $row['timezone']), $row['nodetype'] ? 'bold' : null), new CSpan($row['ip'].':'.$row['port'], $row['nodetype'] ? 'bold' : null) )); } $table->Show(); } ?>