2010-10-14 Miguel de Dios <miguel.dedios@artica.es>

* pandoradb.sql, extras/pandoradb_migrate_v3.1_to_v3.2.sql: added in the
	table "tagente_modulo" the field "policy_adopted" for to set a module
	pre exist in policy as adopted.
	
	*operation/agentes/status_monitor.php,
	operation/agentes/estado_ultimopaquete.php,
	operation/agentes/estado_monitores.php,
	godmode/agentes/module_manager_editor_common.php,
	godmode/agentes/module_manager.php: show the icon of "adopted" or "adopted 
	but unlinked" in the list of modules.
	
	Pending tasks: #3083123
	

	
	* include/functions_modules.php: cleaned source code style in function
	"update_agent_module".
	
	* godmode/agentes/module_manager_editor_network.php: fixed warning messages
	when use this file in policies.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3402 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2010-10-14 15:09:29 +00:00
parent edebaa4bc2
commit 0aedfa3a38
10 changed files with 145 additions and 20 deletions

View File

@ -1,3 +1,26 @@
2010-10-14 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, extras/pandoradb_migrate_v3.1_to_v3.2.sql: added in the
table "tagente_modulo" the field "policy_adopted" for to set a module
pre exist in policy as adopted.
*operation/agentes/status_monitor.php,
operation/agentes/estado_ultimopaquete.php,
operation/agentes/estado_monitores.php,
godmode/agentes/module_manager_editor_common.php,
godmode/agentes/module_manager.php: show the icon of "adopted" or "adopted
but unlinked" in the list of modules.
Pending tasks: #3083123
* include/functions_modules.php: cleaned source code style in function
"update_agent_module".
* godmode/agentes/module_manager_editor_network.php: fixed warning messages
when use this file in policies.
2010-10-14 Sergio Martin <sergio.martin@artica.es>
* images/policies_not_brick.png: Added a module-not-policy

View File

@ -69,6 +69,7 @@ CREATE TABLE IF NOT EXISTS `tnetwork_map` (
ALTER TABLE `tagente_modulo` ADD COLUMN `id_policy_module` INTEGER UNSIGNED NOT NULL DEFAULT 0 AFTER `nombre`;
ALTER TABLE `tagente_modulo` ADD COLUMN `policy_linked` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0 AFTER `delete_pending`;
ALTER TABLE `tagente_modulo` ADD COLUMN `policy_adopted` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0;
-- -----------------------------------------------------
-- Table `talert_template_modules`

View File

@ -119,6 +119,7 @@ if ($multiple_delete) {
}
}
// ==========================
// MODULE VISUALIZATION TABLE
// ==========================
@ -296,13 +297,30 @@ foreach ($modules as $module) {
else {
$linked = isModuleLinked($module['id_agente_modulo']);
$adopt = false;
if (isModuleAdopt($module['id_agente_modulo'])) {
$adopt = true;
}
if ($linked) {
$img = 'images/policies.png';
$title = $policyInfo['name_policy'];
if ($adopt) {
$img = 'images/policies_brick.png';
$title = __('(Adopt) ') . $policyInfo['name_policy'];
}
else {
$img = 'images/policies.png';
$title = $policyInfo['name_policy'];
}
}
else {
$img = 'images/unlinkpolicy.png';
$title = __('(Unlinked) ') . $policyInfo['name_policy'];
if ($adopt) {
$img = 'images/policies_not_brick.png';
$title = __('(Adopt) (Unlinked) ') . $policyInfo['name_policy'];
}
else {
$img = 'images/unlinkpolicy.png';
$title = __('(Unlinked) ') . $policyInfo['name_policy'];
}
}
$data[1] = '<a href="?sec=gpolicies&sec2=enterprise/godmode/policies/policies&id=' . $policyInfo['id_policy'] . '">' .

View File

@ -125,7 +125,22 @@ $table_simple->data[0][2] = __('Disabled');
$table_simple->data[0][3] = print_checkbox ("disabled", 1, $disabled, true);
$table_simple->data[1][0] = __('Type').' '.print_help_icon ('module_type', true);
if ($id_agent_module) {
if (isset($id_agent_module)) {
if ($id_agent_module) {
$edit = false;
}
else {
$edit = true;
}
}
else
{
//Run into a policy
$edit = true;
}
if (!$edit) {
$table_simple->data[1][1] = '<em>'.get_moduletype_description ($id_module_type).'</em>';
}
else {

View File

@ -113,17 +113,30 @@ if ($id_module_type >= 15 && $id_module_type <= 18) {
/* SNMP */
$table_advanced->rowstyle['tcp_send'] = 'display: none';
$table_advanced->rowstyle['tcp_receive'] = 'display: none';
} elseif ($id_module_type >= 8 && $id_module_type <= 11) {
}
elseif ($id_module_type >= 8 && $id_module_type <= 11) {
/* TCP or ICMP */
$table_simple->rowstyle['snmp_1'] = 'display: none';
$table_simple->rowstyle['snmp_2'] = 'display: none';
} elseif (empty ($update_module_id)) {
}
elseif (empty ($update_module_id)) {
$table_advanced->rowstyle['tcp_send'] = 'display: none';
$table_advanced->rowstyle['tcp_receive'] = 'display: none';
$table_simple->rowstyle['snmp_1'] = 'display: none';
$table_simple->rowstyle['snmp_2'] = 'display: none';
}
//For a policy
if (!isset($id_agent_module)) {
$snmp3_auth_user = '';
$snmp3_auth_pass = '';
$snmp_version = 1;
$snmp3_privacy_method = '';
$snmp3_privacy_pass = '';
$snmp3_auth_method = '';
$snmp3_security_level = '';
}
$data = array();
$data[0] = __('Auth user');
$data[1] = print_input_text ('snmp3_auth_user', $snmp3_auth_user, '', 15, 60, true);

View File

@ -145,9 +145,12 @@ function delete_agent_module ($id_agent_module) {
function update_agent_module ($id, $values, $onlyNoDeletePending = false) {
if (! is_array ($values) || empty ($values))
return false;
if (isset ($values['nombre']) && empty ($values['nombre']))
return false;
if ($onlyNoDeletePending) {
return (@process_sql_update ('tagente_modulo', $values,
array ('id_agente_modulo' => (int) $id, 'delete_pending' => 0)) !== false);

View File

@ -202,19 +202,36 @@ foreach ($modules as $module) {
}
if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) {
if($module["id_policy_module"] != 0) {
if ($module["id_policy_module"] != 0) {
$linked = isModuleLinked($module['id_agente_modulo']);
$id_policy = get_db_value_sql('SELECT id_policy FROM tpolicy_modules WHERE id = '.$module["id_policy_module"]);
$name_policy = get_db_value_sql('SELECT name FROM tpolicies WHERE id = '.$id_policy);
$policyInfo = infoModulePolicy($module["id_policy_module"]);
$adopt = false;
if (isModuleAdopt($module['id_agente_modulo'])) {
$adopt = true;
}
if ($linked) {
$img = 'images/policies.png';
$title = $name_policy;
if ($adopt) {
$img = 'images/policies_brick.png';
$title = __('(Adopt) ') . $name_policy;
}
else {
$img = 'images/policies.png';
$title = $name_policy;
}
}
else {
$img = 'images/unlinkpolicy.png';
$title = __('(Unlinked) ') . $name_policy;
if ($adopt) {
$img = 'images/policies_not_brick.png';
$title = __('(Unlinked) (Adopt) ') . $name_policy;
}
else {
$img = 'images/unlinkpolicy.png';
$title = __('(Unlinked) ') . $name_policy;
}
}
$data[1] = '<a href="?sec=gpolicies&sec2=enterprise/godmode/policies/policies&id=' . $id_policy . '">' .

View File

@ -226,13 +226,30 @@ foreach ($modules as $module) {
$name_policy = get_db_value_sql('SELECT name FROM tpolicies WHERE id = '.$id_policy);
$policyInfo = infoModulePolicy($module["id_policy_module"]);
$adopt = false;
if (isModuleAdopt($module['id_agente_modulo'])) {
$adopt = true;
}
if ($linked) {
$img = 'images/policies.png';
$title = $name_policy;
if ($adopt) {
$img = 'images/policies_brick.png';
$title = __('(Adopt) ') . $name_policy;
}
else {
$img = 'images/policies.png';
$title = $name_policy;
}
}
else {
$img = 'images/unlinkpolicy.png';
$title = __('(Unlinked) ') . $name_policy;
if ($adopt) {
$img = 'images/policies_not_brick.png';
$title = __('(Unlinked) (Adopt) ') . $name_policy;
}
else {
$img = 'images/unlinkpolicy.png';
$title = __('(Unlinked) ') . $name_policy;
}
}
echo "<td>";

View File

@ -223,13 +223,30 @@ foreach ($result as $row) {
else {
$linked = isModuleLinked($row['id_agente_modulo']);
$adopt = false;
if (isModuleAdopt($row['id_agente_modulo'])) {
$adopt = true;
}
if ($linked) {
$img = 'images/policies.png';
$title = $policyInfo['name_policy'];
if ($adopt) {
$img = 'images/policies_brick.png';
$title = __('(Adopt) ') . $policyInfo['name_policy'];
}
else {
$img = 'images/policies.png';
$title = $policyInfo['name_policy'];
}
}
else {
$img = 'images/unlinkpolicy.png';
$title = __('(Unlinked) ') . $policyInfo['name_policy'];
if ($adopt) {
$img = 'images/policies_not_brick.png';
$title = __('(Unlinked) (Adopt) ') . $policyInfo['name_policy'];
}
else {
$img = 'images/unlinkpolicy.png';
$title = __('(Unlinked) ') . $policyInfo['name_policy'];
}
}
$data[0] = '<a href="?sec=gpolicies&sec2=enterprise/godmode/policies/policies&id=' . $policyInfo['id_policy'] . '">' .

View File

@ -177,6 +177,7 @@ CREATE TABLE IF NOT EXISTS `tagente_modulo` (
`min_ff_event` int(4) unsigned default '0',
`delete_pending` int(1) unsigned default 0,
`policy_linked` tinyint(1) unsigned not null default 0,
`policy_adopted` tinyint(1) unsigned not null default 0,
`custom_string_1` text default '',
`custom_string_2` text default '',
`custom_string_3` text default '',