mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 16:24:54 +02:00
New networkmaps in progress... (Fixed "erase node" function and more things)
This commit is contained in:
parent
67a4d5e75e
commit
7a513db06b
@ -867,27 +867,35 @@ function erase_node($id) {
|
|||||||
$nodes = db_get_all_rows_filter('titem',
|
$nodes = db_get_all_rows_filter('titem',
|
||||||
array(
|
array(
|
||||||
'id_map' => $node['id_map'],
|
'id_map' => $node['id_map'],
|
||||||
'source_data' => $node['id_agent'],
|
'source_data' => $node['source_data'],
|
||||||
|
'type' => $node['type'],
|
||||||
'id' => $id['id']
|
'id' => $id['id']
|
||||||
));
|
));
|
||||||
|
|
||||||
foreach ($nodes as $node) {
|
foreach ($nodes as $node) {
|
||||||
db_process_sql_update('titem',
|
db_process_sql_update('titem',
|
||||||
array('deleted' => 1), array('id' => $node['id']));
|
array('deleted' => 1), array('id' => (int)$node['id'], 'type' => (int)$node['type']));
|
||||||
|
|
||||||
db_process_sql_update('trel_item',
|
db_process_sql_update('trel_item',
|
||||||
array('deleted' => 1), array('id_parent' => $node['id']));
|
array('deleted' => 1), array('id_parent' => (int)$node['id']));
|
||||||
db_process_sql_update('trel_item',
|
db_process_sql_update('trel_item',
|
||||||
array('deleted' => 1), array('id_child' => $node['id']));
|
array('deleted' => 1), array('id_child' => (int)$node['id']));
|
||||||
}
|
}
|
||||||
|
|
||||||
db_process_sql_update('trel_item',
|
db_process_sql_update('trel_item',
|
||||||
array('deleted' => 1), array('id_parent' => $id));
|
array('deleted' => 1), array('id_parent' => (int)$node['id']));
|
||||||
db_process_sql_update('trel_item',
|
db_process_sql_update('trel_item',
|
||||||
array('deleted' => 1), array('id_child' => $id));
|
array('deleted' => 1), array('id_child' => (int)$node['id']));
|
||||||
|
|
||||||
return (bool)db_process_sql_update('titem',
|
$return = db_process_sql_update('titem',
|
||||||
array('deleted' => 1), array('id' => $id));
|
array('deleted' => 1), array('id' => (int)$node['id'], 'type' => (int)$node['type']));
|
||||||
|
|
||||||
|
if ($return === false) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function networkmap_delete_nodes_by_agent($id_agent) {
|
function networkmap_delete_nodes_by_agent($id_agent) {
|
||||||
|
@ -752,12 +752,12 @@ function add_agent_node(agents) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function show_details_agent(d) {
|
function show_details_agent(d) {
|
||||||
if (d.networkmap_id != 0) {
|
if (d.map_id != 0) {
|
||||||
url = "index.php?" +
|
url = "index.php?" +
|
||||||
"sec=network&" +
|
"sec=network&" +
|
||||||
"sec2=operation/agentes/pandora_networkmap&" +
|
"sec2=operation/agentes/pandora_networkmap&" +
|
||||||
"tab=view&" +
|
"tab=view&" +
|
||||||
"id_networkmap=" + d.networkmap_id;
|
"id_networkmap=" + d.map_id;
|
||||||
|
|
||||||
window.location.href = url;
|
window.location.href = url;
|
||||||
}
|
}
|
||||||
|
@ -17,8 +17,8 @@ if (! isset($_SESSION["id_usuario"])) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Global & session management
|
// Global & session management
|
||||||
require_once ('../../../include/config.php');
|
require_once ($config['homedir'] . '/include/config.php');
|
||||||
require_once ('../../../include/auth/mysql.php');
|
require_once ($config['homedir'] . '/include/auth/mysql.php');
|
||||||
require_once ($config['homedir'] . '/include/functions.php');
|
require_once ($config['homedir'] . '/include/functions.php');
|
||||||
require_once ($config['homedir'] . '/include/functions_db.php');
|
require_once ($config['homedir'] . '/include/functions_db.php');
|
||||||
require_once ($config['homedir'] . '/include/functions_reporting.php');
|
require_once ($config['homedir'] . '/include/functions_reporting.php');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user