2019-09-17 13:41:21 +02:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Integria incidents management.
|
|
|
|
*
|
|
|
|
* @category Ajax library.
|
|
|
|
* @package Pandora FMS
|
|
|
|
* @subpackage Modules.
|
|
|
|
* @version 1.0.0
|
|
|
|
* @license See below
|
|
|
|
*
|
|
|
|
* ______ ___ _______ _______ ________
|
2023-06-08 12:42:10 +02:00
|
|
|
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
|
|
|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
2019-09-17 13:41:21 +02:00
|
|
|
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
|
|
|
*
|
|
|
|
* ============================================================================
|
2023-06-08 11:53:13 +02:00
|
|
|
* Copyright (c) 2005-2023 Pandora FMS
|
2023-06-08 13:19:01 +02:00
|
|
|
* Please see https://pandorafms.com/community/ for full contribution list
|
2019-09-17 13:41:21 +02:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation for version 2.
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
* ============================================================================
|
|
|
|
*/
|
|
|
|
|
|
|
|
if (check_login()) {
|
|
|
|
global $config;
|
|
|
|
|
2019-09-23 15:16:31 +02:00
|
|
|
include_once $config['homedir'].'/include/functions_integriaims.php';
|
2019-09-17 13:41:21 +02:00
|
|
|
|
|
|
|
$get_users = get_parameter('get_users');
|
|
|
|
$search_term = get_parameter('search_term', '');
|
|
|
|
|
|
|
|
if ($get_users) {
|
2021-05-07 14:29:29 +02:00
|
|
|
$integria_users_csv = integria_api_call(null, null, null, null, 'get_users', []);
|
2019-09-17 13:41:21 +02:00
|
|
|
|
|
|
|
$csv_array = explode("\n", $integria_users_csv);
|
|
|
|
|
|
|
|
foreach ($csv_array as $csv_line) {
|
|
|
|
if (!empty($csv_line)) {
|
|
|
|
$integria_users_values[$csv_line] = $csv_line;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$integria_users_filtered_values = array_filter(
|
|
|
|
$integria_users_values,
|
|
|
|
function ($item) use ($search_term) {
|
|
|
|
if (strpos($item, $search_term) !== false) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
echo json_encode($integria_users_filtered_values);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|