mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
Add remote agent filter in manage agent, add remote field in database #4121
This commit is contained in:
parent
b78d417410
commit
9523557145
@ -111,4 +111,5 @@ ALTER TABLE tnetwork_component ADD COLUMN `dynamic_two_tailed` tinyint(1) unsign
|
|||||||
-- ---------------------------------------------------------------------
|
-- ---------------------------------------------------------------------
|
||||||
-- Table `tagente`
|
-- Table `tagente`
|
||||||
-- ---------------------------------------------------------------------
|
-- ---------------------------------------------------------------------
|
||||||
ALTER TABLE tagente ADD `transactional_agent` tinyint(1) NOT NULL default 0;
|
ALTER TABLE tagente ADD `transactional_agent` tinyint(1) NOT NULL default 0;
|
||||||
|
ALTER TABLE tagente ADD `remote` tinyint(1) NOT NULL default 0;
|
||||||
|
@ -89,4 +89,5 @@ ALTER TABLE tnetwork_component ADD COLUMN dynamic_two_tailed tinyint(1) unsigned
|
|||||||
-- ---------------------------------------------------------------------
|
-- ---------------------------------------------------------------------
|
||||||
-- Table `tagente`
|
-- Table `tagente`
|
||||||
-- ---------------------------------------------------------------------
|
-- ---------------------------------------------------------------------
|
||||||
ALTER TABLE tagente ADD transactional_agent tinyint(1) NOT NULL default 0;
|
ALTER TABLE tagente ADD transactional_agent tinyint(1) NOT NULL default 0;
|
||||||
|
ALTER TABLE tagente ADD remoteto tinyint(1) NOT NULL default 0;
|
||||||
|
@ -26,4 +26,5 @@ ALTER TABLE tnetwork_component ADD COLUMN dynamic_two_tailed tinyint(1) unsigned
|
|||||||
-- ---------------------------------------------------------------------
|
-- ---------------------------------------------------------------------
|
||||||
-- Table `tagente`
|
-- Table `tagente`
|
||||||
-- ---------------------------------------------------------------------
|
-- ---------------------------------------------------------------------
|
||||||
ALTER TABLE tagente ADD transactional_agent tinyint(1) NOT NULL default 0;
|
ALTER TABLE tagente ADD transactional_agent tinyint(1) NOT NULL default 0;
|
||||||
|
ALTER TABLE tagente ADD remote tinyint(1) NOT NULL default 0;
|
||||||
|
@ -178,7 +178,8 @@ echo "</tr></table>";
|
|||||||
$order_collation = "";
|
$order_collation = "";
|
||||||
switch ($config["dbtype"]) {
|
switch ($config["dbtype"]) {
|
||||||
case "mysql":
|
case "mysql":
|
||||||
$order_collation = "COLLATE utf8_general_ci";
|
$order_collation = "";
|
||||||
|
//$order_collation = "COLLATE utf8_general_ci";
|
||||||
break;
|
break;
|
||||||
case "postgresql":
|
case "postgresql":
|
||||||
case "oracle":
|
case "oracle":
|
||||||
@ -194,6 +195,22 @@ $selectOsDown = '';
|
|||||||
$selectGroupUp = '';
|
$selectGroupUp = '';
|
||||||
$selectGroupDown = '';
|
$selectGroupDown = '';
|
||||||
switch ($sortField) {
|
switch ($sortField) {
|
||||||
|
case 'remote':
|
||||||
|
switch ($sort) {
|
||||||
|
case 'up':
|
||||||
|
$selectRemoteUp = $selected;
|
||||||
|
$order = array('field' => 'remote ' . $order_collation,
|
||||||
|
'field2' => 'nombre ' . $order_collation,
|
||||||
|
'order' => 'ASC');
|
||||||
|
break;
|
||||||
|
case 'down':
|
||||||
|
$selectRemoteDown = $selected;
|
||||||
|
$order = array('field' => 'remote ' . $order_collation,
|
||||||
|
'field2' => 'nombre ' . $order_collation,
|
||||||
|
'order' => 'DESC');
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case 'name':
|
case 'name':
|
||||||
switch ($sort) {
|
switch ($sort) {
|
||||||
case 'up':
|
case 'up':
|
||||||
@ -460,7 +477,10 @@ if ($agents !== false) {
|
|||||||
'<a href="index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search .'&offset='.$offset.'&sort_field=name&sort=up&disabled=$disabled">' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '</a>' .
|
'<a href="index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search .'&offset='.$offset.'&sort_field=name&sort=up&disabled=$disabled">' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '</a>' .
|
||||||
'<a href="index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search .'&offset='.$offset.'&sort_field=name&sort=down&disabled=$disabled">' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . '</a>';
|
'<a href="index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search .'&offset='.$offset.'&sort_field=name&sort=down&disabled=$disabled">' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . '</a>';
|
||||||
echo "</th>";
|
echo "</th>";
|
||||||
echo "<th title='".__('Remote agent configuration')."'>".__('R')."</th>";
|
echo "<th title='".__('Remote agent configuration')."'>".__('R'). ' ' .
|
||||||
|
'<a href="index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search .'&offset='.$offset.'&sort_field=remote&sort=up&disabled=$disabled">' . html_print_image("images/sort_up.png", true, array("style" => $selectRemoteUp)) . '</a>' .
|
||||||
|
'<a href="index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search .'&offset='.$offset.'&sort_field=remote&sort=down&disabled=$disabled">' . html_print_image("images/sort_down.png", true, array("style" => $selectRemoteDown)) . '</a>';
|
||||||
|
echo "</th>";
|
||||||
echo "<th>".__('OS'). ' ' .
|
echo "<th>".__('OS'). ' ' .
|
||||||
'<a href="index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search .'&offset='.$offset.'&sort_field=os&sort=up&disabled=$disabled">' . html_print_image("images/sort_up.png", true, array("style" => $selectOsUp)) . '</a>' .
|
'<a href="index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search .'&offset='.$offset.'&sort_field=os&sort=up&disabled=$disabled">' . html_print_image("images/sort_up.png", true, array("style" => $selectOsUp)) . '</a>' .
|
||||||
'<a href="index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search .'&offset='.$offset.'&sort_field=os&sort=down&disabled=$disabled">' . html_print_image("images/sort_down.png", true, array("style" => $selectOsDown)) . '</a>';
|
'<a href="index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search .'&offset='.$offset.'&sort_field=os&sort=down&disabled=$disabled">' . html_print_image("images/sort_down.png", true, array("style" => $selectOsDown)) . '</a>';
|
||||||
@ -476,6 +496,18 @@ if ($agents !== false) {
|
|||||||
$rowPair = true;
|
$rowPair = true;
|
||||||
$iterator = 0;
|
$iterator = 0;
|
||||||
foreach ($agents as $agent) {
|
foreach ($agents as $agent) {
|
||||||
|
|
||||||
|
/* Begin Update tagente.remote 0/1 with remote agent function return */
|
||||||
|
|
||||||
|
if(config_agents_has_remote_configuration($agent['id_agente'])){
|
||||||
|
db_process_sql_update('tagente', array('remote' => 1),'id_agente = '.$agent['id_agente'].'');
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
db_process_sql_update('tagente', array('remote' => 0),'id_agente = '.$agent['id_agente'].'');
|
||||||
|
}
|
||||||
|
|
||||||
|
/* End Update tagente.remote 0/1 with remote agent function return */
|
||||||
|
|
||||||
$id_grupo = $agent["id_grupo"];
|
$id_grupo = $agent["id_grupo"];
|
||||||
|
|
||||||
if (! check_acl ($config["id_user"], $id_grupo, "AW", $agent['id_agente']) && ! check_acl ($config["id_user"], $id_grupo, "AD", $agent['id_agente']))
|
if (! check_acl ($config["id_user"], $id_grupo, "AW", $agent['id_agente']) && ! check_acl ($config["id_user"], $id_grupo, "AD", $agent['id_agente']))
|
||||||
|
@ -86,6 +86,7 @@ CREATE TABLE tagente (
|
|||||||
agent_version VARCHAR2(100) DEFAULT '',
|
agent_version VARCHAR2(100) DEFAULT '',
|
||||||
ultimo_contacto_remoto TIMESTAMP DEFAULT to_timestamp('1970-01-01 00:00:00', 'yyyy-mm-dd hh24:mi:ss'),
|
ultimo_contacto_remoto TIMESTAMP DEFAULT to_timestamp('1970-01-01 00:00:00', 'yyyy-mm-dd hh24:mi:ss'),
|
||||||
disabled NUMBER(5, 0) DEFAULT 0,
|
disabled NUMBER(5, 0) DEFAULT 0,
|
||||||
|
remote NUMBER(5, 0) DEFAULT 0,
|
||||||
id_parent NUMBER(10, 0) DEFAULT 0,
|
id_parent NUMBER(10, 0) DEFAULT 0,
|
||||||
custom_id VARCHAR2(255) DEFAULT '',
|
custom_id VARCHAR2(255) DEFAULT '',
|
||||||
server_name VARCHAR2(100) DEFAULT '',
|
server_name VARCHAR2(100) DEFAULT '',
|
||||||
|
@ -67,6 +67,7 @@ CREATE TABLE "tagente" (
|
|||||||
"agent_version" varchar(100) default '',
|
"agent_version" varchar(100) default '',
|
||||||
"ultimo_contacto_remoto" TIMESTAMP without time zone default '1970-01-01 00:00:00',
|
"ultimo_contacto_remoto" TIMESTAMP without time zone default '1970-01-01 00:00:00',
|
||||||
"disabled" SMALLINT NOT NULL default 0,
|
"disabled" SMALLINT NOT NULL default 0,
|
||||||
|
"remote" SMALLINT NOT NULL default 0,
|
||||||
"id_parent" INTEGER default 0,
|
"id_parent" INTEGER default 0,
|
||||||
"custom_id" varchar(255) default '',
|
"custom_id" varchar(255) default '',
|
||||||
"server_name" varchar(100) default '',
|
"server_name" varchar(100) default '',
|
||||||
|
@ -62,6 +62,7 @@ CREATE TABLE IF NOT EXISTS `tagente` (
|
|||||||
`agent_version` varchar(100) default '',
|
`agent_version` varchar(100) default '',
|
||||||
`ultimo_contacto_remoto` datetime default '1970-01-01 00:00:00',
|
`ultimo_contacto_remoto` datetime default '1970-01-01 00:00:00',
|
||||||
`disabled` tinyint(2) NOT NULL default '0',
|
`disabled` tinyint(2) NOT NULL default '0',
|
||||||
|
`remote` tinyint(1) NOT NULL default 0,
|
||||||
`id_parent` int(10) unsigned default '0',
|
`id_parent` int(10) unsigned default '0',
|
||||||
`custom_id` varchar(255) default '',
|
`custom_id` varchar(255) default '',
|
||||||
`server_name` varchar(100) default '',
|
`server_name` varchar(100) default '',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user